summaryrefslogtreecommitdiffstats
path: root/build_tools/bin/mp
diff options
context:
space:
mode:
Diffstat (limited to 'build_tools/bin/mp')
-rwxr-xr-xbuild_tools/bin/mp67
1 files changed, 67 insertions, 0 deletions
diff --git a/build_tools/bin/mp b/build_tools/bin/mp
new file mode 100755
index 0000000..c69c622
--- /dev/null
+++ b/build_tools/bin/mp
@@ -0,0 +1,67 @@
+#!/bin/bash
+# Used to compile a package and copy it to the correct repository location.
+# all arguments are passed to makepkg
+#
+#
+. /etc/makepkg.conf
+. PKGBUILD
+PKGHOME=/data/pkg_repo/packages
+mydir=`pwd`
+TOTALPKG="$pkgname"-"$pkgver"-"$pkgrel"-"$CARCH".pkg.tar.gz
+
+
+if [ x`basename $0` = xmpr ]
+then
+ PFIX=""
+else
+ PFIX="-testing"
+fi
+
+
+
+
+function find_repo {
+ echo $mydir|grep -q "extra"
+ if [ $? = 0 ]
+ then
+ REPO=extra${PFIX}
+ else
+ REPO=core${PFIX}
+ fi
+ DOCROOT=/data/pkg_repo/$CARCH/$REPO
+}
+
+
+function update-repo {
+
+
+ cd $DOCROOT
+ echo
+ echo "DOCROOT=$DOCROOT"
+ echo
+ #remove old package from local copy
+ DELPKG="$pkgname"-"$pkgver"-*-"$CARCH".pkg.tar.gz
+ #echo $DOCROOT
+ #echo $DELPKG
+ echo "Removing old packages from:"
+ rm -fvI $DELPKG
+ #copy in new package
+ echo
+ echo "Updating $CARCH/$REPO with $TOTALPKG"
+ cp -f $PKGDEST/$TOTALPKG .
+ repo-add $DOCROOT/$REPO.db.tar.gz $DOCROOT/$TOTALPKG
+ cd -
+
+}
+
+
+
+
+
+
+find_repo
+
+makepkg --holdver --asroot $@ || exit 1
+echo "---------updating database ----------"
+update-repo #&& pacman -Sy
+