diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2015-06-02 07:52:35 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-06-03 06:27:15 +0000 |
commit | 5e268f8d70d29621c3d93170c0ddf6b19f69317d (patch) | |
tree | 1170f85894206ce13a21eaf587e9b7cd87fe2e8c /abuild.in | |
parent | 582b47781794e8057c0b01c40719c31fa8aa5c1b (diff) | |
download | abuild-5e268f8d70d29621c3d93170c0ddf6b19f69317d.tar.gz abuild-5e268f8d70d29621c3d93170c0ddf6b19f69317d.tar.bz2 abuild-5e268f8d70d29621c3d93170c0ddf6b19f69317d.tar.xz abuild-5e268f8d70d29621c3d93170c0ddf6b19f69317d.zip |
abuild: cleanup. use better function names
no change in code logic
Diffstat (limited to 'abuild.in')
-rw-r--r-- | abuild.in | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -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%:*} |