summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2003-04-11 18:58:50 +0200
committerJudd Vinet <judd@archlinux.org>2003-04-11 18:58:50 +0200
commit37e13ea2d0c0df564f00278ac68bf8a1e584bfd9 (patch)
treed2e796dc32d5dc9da14af0b67d82e629f507f2fb /scripts
parent185ce5454e4afd11b1f90d7fe487b0ec3cb840c7 (diff)
downloadpacman-37e13ea2d0c0df564f00278ac68bf8a1e584bfd9.tar.gz
pacman-37e13ea2d0c0df564f00278ac68bf8a1e584bfd9.tar.xz
Imported from pacman-2.4.tar.gz
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gensync2
-rwxr-xr-xscripts/makepkg81
-rwxr-xr-xscripts/makeworld47
3 files changed, 77 insertions, 53 deletions
diff --git a/scripts/gensync b/scripts/gensync
index e73ba3c1..1ad33c0a 100755
--- a/scripts/gensync
+++ b/scripts/gensync
@@ -1,6 +1,6 @@
#!/bin/bash
-myver='2.3.2'
+myver='2.4'
usage() {
echo "gensync $myver"
diff --git a/scripts/makepkg b/scripts/makepkg
index 890ec22f..f6ca8658 100755
--- a/scripts/makepkg
+++ b/scripts/makepkg
@@ -1,6 +1,6 @@
#!/bin/bash
-myver='2.3.2'
+myver='2.4'
startdir=`pwd`
[ -f /etc/makepkg.conf ] && source /etc/makepkg.conf
@@ -46,8 +46,7 @@ checkdeps() {
}
-if [ "$1" = "--help" -o "$1" = "-h" ]; then
- shift
+usage() {
echo "makepkg version $myver"
echo "usage: $0 [options] [build_script]"
echo "options:"
@@ -58,13 +57,14 @@ if [ "$1" = "--help" -o "$1" = "-h" ]; then
echo " -d, --nodeps Skip all dependency checks"
echo " -i, --install Install package after successful build"
echo " -f, --force Overwrite existing package"
+ echo " -w <destdir> Write package to <destdir> instead of the working dir"
echo " -h, --help This help"
echo
echo " if build_script is not specified, makepkg will look for a PKGBUILD"
echo " file in the current directory."
echo
exit 0
-fi
+}
# Options
CLEANUP=0
@@ -74,35 +74,54 @@ DEP_BIN=0
DEP_SRC=0
NODEPS=0
FORCE=0
+PKGDEST=$startdir
BUILDSCRIPT="./PKGBUILD"
-for arg in $*; do
- case $arg in
- -c|--clean)
- CLEANUP=1
- ;;
- -C|--cleancache)
- CLEANCACHE=1
- ;;
- -s|--syncdeps)
- DEP_BIN=1
- ;;
- -b|--builddeps)
- DEP_SRC=1
+while [ "$#" -ne "0" ]; do
+ case $1 in
+ --clean) CLEANUP=1 ;;
+ --cleancache) CLEANCACHE=1 ;;
+ --syncdeps) DEP_BIN=1 ;;
+ --builddeps) DEP_SRC=1 ;;
+ --nodeps) NODEPS=1 ;;
+ --install) INSTALL=1 ;;
+ --force) FORCE=1 ;;
+ --*)
+ usage
+ exit 1
;;
- -d|--nodeps)
- NODEPS=1
- ;;
- -i|--install)
- INSTALL=1
- ;;
- -f|--force)
- FORCE=1
+ -*)
+ while getopts "cCsbdifw:-" opt; do
+ case $opt in
+ c) CLEANUP=1 ;;
+ C) CLEANCACHE=1 ;;
+ s) DEP_BIN=1 ;;
+ b) DEP_SRC=1 ;;
+ d) NODEPS=1 ;;
+ i) INSTALL=1 ;;
+ f) FORCE=1 ;;
+ w)
+ PKGDEST=$OPTARG
+ shift
+ ;;
+ -)
+ OPTIND=0
+ break
+ ;;
+ *)
+ usage
+ ;;
+ esac
+ done
;;
*)
- BUILDSCRIPT=$arg
+ if [ "$#" -ne "1" ]; then
+ usage
+ fi
+ BUILDSCRIPT=$1
;;
esac
+ shift
done
if [ "$CLEANCACHE" = "1" ]; then
@@ -132,7 +151,7 @@ if [ `echo $pkgrel | grep '-'` ]; then
exit 1
fi
-if [ -f ${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz -a "$FORCE" = "0" ]; then
+if [ -f $PKGDEST/${pkgname}-${pkgver}-${pkgrel}.pkg.tar.gz -a "$FORCE" = "0" ]; then
msg "==> ERROR: a package has already been built. (use -f to overwrite)"
exit 1
fi
@@ -170,7 +189,7 @@ if [ `type -p pacman` -a "$NODEPS" = "0" ]; then
for pkgdir in $candidates; do
if [ -f $pkgdir/PKGBUILD ]; then
cd $pkgdir
- makepkg -i -c -b
+ makepkg -i -c -b -w $PKGDEST
if [ $? -eq 0 ]; then
success=1
break
@@ -356,9 +375,9 @@ fi
msg "==> Compressing package..."
cd $startdir/pkg
if [ -f $startdir/pkg/._install ]; then
- tar czvf $startdir/$pkgname-$pkgver-$pkgrel.pkg.tar.gz .PKGINFO ._install * >../filelist
+ tar czvf $PKGDEST/$pkgname-$pkgver-$pkgrel.pkg.tar.gz .PKGINFO ._install * >../filelist
else
- tar czvf $startdir/$pkgname-$pkgver-$pkgrel.pkg.tar.gz .PKGINFO * >../filelist
+ tar czvf $PKGDEST/$pkgname-$pkgver-$pkgrel.pkg.tar.gz .PKGINFO * >../filelist
fi
cd $startdir
@@ -372,7 +391,7 @@ msg "==> Finished making $pkgname ($d)"
if [ "$INSTALL" = "1" ]; then
msg "==> Running pacman --upgrade"
- pacman --upgrade $pkgname-$pkgver-$pkgrel.pkg.tar.gz
+ pacman --upgrade $PKGDEST/$pkgname-$pkgver-$pkgrel.pkg.tar.gz
fi
exit 0
diff --git a/scripts/makeworld b/scripts/makeworld
index 9b5e46cd..ce634071 100755
--- a/scripts/makeworld
+++ b/scripts/makeworld
@@ -1,7 +1,7 @@
#!/bin/bash
toplevel=`pwd`
-version="2.3.2"
+version="2.4"
usage() {
echo "makeworld version $version"
@@ -29,23 +29,31 @@ fi
MAKEPKG_OPTS=
for arg in $*; do
case $arg in
- -c|--clean)
- MAKEPKG_OPTS="$MAKEPKG_OPTS -c"
+ --clean) MAKEPKG_OPTS="$MAKEPKG_OPTS -c" ;;
+ --install) MAKEPKG_OPTS="$MAKEPKG_OPTS -i" ;;
+ --syncdeps) MAKEPKG_OPTS="$MAKEPKG_OPTS -s" ;;
+ --builddeps) MAKEPKG_OPTS="$MAKEPKG_OPTS -b" ;;
+ --nodeps) MAKEPKG_OPTS="$MAKEPKG_OPTS -d" ;;
+ --force) MAKEPKG_OPTS="$MAKEPKG_OPTS -f" ;;
+ --*)
+ usage
+ exit 1
;;
- -i|--install)
- MAKEPKG_OPTS="$MAKEPKG_OPTS -i"
- ;;
- -s|--syncdeps)
- MAKEPKG_OPTS="$MAKEPKG_OPTS -d"
- ;;
- -b|--builddeps)
- MAKEPKG_OPTS="$MAKEPKG_OPTS -b"
- ;;
- -d|--nodeps)
- MAKEPKG_OPTS="$MAKEPKG_OPTS -n"
- ;;
- -f|--force)
- MAKEPKG_OPTS="$MAKEPKG_OPTS -f"
+ -*)
+ while getopts "cisbdf-" opt; do
+ case $opt in
+ c) MAKEPKGS_OPTS="$MAKEPKGS_OPTS -c" ;;
+ i) MAKEPKGS_OPTS="$MAKEPKGS_OPTS -i" ;;
+ s) MAKEPKGS_OPTS="$MAKEPKGS_OPTS -s" ;;
+ b) MAKEPKGS_OPTS="$MAKEPKGS_OPTS -b" ;;
+ d) MAKEPKGS_OPTS="$MAKEPKGS_OPTS -d" ;;
+ f) MAKEPKGS_OPTS="$MAKEPKGS_OPTS -f" ;;
+ -)
+ OPTIND=0
+ break
+ ;;
+ esac
+ done
;;
*)
dest=$arg
@@ -73,13 +81,10 @@ for category in $*; do
. PKGBUILD
buildstatus=0
if [ ! -f $dest/$pkgname-$pkgver-$pkgrel.pkg.tar.gz ]; then
- makepkg $MAKEPKG_OPTS 2>>$toplevel/makepkg.log
+ makepkg $MAKEPKG_OPTS -w $dest 2>>$toplevel/makepkg.log
if [ $? -gt 0 ]; then
buildstatus=2
else
- rm -rf pkg src
- # some packages (mozilla) have been split into multiple packages
- mv -v $pkgname-*.pkg.tar.gz $dest/
buildstatus=1
fi
fi