summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2009-11-25 15:15:56 +0100
committerAndreas Gruenbacher <agruen@suse.de>2009-11-25 15:15:56 +0100
commit8c3585bce0470d471d2179cbdfeead133dfdf867 (patch)
tree1aba5116630bdee2366864d8c38a4e1c7c702658
parent8ffdfe56c1b3c8334601fd1bddcc3a284c53845e (diff)
downloadquilt-8c3585bce0470d471d2179cbdfeead133dfdf867.tar.gz
- Make sure the series file is a regular file (or a symlink to a
regular file). Reported by Raphael Hertzog <hertzog@debian.org>.
-rw-r--r--quilt.changes6
-rw-r--r--quilt/scripts/patchfns.in23
2 files changed, 24 insertions, 5 deletions
diff --git a/quilt.changes b/quilt.changes
index 580c955..9e12b37 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Wed Nov 25 15:03:38 CET 2009 - agruen@suse.de
+
+- Make sure the series file is a regular file (or a symlink to a
+ regular file). Reported by Raphael Hertzog <hertzog@debian.org>.
+
+-------------------------------------------------------------------
Wed Nov 25 14:21:44 CET 2009 - bert.wesarg@googlemail.com
- push: update color matcher for failed merge
diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in
index c222aed..eabeef7 100644
--- a/quilt/scripts/patchfns.in
+++ b/quilt/scripts/patchfns.in
@@ -242,7 +242,14 @@ patch_in_series()
insert_in_series()
{
local patch=$1 patch_args=$2
- local before=${3-$(patch_after "$(top_patch)")} tmpfile
+ local before tmpfile
+
+ if [ -e "$SERIES" -a ! -f "$SERIES" ]; then
+ printf $"%s is not a regular file\n" "$SERIES" >&2
+ return 1
+ fi
+
+ before=${3-$(patch_after "$(top_patch)")}
if [ -n "$patch_args" ]
then
@@ -257,7 +264,7 @@ insert_in_series()
/^'"$(quote_re $before)"'([ \t]|$)/ \
{ print "'"$patch$patch_args"'" }
{ print }
- ' $SERIES > $tmpfile
+ ' "$SERIES" > $tmpfile
status=$?
if [ $status -ne 0 ]
then
@@ -265,13 +272,13 @@ insert_in_series()
return 1
fi
else
- if [ -e $SERIES ]
+ if [ -e "$SERIES" ]
then
- cat $SERIES > $tmpfile
+ cat "$SERIES" > $tmpfile
fi
echo "$patch$patch_args" >> $tmpfile
fi
- cat $tmpfile > $SERIES
+ cat $tmpfile > "$SERIES"
rm -f $tmpfile
}
@@ -520,6 +527,12 @@ find_patch()
local name="$1"
if [ -e "$SERIES" ]
then
+ if ! [ -f "$SERIES" ]
+ then
+ printf $"%s is not a regular file\n" "$SERIES" >&2
+ return 1
+ fi
+
local patch=${1#$SUBDIR_DOWN$QUILT_PATCHES/}
local bre=$(quote_bre "$patch")
set -- $(sed -e "/^$bre\(\|\.patch\|\.diff\?\)\(\|\.gz\|\.bz2\|\.xz\|\.lzma\)\([ "$'\t'"]\|$\)/!d" \