From 5e268f8d70d29621c3d93170c0ddf6b19f69317d Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 2 Jun 2015 07:52:35 +0000 Subject: abuild: cleanup. use better function names no change in code logic --- abuild.in | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'abuild.in') diff --git a/abuild.in b/abuild.in index 6910de7..0de5e49 100644 --- a/abuild.in +++ b/abuild.in @@ -868,7 +868,7 @@ EOF echo $metafiles | tr ' ' '\n' > "$controldir"/.metafiles } -prepare_tracedeps() { +prepare_trace_rpaths() { local dir=${subpkgdir:-$pkgdir} local etype= soname= file= sover= [ "$arch" = "noarch" ] && return 0 @@ -920,7 +920,7 @@ archcheck() { prepare_package() { msg "Preparing ${subpkgname:+sub}package ${subpkgname:-$pkgname}..." stripbin - prepare_metafiles && prepare_tracedeps || return 1 + prepare_metafiles && prepare_trace_rpaths || return 1 archcheck } @@ -953,7 +953,7 @@ find_so_files() { return 0 } -subpkg_provides() { +subpkg_provides_so() { grep -q -w "^$1" "$pkgbasedir"/.control.*/.provides-so 2>/dev/null } @@ -970,16 +970,18 @@ trace_apk_deps() { fi # special case for libpthread: we need depend on libgcc - if [ -f "$dir"/.needs-so ] && grep -q -w '^libpthread.so.*' "$dir"/.needs-so \ + if [ "$CLIBC" = "uclibc" ] && [ -f "$dir"/.needs-so ] \ + && grep -q -w '^libpthread.so.*' "$dir"/.needs-so \ && ! grep -q -w "^depend = libgcc" "$dir"/.PKGINFO; then autodeps="$autodeps libgcc" msg " added libgcc (due to libpthread)" fi + [ -f "$dir"/.needs-so ] && for i in $(cat "$dir"/.needs-so); do # first check if its provided by same apkbuild grep -q -w "^$i" "$dir"/.provides-so 2>/dev/null && continue - if subpkg_provides "$i" || cross_compiling \ + if subpkg_provides_so "$i" || cross_compiling \ || $APK info --quiet --installed "so:$i"; then autodeps="$autodeps so:$i" else @@ -1473,11 +1475,12 @@ abuildindex() { # 1) origin of package # 2) all dependencies # the output is i in a format easy parseable for awk -depparse_aports() { +parse_aports_makedepends() { # lets run this in a subshell since we source all APKBUILD here ( aportsdir=$(realpath ${APKBUILD%/APKBUILD}/..) for i in $aportsdir/*/APKBUILD; do + # no forks in this loop or it will be painfully slow! pkgname= subpackages= depends= @@ -1507,14 +1510,14 @@ depparse_aports() { ) } -deptrace() { +trace_makedepends() { local deps= i= # strip versions from deps for i in "$@"; do deps="$deps ${i%%[<>=]*}" done [ -z "$deps" ] && return 0 - ( depparse_aports + ( parse_aports_makedepends if [ -z "$upgrade" ]; then # list installed pkgs and prefix with 'i ' $APK info --quiet | sort | sed 's/^/i /' @@ -1627,7 +1630,7 @@ builddeps() { fi done - for i in $(deptrace $missing); do + for i in $(trace_makedepends $missing); do # i = pkg:dir local dir=${i#*:} local pkg=${i%:*} -- cgit v1.2.3-60-g2f50