diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-02-11 14:07:08 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-02-11 14:07:08 +0000 |
commit | bcb440d4fea5f5b3be83a6878cec7a700415d4aa (patch) | |
tree | 97812d4fe545aa440692a03a1e50f04830bcd077 /abuild | |
parent | 78e0ab1faa965cbea9133fcbad7de5af43c2c6a9 (diff) | |
download | abuild-bcb440d4fea5f5b3be83a6878cec7a700415d4aa.tar.gz abuild-bcb440d4fea5f5b3be83a6878cec7a700415d4aa.tar.bz2 abuild-bcb440d4fea5f5b3be83a6878cec7a700415d4aa.tar.xz abuild-bcb440d4fea5f5b3be83a6878cec7a700415d4aa.zip |
abuild: auto add bb to deps when install. added -P option.
-P lets user specify the REPODEST on cmd line
Diffstat (limited to 'abuild')
-rwxr-xr-x | abuild | 30 |
1 files changed, 19 insertions, 11 deletions
@@ -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/<repo>, 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)" |