forked from pool/quilt
8a2058fdaf
- 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
28 lines
849 B
Diff
28 lines
849 B
Diff
From: Jean Delvare <jdelvare@suse.de>
|
|
Subject: setup: Fix removal of "." components in normalize_path
|
|
Upstream: Submitted (2015-02-03)
|
|
|
|
The code was broken in 3 ways:
|
|
* I forgot to escape the "." so it would match any character.
|
|
* The g flag is not enough to catch consecutive "." components,
|
|
because pattern matches can't overlap.
|
|
* A trailing "." component would not be removed.
|
|
|
|
This fixes commit 3fd706a50b7dbb4f8db6e5db014729db51e6beb0
|
|
("setup: Let normalize_path deal with "."".)
|
|
---
|
|
quilt/setup.in | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
--- a/quilt/setup.in
|
|
+++ b/quilt/setup.in
|
|
@@ -75,7 +75,7 @@ check_for_existing_files()
|
|
normalize_path()
|
|
{
|
|
echo "$1" | sed -r -e 's://:/:g' \
|
|
- -e 's:/./:/:g' \
|
|
+ -e 's:/\.(/\.)*(/|$):\2:g' \
|
|
-e ':again' \
|
|
-e 's:/[^/]+/\.\.(/|$):\1:g' \
|
|
-e 'tagain'
|