[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Quilt-dev] Non-portable sed command in find_patch
From: |
Jean Delvare |
Subject: |
[Quilt-dev] Non-portable sed command in find_patch |
Date: |
Wed, 21 Sep 2005 19:44:02 +0200 |
Hi all,
There is a non-portable sed command used in the find_patch function:
sed -e "/^$bre\(\|\.patch\|\.diff\?\)\(\|\.gz\|\.bz2\)\([ "$'\t'"]\|$\)/!d"
I would like to replace it with something more portable. I have a
replacement based on grep, see below. Is everyone fine with this? It
has the drawback of running two commands where only one was needed
before. Would a awk replacement be prefered?
Thanks.
scripts/patchfns.in | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
--- quilt.orig/scripts/patchfns.in 2005-09-21 11:18:05.000000000 +0200
+++ quilt/scripts/patchfns.in 2005-09-21 12:14:43.000000000 +0200
@@ -433,8 +433,8 @@
then
local patch="${1#$SUBDIR_DOWN$QUILT_PATCHES/}"
local bre=$(quote_bre "$patch")
- set -- $(sed -e
"/^$bre\(\|\.patch\|\.diff\?\)\(\|\.gz\|\.bz2\)\([ "$'\t'"]\|$\)/!d" \
- -e 's/[ '$'\t''].*//' $SERIES)
+ set -- $(grep "^$bre\(\|\.patch\|\.diff\?\)\(\|\.gz\|\.bz2\)\([
"$'\t'"]\|$\)" $SERIES | \
+ sed -e 's/[ '$'\t''].*//')
if [ $# -eq 1 ]
then
echo $1
--
Jean Delvare
- [Quilt-dev] Non-portable sed command in find_patch,
Jean Delvare <=