summaryrefslogtreecommitdiff
path: root/abuild.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-05-06 19:37:52 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-05-06 19:37:52 +0000
commit92417870e61f83d2ae4d4d4c7f0931461d3b9c58 (patch)
treebc1541c45a5ad4f369e6784559a92f8c5f9cbeb9 /abuild.in
parent9d0a812458ee8fd18b85cf4edcc52e942e40f06b (diff)
downloadabuild-92417870e61f83d2ae4d4d4c7f0931461d3b9c58.tar.gz
abuild-92417870e61f83d2ae4d4d4c7f0931461d3b9c58.tar.bz2
abuild-92417870e61f83d2ae4d4d4c7f0931461d3b9c58.tar.xz
abuild-92417870e61f83d2ae4d4d4c7f0931461d3b9c58.zip
abuild: properly pass over args when building recursively
Diffstat (limited to 'abuild.in')
-rwxr-xr-xabuild.in38
1 files changed, 22 insertions, 16 deletions
diff --git a/abuild.in b/abuild.in
index 6570abe..3fea58a 100755
--- a/abuild.in
+++ b/abuild.in
@@ -804,7 +804,7 @@ deptrace() {
# build and install dependencies
builddeps() {
local deps= alldeps= pkg= i= dir= ver= missing= installed_deps=
- local filtered_deps=
+ local filtered_deps= conflicts=
[ -n "$nodeps" ] && return 0
msg "Analyzing dependencies..."
@@ -819,17 +819,22 @@ builddeps() {
for i in $deps; do
if [ "${i#\!}" != "$i" ]; then
list_has ${i#\!} $installed_deps \
- && die "Conflicting package ${i#\!} is installed."
+ && conflicts="$conflicts ${i#\!}"
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"
fi
done
- [ -z "$missing" ] && [ -z "$install_deps" ] && [ -z "$recursive" ] \
- && return 0
+ if [ -n "$conflicts" ]; then
+ 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"
if [ -n "$install_deps" ] && [ -z "$recursive" ]; then
@@ -860,7 +865,8 @@ builddeps() {
local pkg=${i%:*}
if [ -d "$dir" ]; then
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
done
$SUDO $APK add -u --repository "$abuildrepo" \
@@ -1046,20 +1052,20 @@ unset recursive
while getopts "dfFhi:kinp:P:qrRs:u" opt; do
case $opt in
'd') nodeps=1;;
- 'f') force=1;;
- 'F') forceroot=1;;
+ 'f') force="-f";;
+ 'F') forceroot="-F";;
'h') usage;;
'i') install_after="$install_after $OPTARG";;
- 'k') keep=1;;
+ 'k') keep="-k";;
'n') die "Use newapkbuild to create new aports";;
'p') PKGDEST=$OPTARG;;
'P') REPODEST=$OPTARG;;
- 'q') quiet=1;;
- 'r') install_deps=1;;
- 'R') recursive=1;;
+ 'q') quiet="-q";;
+ 'r') install_deps="-r";;
+ 'R') recursive="-R";;
's') SRCDEST=$OPTARG;;
- 'u') upgrade=1
- recursive=1;;
+ 'u') upgrade="-u"
+ recursive="-R";;
esac
done
shift $(( $OPTIND - 1 ))