SHA256
1
0
forked from pool/quilt
quilt/hackweek-11-16-setup-fix-create_symlink-corner-case.patch
Jean Delvare 8a2058fdaf - dont-substitute-release.patch: Update upstream reference.
- hackweek-11-15-setup-missing-escape-in-normalize_path.patch:
  setup: Fix removal of "." components in normalize_path.
- hackweek-11-16-setup-fix-create_symlink-corner-case.patch: setup:
  Fix a corner case in create_symlink (boo#916007).

OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/quilt?expand=0&rev=97
2015-02-04 07:55:16 +00:00

26 lines
720 B
Diff

From: Jean Delvare <jdelvare@suse.de>
Subject: setup: Fix a corner case in create_symlink
Upstream: Submitted (2015-02-03)
References: boo#916007
When a link's target is the directory it lives in, create_symlink
would erroneously link to "..". Fix the code to properly link to "."
instead.
Credits to Robert Milasan for spotting the bug.
---
quilt/setup.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/quilt/setup.in
+++ b/quilt/setup.in
@@ -97,7 +97,7 @@ create_symlink()
do
set -- "${1#*/}" "${2#*/}"
done
- up=$(echo "${2%/*}" | sed -re 's:[^/]+:..:g')
+ up=$(echo "$2" | sed -r -e 's:(^|/)[^/]*$::' -e 's:[^/]+:..:g')
set -- "${up:+$up/}$1"
set -- "${1%/}"
ln -s "${1:-.}" "$link"