summaryrefslogtreecommitdiff
path: root/abuild
diff options
context:
space:
mode:
authorLinux User <ncopa@buildozer.(none)>2008-11-09 12:54:53 +0000
committerLinux User <ncopa@buildozer.(none)>2008-11-09 12:54:53 +0000
commit6e55c8cedf781b89612180e42462032a1a0ef7c7 (patch)
treef676c1a555602998967d5095465bfa09608640d9 /abuild
parentb89cd09513d48ce26ae698ea1bfae65ce576ac59 (diff)
downloadabuild-6e55c8cedf781b89612180e42462032a1a0ef7c7.tar.gz
abuild-6e55c8cedf781b89612180e42462032a1a0ef7c7.tar.bz2
abuild-6e55c8cedf781b89612180e42462032a1a0ef7c7.tar.xz
abuild-6e55c8cedf781b89612180e42462032a1a0ef7c7.zip
added -u option for recursively build and upgrade dependencies
Diffstat (limited to 'abuild')
-rwxr-xr-xabuild21
1 files changed, 14 insertions, 7 deletions
diff --git a/abuild b/abuild
index 8cb0df0..cebf2dc 100755
--- a/abuild
+++ b/abuild
@@ -397,15 +397,19 @@ find_aport() {
builddeps() {
local dep pkg
for dep in $depends $makedepends; do
- apk_info -e $dep && continue
+ [ -z "$upgrade" ] && apk_info -e $dep && continue
[ -z "$recursive" ] && die "Missing dependency $dep. Use -r to build recursively"
- # sudo apk_add $dep && continue
- pkg=$(find_aport $dep) || die "failed to find dependency $dep"
+ pkg=$(find_aport $dep)
+ if [ -z "$pkg" ]; then
+ # try install from system repo as fallback
+ apk_add ${upgrade:+-u} $dep && continue
+ die "Failed to find dependency $dep"
+ fi
# recursively build deps
msg "Entering ${pkg%/*}"
cd ${pkg%/*}
- $0 -r || return 1
- sudo apk_add $pkg
+ $0 -r ${upgrade:+-u} || return 1
+ sudo apk_add ${upgrade:+-u} $pkg
done
}
@@ -415,8 +419,9 @@ usage() {
echo "Options:"
echo " -h Show this help"
echo " -f Force specified cmd, even if they are already done"
- echo " -r Recursively build and install dependencies (using sudo)"
echo " -q Quiet"
+ echo " -r Recursively build and install missing dependencies (using sudo)"
+ echo " -u Recursively build and upgrade dependencies (using sudo)"
echo ""
echo "Commands:"
echo " checksum Generate checksum to be included in $APKBUILD"
@@ -448,12 +453,14 @@ checksum() {
APKBUILD="${APKBUILD:-./APKBUILD}"
-while getopts "hfqr" opt; do
+while getopts "hfqru" opt; do
case $opt in
'h') usage;;
'f') force=1;;
'q') quiet=1;;
'r') recursive=1;;
+ 'u') upgrade=1
+ recursive=1;;
esac
done
shift $(( $OPTIND - 1 ))