summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2009-05-08 20:50:32 (GMT)
committerJames Meyer <james.meyer@operamail.com>2009-05-08 20:50:32 (GMT)
commit4c8a2b26b0034e96fdc1ef47904ce00fa9792b06 (patch)
tree5800e0a76204d29a45f395fcff5cb5dfb8993133
parentaa4a7b5724ae99ca7a7ab9855bce12c308715129 (diff)
downloadlinhes_dev-4c8a2b26b0034e96fdc1ef47904ce00fa9792b06.zip
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.
-rwxr-xr-xbuild_tools/bin/mp29
1 files 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