From 4c8a2b26b0034e96fdc1ef47904ce00fa9792b06 Mon Sep 17 00:00:00 2001 From: James Meyer Date: Fri, 8 May 2009 15:50:32 -0500 Subject: mp: add duplicate checking & autobump. If a duplicate pkg is detected the script will inform you and exit. -f may be used to force the creation of the pkg even if it's duplicate. Autobump: -b will increment the pkgver number by one. --- build_tools/bin/mp | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/build_tools/bin/mp b/build_tools/bin/mp index 884fece..5ff295d 100755 --- a/build_tools/bin/mp +++ b/build_tools/bin/mp @@ -10,6 +10,7 @@ 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" if [ x`basename $0` = xmpr ] then @@ -57,8 +58,6 @@ function find_repo { function update-repo { - - cd $DOCROOT echo echo "DOCROOT=$DOCROOT" @@ -92,11 +91,35 @@ function update-src-pkg { cp -f $PKGHOME/$SRCPKG $SRCPKGHOME/$REPO } +function dup_check { + if [ $REPO = "local" -o $REPO = "mv-core" ] + then + return + fi + + for i in $repolist + do + if [ ! $i$PFIX = $REPO ] + then + out=`pacman -Sl $i$PFIX|grep $pkgname` + if [ $? = 0 ] + then + echo "#######################################" + echo "$pkgname already exists in $i$PFIX" + echo " "$out + echo + echo "#######################################" + exit 2 + fi + fi + done + +} #MAIN PROGRAM find_repo - +dup_check makepkg --asroot $@ || exit 1 echo "---------updating database ----------" update-repo #&& pacman -Sy -- cgit v0.12