summaryrefslogtreecommitdiffstats
path: root/build_tools
diff options
context:
space:
mode:
Diffstat (limited to 'build_tools')
-rwxr-xr-xbuild_tools/bin/mp49
1 files changed, 42 insertions, 7 deletions
diff --git a/build_tools/bin/mp b/build_tools/bin/mp
index 5ff295d..151980c 100755
--- a/build_tools/bin/mp
+++ b/build_tools/bin/mp
@@ -8,10 +8,8 @@
PKGHOME=/data/pkg_repo/packages
SRCPKGHOME=/data/pkg_repo/src_packages
mydir=`pwd`
-TOTALPKG="$pkgname"-"$pkgver"-"$pkgrel"-"$CARCH".pkg.tar.gz
-SRCPKG="$pkgname"-"$pkgver"-"$pkgrel".src.tar.gz
repolist="core extra"
-
+cmdline=$@
if [ x`basename $0` = xmpr ]
then
PFIX=""
@@ -19,6 +17,30 @@ else
PFIX="-testing"
fi
+function bump {
+ echo x$cmdline | grep -q \\-b
+ if [ $? = 0 ]
+ then
+ cmdline=`echo $cmdline|sed -e "s/-b//g"`
+ i="PKGBUILD"
+ #getting pkgrel number after =
+ package_pkgrel=`cat $i | grep pkgrel= | cut -d'=' -f 2`
+
+ #extract number before dot in pkgrel
+ beforedot=`echo $package_pkgrel | cut -n -d'.' -f 1`
+
+ #add 1 to pkgrel
+ new_pkgrel=$[$beforedot+1]
+
+ #write it back to PKGBUILD
+ sed -i "s:pkgrel=${package_pkgrel}:pkgrel=${new_pkgrel}:g" $i
+ echo "bumped $pkgname release from $package_pkgrel to $new_pkgrel"
+ . PKGBUILD
+ fi
+ TOTALPKG="$pkgname"-"$pkgver"-"$pkgrel"-"$CARCH".pkg.tar.gz
+ SRCPKG="$pkgname"-"$pkgver"-"$pkgrel".src.tar.gz
+
+}
@@ -66,7 +88,7 @@ function update-repo {
DELPKG="$pkgname"-"$pkgver"-*-"$CARCH".pkg.tar.gz
#echo $DOCROOT
#echo $DELPKG
- echo "Removing old packages from:"
+ echo "Removing old packages from $CARCH/$REPO:"
rm -fvI $DELPKG
#copy in new package
echo
@@ -92,6 +114,7 @@ function update-src-pkg {
}
function dup_check {
+
if [ $REPO = "local" -o $REPO = "mv-core" ]
then
return
@@ -108,8 +131,17 @@ function dup_check {
echo "$pkgname already exists in $i$PFIX"
echo " "$out
echo
- echo "#######################################"
- exit 2
+
+ echo x$cmdline|grep -q \\-f
+ if [ $? = 0 ]
+ then
+ echo "Force detected, making pkg anyhow"
+ echo "#######################################"
+ return
+ else
+ echo "#######################################"
+ exit 2
+ fi
fi
fi
done
@@ -120,7 +152,10 @@ function dup_check {
find_repo
dup_check
-makepkg --asroot $@ || exit 1
+bump
+echo "---------------"
+
+makepkg --asroot $cmdline || exit 1
echo "---------updating database ----------"
update-repo #&& pacman -Sy
echo "----------creating source package---------"