[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Quilt-dev] [patch] Fix a pipe in refresh.in
From: |
Dean Roehrich |
Subject: |
[Quilt-dev] [patch] Fix a pipe in refresh.in |
Date: |
Mon, 13 Sep 2004 14:31:51 -0500 |
We've had some problems with the following code in refresh.in, possibly
related to NFS, and definitely related to patches that do not have an Index:
line.
Here's an excerpt showing the problem...
> if ! cat_file $patch_file | patch_description > $tmp_header
> then
> die 1
> fi
> ++ cat_file patches/lockmeter.akpm.patch
> ++ local filename
> ++ '[' -e patches/lockmeter.akpm.patch ']'
> ++ cat patches/lockmeter.akpm.patch
> ++ patch_description
> ++ local patch_file=
> ++ '[' -e '' -o -z '' ']'
> ++ /bin/gawk '
> $1 == "***" || $1 == "---" { exit }
> /^Index:[ \t]|^diff[ \t]|^==*$/ \
> { eat = eat $0 "\n"
> next }
> { print eat $0
> eat = "" }
> '
> cat: write error: Broken pipe
If there is no Index line then the gawk script will exit before it has read
all of the input, and cat will get a SIGPIPE. Unfortunately, we're not clear
on why only one of our users was seeing the broken pipe but we do know how to
fix it.
The following fix was suggested by Paul Jackson <address@hidden>.
Dean
Index: work20040913/quilt/refresh.in
===================================================================
--- work20040913.orig/quilt/refresh.in 2004-09-13 09:51:42.000000000 -0500
+++ work20040913/quilt/refresh.in 2004-09-13 09:53:13.000000000 -0500
@@ -200,7 +200,7 @@ fi
mkdir -p $(dirname $patch_file)
-if ! cat_file $patch_file | patch_description > $tmp_header
+if ! patch_description $patch_file > $tmp_header
then
die 1
fi
- [Quilt-dev] [patch] Fix a pipe in refresh.in,
Dean Roehrich <=