added -u option for recursively build and upgrade dependencies
This commit is contained in:
parent
b89cd09513
commit
6e55c8cedf
21
abuild
21
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 ))
|
||||
|
|
Loading…
Reference in New Issue