diff options
author | James Meyer <james.meyer@operamail.com> | 2009-05-08 21:03:22 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2009-05-08 21:03:22 (GMT) |
commit | 703b80388faaab775c94f935017c33e45bc46c25 (patch) | |
tree | b847555529ea43b3a7832ba664c1284743e92abe /build_tools/bin/mp | |
parent | 4c8a2b26b0034e96fdc1ef47904ce00fa9792b06 (diff) | |
download | linhes_dev-703b80388faaab775c94f935017c33e45bc46c25.zip |
mp : bug fix for pkgrel when using -b.
Needed to resource the PKGBUILD after bumping it
Diffstat (limited to 'build_tools/bin/mp')
-rwxr-xr-x | build_tools/bin/mp | 49 |
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---------" |