makepkg: read filenames in a while loop
Further improvments on 2ca27ab
which will allow the changelog and
install script files to contain whitespace.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
35d8cc8bc8
commit
5bb2d2e0a0
1 changed files with 4 additions and 6 deletions
|
@ -1354,16 +1354,15 @@ create_srcpackage() {
|
||||||
|
|
||||||
local i
|
local i
|
||||||
for i in 'changelog' 'install'; do
|
for i in 'changelog' 'install'; do
|
||||||
local filelist=$(sed -n "s/^[[:space:]]*$i=//p" "$BUILDFILE")
|
|
||||||
local file
|
local file
|
||||||
for file in $filelist; do
|
while read -r file; do
|
||||||
# evaluate any bash variables used
|
# evaluate any bash variables used
|
||||||
eval file=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$file")\"
|
eval file=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$file")\"
|
||||||
if [[ ! -f "${srclinks}/${pkgbase}/$file" ]]; then
|
if [[ ! -f "${srclinks}/${pkgbase}/$file" ]]; then
|
||||||
msg2 "$(gettext "Adding %s file (%s)...")" "$i" "${file}"
|
msg2 "$(gettext "Adding %s file (%s)...")" "$i" "${file}"
|
||||||
ln -s "${startdir}/$file" "${srclinks}/${pkgbase}/"
|
ln -s "${startdir}/$file" "${srclinks}/${pkgbase}/"
|
||||||
fi
|
fi
|
||||||
done
|
done < <(sed -n "s/^[[:space:]]*$i=//p" "$BUILDFILE")
|
||||||
done
|
done
|
||||||
|
|
||||||
local TAR_OPT
|
local TAR_OPT
|
||||||
|
@ -1534,16 +1533,15 @@ check_sanity() {
|
||||||
done
|
done
|
||||||
|
|
||||||
for i in 'changelog' 'install'; do
|
for i in 'changelog' 'install'; do
|
||||||
local filelist=$(sed -n "s/^[[:space:]]*$i=//p" "$BUILDFILE")
|
|
||||||
local file
|
local file
|
||||||
for file in $filelist; do
|
while read -r file; do
|
||||||
# evaluate any bash variables used
|
# evaluate any bash variables used
|
||||||
eval file=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$file")\"
|
eval file=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$file")\"
|
||||||
if [[ ! -f $file ]]; then
|
if [[ ! -f $file ]]; then
|
||||||
error "$(gettext "%s file (%s) does not exist.")" "$i" "$file"
|
error "$(gettext "%s file (%s) does not exist.")" "$i" "$file"
|
||||||
ret=1
|
ret=1
|
||||||
fi
|
fi
|
||||||
done
|
done < <(sed -n "s/^[[:space:]]*$i=//p" "$BUILDFILE")
|
||||||
done
|
done
|
||||||
|
|
||||||
local valid_options=1
|
local valid_options=1
|
||||||
|
|
Loading…
Add table
Reference in a new issue