Merge branch 'variables' into 'master'

abuild: clean unused and global variables

See merge request alpine/abuild!277
This commit is contained in:
Sertonix 2024-04-28 11:21:49 +00:00
commit 440ed6f7e9
1 changed files with 10 additions and 13 deletions

View File

@ -339,7 +339,7 @@ sanitycheck() {
sumcheck() { sumcheck() {
local algo="$1" sums="$2" local algo="$1" sums="$2"
local dummy f endreturnval originalparams origin file local f endreturnval origin file
# get number of checksums # get number of checksums
set -- $sums set -- $sums
@ -352,7 +352,7 @@ sumcheck() {
fetch || return 1 fetch || return 1
msg "Checking ${algo}sums..." msg "Checking ${algo}sums..."
cd "$srcdir" || return 1 cd "$srcdir" || return 1
IFS=$'\n' local IFS=$'\n'
endreturnval=0 endreturnval=0
for src in $sums; do for src in $sums; do
origin=$1; shift origin=$1; shift
@ -369,7 +369,6 @@ sumcheck() {
mv "$file" "$file.$csum" mv "$file" "$file.$csum"
fi fi
done done
unset IFS
return $endreturnval return $endreturnval
} }
@ -1122,7 +1121,6 @@ prepare_metafiles() {
local dir=${subpkgdir:-$pkgdir} local dir=${subpkgdir:-$pkgdir}
local pkg="$name-$pkgver-r$pkgrel.apk" local pkg="$name-$pkgver-r$pkgrel.apk"
local pkginfo="$controldir"/.PKGINFO local pkginfo="$controldir"/.PKGINFO
local sub
[ ! -d "$dir" ] && die "Missing $dir" [ ! -d "$dir" ] && die "Missing $dir"
cd "$dir" cd "$dir"
@ -1597,15 +1595,14 @@ find_scanelf_paths() {
paths="$paths:$(echo "${datadir}${ldpath}" | sed "s|:|:$datadir|g")" paths="$paths:$(echo "${datadir}${ldpath}" | sed "s|:|:$datadir|g")"
fi fi
# search in all rpaths # search in all rpaths
local IFS=:
for rpaths in "$pkgbasedir"/.control.*/.rpaths; do for rpaths in "$pkgbasedir"/.control.*/.rpaths; do
[ -f "$rpaths" ] || continue [ -f "$rpaths" ] || continue
while read i; do while read i; do
local dir="${datadir}${i}" local dir="${datadir}${i}"
IFS=:
if [ -d "$dir" ] && ! list_has "$dir" $paths; then if [ -d "$dir" ] && ! list_has "$dir" $paths; then
paths="$paths:${dir}" paths="$paths:${dir}"
fi fi
unset IFS
done < "$rpaths" done < "$rpaths"
done done
echo "$paths" echo "$paths"
@ -1620,7 +1617,7 @@ scan_shared_objects() {
fi fi
# allow spaces in paths # allow spaces in paths
IFS=: local IFS=:
set -- $(find_scanelf_paths "$datadir") set -- $(find_scanelf_paths "$datadir")
unset IFS unset IFS
@ -1637,6 +1634,7 @@ scan_shared_objects() {
fi fi
msg "Scanning shared objects" msg "Scanning shared objects"
# lets tell all the .so files this package provides in .provides-so # lets tell all the .so files this package provides in .provides-so
local etype soname file
scanelf --nobanner --soname $opt "$@" | while read etype soname file; do scanelf --nobanner --soname $opt "$@" | while read etype soname file; do
# if soname field is missing, soname will be the filepath # if soname field is missing, soname will be the filepath
sover=0 sover=0
@ -1696,8 +1694,8 @@ normalize_target_path() {
local path=$1 local path=$1
[ "${path:0:1}" = / ] || path=$(dirname "$2")/$path [ "${path:0:1}" = / ] || path=$(dirname "$2")/$path
local oifs="$IFS" pathstr= i= local pathstr= i=
IFS='/' local IFS='/'
set -- $path set -- $path
for i; do for i; do
case "$i" in case "$i" in
@ -1923,10 +1921,8 @@ update_abuildrepo_index() {
local oldpwd="$PWD" local oldpwd="$PWD"
for i in $allarch; do for i in $allarch; do
cd "$REPODEST/$repo/$i" cd "$REPODEST/$repo/$i"
local index=$i/APKINDEX.tar.gz
msg "Updating the $repo/$i repository index..." msg "Updating the $repo/$i repository index..."
local sign=".SIGN.RSA.${SIGN_PUBLIC_KEY##*/}"
local oldindex= local oldindex=
if [ -f APKINDEX.tar.gz ]; then if [ -f APKINDEX.tar.gz ]; then
oldindex="--index APKINDEX.tar.gz" oldindex="--index APKINDEX.tar.gz"
@ -2640,7 +2636,6 @@ rootbld() {
} }
stripbin() { stripbin() {
local bin
if options_has "!strip" || [ "${subpkgarch:-$pkgarch}" = "noarch" ]; then if options_has "!strip" || [ "${subpkgarch:-$pkgarch}" = "noarch" ]; then
return 0 return 0
fi fi
@ -2978,8 +2973,10 @@ if [ -n "$DEBUG" ] || subpackage_types_has "dbg"; then
fi fi
if [ -n "$subpkgname" ]; then if [ -n "$subpkgname" ]; then
# If we are handling a sub package then reset subpackages and install # TODO remove once last usage is removed
# https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/64406
origsubpackages="$subpackages" origsubpackages="$subpackages"
# If we are handling a sub package then reset subpackages and install
subpackages= subpackages=
else else
allpackages="$pkgname $subpackages" allpackages="$pkgname $subpackages"