Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2010-10-04 18:42:10 +1000
committerDan McGee <dan@archlinux.org>2010-10-05 11:03:06 -0500
commit960c2cdcf7583251592b02c41161cea65eba28fd (patch)
treed787d5c7d77a6947e6d3459cd953f1ab0f7877ef /scripts/makepkg.sh.in
parentf2296aab89b12fe49204fba8f62dc8dd2d9e05eb (diff)
makepkg: compare paths using bash test
Compare paths using bash's "-ef" rather than by string tests as this takes symlinks into account. This will prevent issues similar to those in FS#20922 if (e.g.) $PKGDEST is a symlink to $startdir. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r--scripts/makepkg.sh.in6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 9bcd4460..2f1c747b 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1061,7 +1061,7 @@ create_package() {
exit 1 # TODO: error code
fi
- if (( ! ret )) && [[ "$PKGDEST" != "${startdir}" ]]; then
+ if (( ! ret )) && [[ ! "$PKGDEST" -ef "${startdir}" ]]; then
ln -sf "${pkg_file}" "${pkg_file/$PKGDEST/$startdir}"
ret=$?
fi
@@ -1142,7 +1142,7 @@ create_srcpackage() {
exit 1 # TODO: error code
fi
- if (( ! ret )) && [[ "$SRCPKGDEST" != "${startdir}" ]]; then
+ if (( ! ret )) && [[ ! "$SRCPKGDEST" -ef "${startdir}" ]]; then
ln -sf "${pkg_file}" "${pkg_file/$SRCPKGDEST/$startdir}"
ret=$?
fi
@@ -1691,7 +1691,7 @@ fi
if (( CLEANCACHE )); then
#fix flyspray feature request #5223
- if [[ -n $SRCDEST && $SRCDEST != $startdir ]]; then
+ if [[ -n $SRCDEST && ! $SRCDEST -ef "${startdir}" ]]; then
msg "$(gettext "Cleaning up ALL files from %s.")" "$SRCDEST"
echo -n "$(gettext " Are you sure you wish to do this? ")"
echo -n "$(gettext "[y/N]")"