makepkg: prevent issues with files starting with a hyphen
Most places in makepkg deal with full file paths, but a few use the file name only. Protect from potential issues when a file name starts with a hyphen. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
03465ad6b6
commit
44de3183ff
1 changed files with 3 additions and 3 deletions
|
@ -845,7 +845,7 @@ extract_sources() {
|
||||||
if [[ $cmd = bsdtar ]]; then
|
if [[ $cmd = bsdtar ]]; then
|
||||||
$cmd -xf "$file" || ret=$?
|
$cmd -xf "$file" || ret=$?
|
||||||
else
|
else
|
||||||
rm -f "${file%.*}"
|
rm -f -- "${file%.*}"
|
||||||
$cmd -dcf "$file" > "${file%.*}" || ret=$?
|
$cmd -dcf "$file" > "${file%.*}" || ret=$?
|
||||||
fi
|
fi
|
||||||
if (( ret )); then
|
if (( ret )); then
|
||||||
|
@ -974,7 +974,7 @@ tidy_install() {
|
||||||
|
|
||||||
if [[ $(check_option docs) = "n" && -n ${DOC_DIRS[*]} ]]; then
|
if [[ $(check_option docs) = "n" && -n ${DOC_DIRS[*]} ]]; then
|
||||||
msg2 "$(gettext "Removing doc files...")"
|
msg2 "$(gettext "Removing doc files...")"
|
||||||
rm -rf ${DOC_DIRS[@]}
|
rm -rf -- ${DOC_DIRS[@]}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $(check_option purge) = "y" && -n ${PURGE_TARGETS[*]} ]]; then
|
if [[ $(check_option purge) = "y" && -n ${PURGE_TARGETS[*]} ]]; then
|
||||||
|
@ -1001,7 +1001,7 @@ tidy_install() {
|
||||||
find ${MAN_DIRS[@]} -lname "$file" 2>/dev/null |
|
find ${MAN_DIRS[@]} -lname "$file" 2>/dev/null |
|
||||||
while read link ; do
|
while read link ; do
|
||||||
rm -f "$link" "${link}.gz"
|
rm -f "$link" "${link}.gz"
|
||||||
ln -s "${file}.gz" "${link}.gz"
|
ln -s -- "${file}.gz" "${link}.gz"
|
||||||
done
|
done
|
||||||
|
|
||||||
# check file still exists (potentially already compressed due to hardlink)
|
# check file still exists (potentially already compressed due to hardlink)
|
||||||
|
|
Loading…
Add table
Reference in a new issue