Skip to content
Snippets Groups Projects
Commit 92417870 authored by Natanael Copa's avatar Natanael Copa
Browse files

abuild: properly pass over args when building recursively

parent 9d0a8124
No related merge requests found
...@@ -804,7 +804,7 @@ deptrace() { ...@@ -804,7 +804,7 @@ deptrace() {
# build and install dependencies # build and install dependencies
builddeps() { builddeps() {
local deps= alldeps= pkg= i= dir= ver= missing= installed_deps= local deps= alldeps= pkg= i= dir= ver= missing= installed_deps=
local filtered_deps= local filtered_deps= conflicts=
[ -n "$nodeps" ] && return 0 [ -n "$nodeps" ] && return 0
msg "Analyzing dependencies..." msg "Analyzing dependencies..."
...@@ -819,17 +819,22 @@ builddeps() { ...@@ -819,17 +819,22 @@ builddeps() {
for i in $deps; do for i in $deps; do
if [ "${i#\!}" != "$i" ]; then if [ "${i#\!}" != "$i" ]; then
list_has ${i#\!} $installed_deps \ list_has ${i#\!} $installed_deps \
&& die "Conflicting package ${i#\!} is installed." && conflicts="$conflicts ${i#\!}"
elif ! deplist_has $i $installed_deps; then elif ! deplist_has $i $installed_deps; then
if [ -z "$install_deps" ] && [ -z "$recursive" ]; then
die "Missing dependency $i. Use -r to autoinstall or -R to build"
fi
missing="$missing $i" missing="$missing $i"
fi fi
done done
[ -z "$missing" ] && [ -z "$install_deps" ] && [ -z "$recursive" ] \ if [ -n "$conflicts" ]; then
&& return 0 die "Conflicting package(s) installed:$conflics"
fi
if [ -z "$install_deps" ] && [ -z "$recursive" ]; then
# if we dont have any missing deps we are done now
[ -z "$missing" ] && return 0
error "Missing dependencies: $missing Use -r to autoinstall or -R to build"
return 1
fi
uninstall_after=".makedepends-$pkgname $uninstall_after" uninstall_after=".makedepends-$pkgname $uninstall_after"
if [ -n "$install_deps" ] && [ -z "$recursive" ]; then if [ -n "$install_deps" ] && [ -z "$recursive" ]; then
...@@ -860,7 +865,8 @@ builddeps() { ...@@ -860,7 +865,8 @@ builddeps() {
local pkg=${i%:*} local pkg=${i%:*}
if [ -d "$dir" ]; then if [ -d "$dir" ]; then
msg "Entering $dir" msg "Entering $dir"
cd "$dir" && $0 -k -r abuildindex || return 1 cd "$dir" && $0 $forceroot $keep $quiet $install_deps \
$recursive $upgrade abuildindex || return 1
fi fi
done done
$SUDO $APK add -u --repository "$abuildrepo" \ $SUDO $APK add -u --repository "$abuildrepo" \
...@@ -1046,20 +1052,20 @@ unset recursive ...@@ -1046,20 +1052,20 @@ unset recursive
while getopts "dfFhi:kinp:P:qrRs:u" opt; do while getopts "dfFhi:kinp:P:qrRs:u" opt; do
case $opt in case $opt in
'd') nodeps=1;; 'd') nodeps=1;;
'f') force=1;; 'f') force="-f";;
'F') forceroot=1;; 'F') forceroot="-F";;
'h') usage;; 'h') usage;;
'i') install_after="$install_after $OPTARG";; 'i') install_after="$install_after $OPTARG";;
'k') keep=1;; 'k') keep="-k";;
'n') die "Use newapkbuild to create new aports";; 'n') die "Use newapkbuild to create new aports";;
'p') PKGDEST=$OPTARG;; 'p') PKGDEST=$OPTARG;;
'P') REPODEST=$OPTARG;; 'P') REPODEST=$OPTARG;;
'q') quiet=1;; 'q') quiet="-q";;
'r') install_deps=1;; 'r') install_deps="-r";;
'R') recursive=1;; 'R') recursive="-R";;
's') SRCDEST=$OPTARG;; 's') SRCDEST=$OPTARG;;
'u') upgrade=1 'u') upgrade="-u"
recursive=1;; recursive="-R";;
esac esac
done done
shift $(( $OPTIND - 1 )) shift $(( $OPTIND - 1 ))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment