summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xabuild.in16
1 files changed, 11 insertions, 5 deletions
diff --git a/abuild.in b/abuild.in
index b70966d..db65835 100755
--- a/abuild.in
+++ b/abuild.in
@@ -104,6 +104,10 @@ set_xterm_title() {
fi
}
+cross_compiling() {
+ test "$CBUILD" != "$CHOST" -a -n "$CBUILDROOT"
+}
+
cleanup() {
local i=
set_xterm_title ""
@@ -118,7 +122,7 @@ cleanup() {
if [ -z "$install_after" ] && [ -n "$uninstall_after" ]; then
msg "Uninstalling dependencies..."
$SUDO_APK del --quiet $apk_opt_wait $uninstall_after
- if [ "$CBUILD" != "$CHOST" -a -n "$CBUILDROOT" ]; then
+ if cross_compiling; then
$SUDO_APK del --root "$CBUILDROOT" \
--quiet $apk_opt_wait \
$uninstall_after
@@ -996,7 +1000,7 @@ trace_apk_deps() {
# first check if its provided by same apkbuild
grep -q -w "^$i" "$dir"/.provides-so 2>/dev/null && continue
- if subpkg_provides "$i" || [ "$CBUILD" != "$CHOST" ] \
+ if subpkg_provides "$i" || cross_compiling \
|| $APK info --quiet --installed "so:$i"; then
autodeps="$autodeps so:$i"
else
@@ -1531,7 +1535,7 @@ builddeps() {
msg "Analyzing dependencies..."
# add depends unless it is a subpackage or package itself
- if [ "$CBUILD" != "$CHOST" -a -n "$CBUILDROOT" ] && [ -n "$makedepends_build" -o -n "$makedepends_host" ]; then
+ if cross_compiling && [ -n "$makedepends_build" -o -n "$makedepends_host" ]; then
for i in $BUILD_BASE $makedepends_build; do
[ "$pkgname" = "${i%%[<>=]*}" ] && continue
subpackages_has ${i%%[<>=]*} || builddeps="$builddeps $i"
@@ -1774,8 +1778,10 @@ deps() {
undeps (){
$SUDO_APK del $apk_opt_wait .makedepends-$pkgname
- [ "$CBUILD" != "$CHOST" -a -n "$CBUILDROOT" ] &&
- $SUDO_APK del --root "$CBUILDROOT" $apk_opt_wait .makedepends-$pkgname
+ if cross_compiling; then
+ $SUDO_APK del --root "$CBUILDROOT" $apk_opt_wait \
+ .makedepends-$pkgname
+ fi
}
# compat