From bcb440d4fea5f5b3be83a6878cec7a700415d4aa Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 11 Feb 2009 14:07:08 +0000 Subject: abuild: auto add bb to deps when install. added -P option. -P lets user specify the REPODEST on cmd line --- abuild | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/abuild b/abuild index 6f3f3f9..b0b5a99 100755 --- a/abuild +++ b/abuild @@ -30,11 +30,6 @@ default_cmds="sanitycheck builddeps clean fetch unpack rootpkg" ABUILD_CONF=${ABUILD_CONF:-"/etc/abuild.conf"} [ -f "$ABUILD_CONF" ] && . "$ABUILD_CONF" -# If REPODEST is set then it will override the PKGDEST -if [ -n "$REPODEST" ]; then - PKGDEST="$REPODEST/$repo" -fi - # source functions datadir=/usr/share/abuild @@ -284,15 +279,20 @@ builddate = $builddate packager = ${PACKAGER:-"Unknown"} size = $size EOF - local i - + local i deps + deps="$depends" + if [ -n "$install" ] && head -n 1 "$srcdir/$install" | grep '^#' >/dev/null && ! depends_has busybox ; then + msg "Adding busybox to depends since we have an install script" + deps="$deps busybox" + fi + for i in $license; do echo "license = $i" >>.PKGINFO done for i in $replaces; do echo "replaces = $i" >>.PKGINFO done - for i in $depends; do + for i in $deps; do echo "depend = $i" >>.PKGINFO done for i in $conflicts; do @@ -527,7 +527,7 @@ builddeps() { local pkg=${i%:*} msg "Entering $dir" cd "$dir" || return 1 - $0 -i $pkg || return 1 + $0 -k -i $pkg || return 1 uninstall_after="$pkg $uninstall_after" done } @@ -654,7 +654,8 @@ newaport() { usage() { echo "$(basename $0) $abuild_ver" - echo "usage: ${0##*/} [options] [-i PKG] [-p PKGDEST] [-s SRCDEST] [cmd] ..." + echo "usage: ${0##*/} [options] [-i PKG] [-P REPODEST] [-p PKGDEST]" + echo " [-s SRCDEST] [cmd] ..." echo " ${0##*/} [-c] -n PKGNAME[-PKGVER]" echo "Options:" echo " -f Force specified cmd, even if they are already done" @@ -662,6 +663,7 @@ usage() { echo " -i Install PKG after successul build" echo " -k Keep built packages, even if APKBUILD or sources are newer" echo " -p Set package destination directory" + echo " -P Set PKGDEST to REPODEST/, where repo is the parents dir name" echo " -q Quiet" echo " -r Install missing dependencies from system repository (using sudo)" echo " -R Recursively build and install missing dependencies (using sudo)" @@ -694,7 +696,7 @@ usage() { APKBUILD="${APKBUILD:-./APKBUILD}" unset force unset recursive -while getopts "cfhi:kin:p:qrRs:u" opt; do +while getopts "cfhi:kin:p:P:qrRs:u" opt; do case $opt in 'c') cpinitd=1;; 'f') force=1;; @@ -703,6 +705,7 @@ while getopts "cfhi:kin:p:qrRs:u" opt; do 'k') keep=1;; 'n') newname=$OPTARG;; 'p') PKGDEST=$OPTARG;; + 'P') REPODEST=$OPTARG;; 'q') quiet=1;; 'r') install_deps=1;; 'R') recursive=1;; @@ -713,6 +716,11 @@ while getopts "cfhi:kin:p:qrRs:u" opt; do done shift $(( $OPTIND - 1 )) +# If REPODEST is set then it will override the PKGDEST +if [ -n "$REPODEST" ]; then + PKGDEST="$REPODEST/$repo" +fi + # source the buildfile if [ -z "$newname" ]; then [ -f "$APKBUILD" ] || die "Could not find $APKBUILD (PWD=$PWD)" -- cgit v1.2.3-60-g2f50