forked from pool/quilt
28 lines
873 B
Diff
28 lines
873 B
Diff
|
From: Jean Delvare <jdelvare@suse.de>
|
||
|
Date: Tue, 20 Jan 2015 20:54:54 +0100
|
||
|
Subject: setup: Let normalize_path deal with "."
|
||
|
Upstream: Committed (3fd706a50b7dbb4f8db6e5db014729db51e6beb0)
|
||
|
|
||
|
Let function normalize_path handle "." path components. Otherwise
|
||
|
invocations like "quilt setup --sourcedir=. foo.spec" may produce
|
||
|
invalid series files, and "quilt setup -d ./dir foo.spec"
|
||
|
generates a broken "patches" link.
|
||
|
|
||
|
diff --git a/quilt/setup.in b/quilt/setup.in
|
||
|
index df76368..7f69f35 100644
|
||
|
--- a/quilt/setup.in
|
||
|
+++ b/quilt/setup.in
|
||
|
@@ -71,10 +71,11 @@ check_for_existing_files()
|
||
|
return $status
|
||
|
}
|
||
|
|
||
|
-# Resolve ".." in path and clean up double slashes
|
||
|
+# Resolve ".." in path and clean up double slashes and "."
|
||
|
normalize_path()
|
||
|
{
|
||
|
echo "$1" | sed -r -e 's://:/:g' \
|
||
|
+ -e 's:/./:/:g' \
|
||
|
-e ':again' \
|
||
|
-e 's:/[^/]+/\.\.(/|$):\1:g' \
|
||
|
-e 'tagain'
|