1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-10 11:35:00 -05:00

makepkg: replace bare eval with var extraction functions

This commit is contained in:
Dave Reisner 2014-08-02 20:28:05 -04:00 committed by Allan McRae
parent 2b556d89de
commit 17ed9eb734

View File

@ -866,7 +866,7 @@ get_pkg_arch() {
fi
else
local arch_override
eval $(declare -f package_$1 | sed -n 's/\(^[[:space:]]*arch=\)/arch_override=/p')
pkgbuild_get_attribute "$1" arch arch_override 0
(( ${#arch_override[@]} == 0 )) && arch_override=("${arch[@]}")
if [[ $arch_override = "any" ]]; then
printf "%s\n" "any"
@ -2121,15 +2121,21 @@ create_srcpackage() {
local i
for i in 'changelog' 'install'; do
local file
while read -r file; do
# evaluate any bash variables used
eval file=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$file")\"
local file files
[[ $install ]] && files+=("$install")
for name in "${pkgname[@]}"; do
if extract_function_var "package_$name" "$i" 0 file; then
files+=("$file")
fi
done
for file in "${files[@]}"; do
if [[ $file && ! -f "${srclinks}/${pkgbase}/$file" ]]; then
msg2 "$(gettext "Adding %s file (%s)...")" "$i" "${file}"
ln -s "${startdir}/$file" "${srclinks}/${pkgbase}/"
fi
done < <(sed -n "s/^[[:space:]]*$i=//p" "$BUILDFILE")
done
done
local TAR_OPT