summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2003-03-22 11:34:14 +0000
committerAndreas Gruenbacher <agruen@suse.de>2003-03-22 11:34:14 +0000
commita99811be10ebb871f1e458fd3692540efac27106 (patch)
tree74165b500bc461bccaab425a7fd13493f2532055
parent4e48fd5a6c8218e491ef3536121aae3c7a157ed6 (diff)
downloadquilt-a99811be10ebb871f1e458fd3692540efac27106.tar.gz
- Also substitute @SED@ and @AWK@.
- Some versions of sed don't like '\t'. Expand those in the shell instead.
-rw-r--r--Makefile.in4
-rw-r--r--configure.ac41
-rw-r--r--quilt.changes7
-rw-r--r--quilt/add.in2
-rw-r--r--quilt/import.in4
-rw-r--r--quilt/new.in2
-rwxr-xr-xscripts/apatch.in2
-rw-r--r--scripts/patchfns.in48
-rwxr-xr-xscripts/rpatch.in6
-rwxr-xr-xscripts/spec2series.in6
10 files changed, 81 insertions, 41 deletions
diff --git a/Makefile.in b/Makefile.in
index 9fdea02..b164558 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -19,6 +19,8 @@ LIB_DIR = $(libdir)/$(PACKAGE)
INSTALL := @INSTALL@
PERL := @PERL@
BASH := @BASH@
+SED := @SED@
+AWK := @AWK@
DIFF := @DIFF@
PATCH := @PATCH@
MKTEMP := @MKTEMP@
@@ -161,6 +163,8 @@ $(PACKAGE).spec : $(PACKAGE).spec.in $(PACKAGE).changes Makefile \
-e 's:@SCRIPTS''@:$(SCRIPTS_DIR):g' \
-e 's:@PERL''@:$(PERL):g' \
-e 's:@BASH''@:$(BASH):g' \
+ -e 's:@SED''@:$(SED):g' \
+ -e 's:@AWK''@:$(AWK):g' \
-e 's:@DIFF''@:$(DIFF):g' \
-e 's:@PATCH''@:$(PATCH):g' \
-e 's:@MKTEMP''@:$(MKTEMP):g' \
diff --git a/configure.ac b/configure.ac
index 80ad818..84978a8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT([quilt],[0.23],[quilt-dev@nongnu.org])
AC_CONFIG_AUX_DIR(config)
AC_PREREQ(2.53)
-AC_REVISION ($Revision: 1.12 $)
+AC_REVISION ($Revision: 1.13 $)
PACKAGE_RELEASE=1
AC_SUBST(PACKAGE_RELEASE)
@@ -28,7 +28,7 @@ systems implementation of #! being either broken or non-existant.
])
fi
-# Check for Bourne-Again Shell
+dnl Check for Bourne-Again Shell
AC_ARG_WITH(bash, AC_HELP_STRING(
[--with-bash], [name of the bash executable to use]),
[
@@ -70,6 +70,35 @@ if test -z "$PERL" ; then
AC_MSG_ERROR([Please specify the location of Perl with the option '--with-perl'])
fi
+dnl Check for sed
+AC_ARG_WITH(sed, AC_HELP_STRING(
+ [--with-sed], [name of the sed executable to use]),
+ [
+ SED="$withval"
+ AC_SUBST(SED)
+ AC_MSG_NOTICE([Using sed executable $SED])
+ ],[
+ SED="sed"
+ AC_SUBST(SED)
+ ])
+
+dnl Check for awk
+AC_ARG_WITH(awk, AC_HELP_STRING(
+ [--with-awk], [name of the awk executable to use]),
+ [
+ AWK="$withval"
+ AC_SUBST(AWK)
+ AC_MSG_NOTICE([Using awk executable $AWK])
+ ],[
+ AC_PATH_PROGS(AWK, [gawk awk])
+ ])
+
+dnl Test for awk features that may be mising?
+
+if test -z "$PERL" ; then
+ AC_MSG_ERROR([Please specify the location of Perl with the option '--with-perl'])
+fi
+
dnl Checks for mktemp (for creating temporary files and directories)
AC_ARG_WITH(mktemp, AC_HELP_STRING(
[--with-mktemp], [name of the mktemp executable to use (or 'none'
@@ -99,7 +128,7 @@ internal tempfile generation mechanism.
fi
fi
-# Check for diff
+dnl Check for diff
AC_ARG_WITH(diff, AC_HELP_STRING(
[--with-diff], [name of the diff executable to use]),
[
@@ -113,7 +142,7 @@ if test -z "$DIFF"; then
AC_MSG_ERROR([Please specify the location of diff with the option '--with-diff'])
fi
-# Check for patch
+dnl Check for patch
AC_ARG_WITH(patch, AC_HELP_STRING(
[--with-patch], [name of the patch executable to use]),
[
@@ -152,7 +181,7 @@ else
AC_MSG_RESULT(yes)
fi
-# Check for diffstat
+dnl Check for diffstat
AC_ARG_WITH(diffstat, AC_HELP_STRING(
[--with-diffstat], [name of the diffstat executable to use]),
[
@@ -170,7 +199,7 @@ you can specify the location the option '--with-diffstat'.
])
fi
-# Check for NLS
+dnl Check for NLS
AC_ARG_ENABLE(nls, AC_HELP_STRING(
[--enable-nls], [include natural language support]))
if test "$enableval" != "no"; then
diff --git a/quilt.changes b/quilt.changes
index d1e4121..73352e6 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Sat Mar 22 12:28:43 CET 2003 - agruen@suse.de
+
+- Also substitute @SED@ and @AWK@.
+- Some versions of sed don't like '\t'. Expand those in the
+ shell instead.
+
+-------------------------------------------------------------------
Fri Mar 21 10:42:27 CET 2003 - agruen@suse.de
- Bump version number to 0.23 (CVS tag VER_0_23).
diff --git a/quilt/add.in b/quilt/add.in
index a696bc4..ae22c56 100644
--- a/quilt/add.in
+++ b/quilt/add.in
@@ -108,7 +108,7 @@ do
if [ -e $file ]
then
- if [ "$(ls -dl $file | awk '{print $2}')" -gt 1 ]
+ if [ "$(ls -dl $file | @AWK@ '{print $2}')" -gt 1 ]
then
# We have a file with several hard links.
# As the file may likely be modified by hand
diff --git a/quilt/import.in b/quilt/import.in
index ff4c306..63b7470 100644
--- a/quilt/import.in
+++ b/quilt/import.in
@@ -57,8 +57,8 @@ do
case "$1" in
-n)
opt_patch=$(echo "$2" |
- sed -e 's/^'"$(quote_bre $P)"'patches\///' \
- -e 's/^\.pc\///')
+ @SED@ -e 's/^'"$(quote_bre $P)"'patches\///' \
+ -e 's/^\.pc\///')
shift 2 ;;
-p)
opt_strip=$2
diff --git a/quilt/new.in b/quilt/new.in
index 320349d..bba2929 100644
--- a/quilt/new.in
+++ b/quilt/new.in
@@ -59,7 +59,7 @@ then
usage
fi
-patch_file=$(echo $1 | sed -e 's/^'"$(quote_bre $P)"'patches\///')
+patch_file=$(echo $1 | @SED@ -e 's/^'"$(quote_bre $P)"'patches\///')
patch=$(stripit $patch_file)
if patch_in_series $patch
diff --git a/scripts/apatch.in b/scripts/apatch.in
index e9ea659..ca97d13 100755
--- a/scripts/apatch.in
+++ b/scripts/apatch.in
@@ -30,7 +30,7 @@ rollback_patch()
-f $pc_file -B .pc/$patch/ -r
if [ -z "$opt_leave_rejects" ]
then
- rm -f $(files_in_patch $patch | sed -e 's/$/\.rej/')
+ rm -f $(files_in_patch $patch | @SED@ -e 's/$/\.rej/')
fi
}
diff --git a/scripts/patchfns.in b/scripts/patchfns.in
index b0b13aa..e3a0934 100644
--- a/scripts/patchfns.in
+++ b/scripts/patchfns.in
@@ -32,13 +32,13 @@ DB=".pc/applied-patches"
# Quote a string for use in a basic regular expression.
quote_bre()
{
- echo "$1" | sed -e 's:\([][^$/.*\\]\):\\\1:g'
+ echo "$1" | @SED@ -e 's:\([][^$/.*\\]\):\\\1:g'
}
# Quote a string for use in an extended regular expression.
quote_re()
{
- echo "$1" | sed -e 's:\([][?{(|)}^$/.+*\\]\):\\\1:g'
+ echo "$1" | @SED@ -e 's:\([][?{(|)}^$/.+*\\]\):\\\1:g'
}
basename()
@@ -64,7 +64,7 @@ patch_file_name()
if [ -e $SERIES ]
then
- awk '/^'"$(quote_re $patch)"'(|\.patch|\.diff?)(|\.gz|\.bz2)([ \t]|$)/ \
+ @AWK@ '/^'"$(quote_re $patch)"'(|\.patch|\.diff?)(|\.gz|\.bz2)([ \t]|$)/ \
{ printf "'"$P"'patches/%s\n", $1
exit
}
@@ -79,7 +79,7 @@ patch_args()
if [ -e $SERIES ]
then
- awk '
+ @AWK@ '
/^'"$(quote_re $patch)"'(|\.patch|\.diff?)(|\.gz|\.bz2)([ \t]|$)/ \
{ if (NF >= 2)
for (i=2; i <= NF; i++)
@@ -123,7 +123,7 @@ change_db_strip_level()
if [ -e $SERIES ]
then
local tmpfile=$(gen_tempfile)
- awk '
+ @AWK@ '
/^'"$(quote_re $patch)"'(\.patch|\.diff?)(|\.gz|\.bz2)([ \t]|$)/ \
{ for(i=2; i<=NF; i++)
if ($i ~ /^-p/) {
@@ -173,7 +173,7 @@ insert_in_series()
mkdir -p $(dirname $SERIES)
if [ -n "$top" ]
then
- awk '
+ @AWK@ '
{ print }
/^'"$(quote_re $top)"'(|\.patch|\.diff?)(|\.gz|\.bz2)([ \t]|$)/ \
{ print "'"$patch$patch_args"'" }
@@ -199,7 +199,7 @@ remove_from_series()
local patch=$1
tmpfile=$(gen_tempfile) || return 1
- awk '
+ @AWK@ '
! /^'"$(quote_re $patch)"'(|\.patch|\.diff?)(|\.gz|\.bz2)([ \t]|$)/ \
{ print }
' $SERIES > $tmpfile
@@ -236,9 +236,9 @@ cat_series()
{
if [ -e $SERIES ]
then
- sed -e '/^#/d' -e 's/^[ \t]*//' -e 's/[ \t].*//' \
- -e 's/\.gz$//' -e 's/\.bz2$//' \
- -e 's/\.patch$//' -e 's/\.diff\?$//' $SERIES
+ @SED@ -e '/^#/d' -e 's/^[ '$'\t'']*//' -e 's/[ '$'\t''].*//' \
+ -e 's/\.gz$//' -e 's/\.bz2$//' \
+ -e 's/\.patch$//' -e 's/\.diff\?$//' $SERIES
else
return 1
fi
@@ -274,7 +274,7 @@ patches_before()
if [ -n "$patch" ]
then
cat_series \
- | awk '
+ | @AWK@ '
$0 == "'"$patch"'" { exit }
{ print }
'
@@ -287,7 +287,7 @@ patches_after()
if [ -n "$patch" ]
then
cat_series \
- | awk '
+ | @AWK@ '
seen { print }
$0 == "'"$patch"'" { seen=1 }
'
@@ -301,7 +301,7 @@ patches_on_top_of()
{
local patch=$1
[ -e $DB ] || return
- awk '
+ @AWK@ '
$0 == "'"$patch"'" { seen=1 ; next }
seen { print }
' $DB
@@ -319,7 +319,7 @@ next_patch_for_file()
grep -l -E "^$(quote_re $file)\$" \
$(pc_file_name $patches_on_top) \
| head -1 \
- | sed -e 's:^\.pc/::' -e 's:/\.pc$::'
+ | @SED@ -e 's:^\.pc/::' -e 's:/\.pc$::'
fi
#modified_files $file -- $patches_on_top \
@@ -364,7 +364,7 @@ refresh_patches_per_file()
return 0
fi
- awk '
+ @AWK@ '
ARGIND!=saved { sub(/^.pc\//, "", FILENAME)
sub(/\/\.pc/, "", FILENAME)
saved=ARGIND
@@ -391,7 +391,7 @@ modified_files()
return 1
fi
- awk '
+ @AWK@ '
BEGIN { no_files=1
no_patches=1
for (i=1; i<ARGC; i++) {
@@ -446,10 +446,10 @@ stripit()
if [ -n "$1" ]
then
echo $1 |
- sed -e 's/^\(\.\/\)*//' \
- -e 's/^'"$(quote_bre $P)"'patches\///' \
- -e 's/\.gz$//' -e 's/\.bz2$//' \
- -e 's/\.patch$//' -e 's/\.diff\?$//'
+ @SED@ -e 's/^\(\.\/\)*//' \
+ -e 's/^'"$(quote_bre $P)"'patches\///' \
+ -e 's/\.gz$//' -e 's/\.bz2$//' \
+ -e 's/\.patch$//' -e 's/\.diff\?$//'
fi
}
@@ -473,7 +473,7 @@ touched_by_patch()
{
local strip=$1 patch=$2
cat_file $(patch_file_name $patch) \
- | awk '
+ | @AWK@ '
/^\+\+\+[ \t]/ {
sub(/^\+\+\+[ \t]/, "")
sub(/[ \t].*/, "")
@@ -523,8 +523,8 @@ refresh_file_list()
fix_diff_header()
{
local from=$1 to=$2
- sed -e 's/^--- [^ \t]*/--- '"$(quote_bre $from)"'/' \
- -e 's/^+++ [^ \t]*/+++ '"$(quote_bre $to)"'/'
+ @SED@ -e 's/^--- [^ '$'\t'']*/--- '"$(quote_bre $from)"'/' \
+ -e 's/^+++ [^ '$'\t'']*/+++ '"$(quote_bre $to)"'/'
}
diff_file()
@@ -601,7 +601,7 @@ patch_description()
if [ -e "$patch_file" -o -z "$patch_file" ]
then
- awk '
+ @AWK@ '
$1 == "---" { exit }
$1 == "Index:" { eat = eat $0
next }
diff --git a/scripts/rpatch.in b/scripts/rpatch.in
index 9c087f8..bba3dfe 100755
--- a/scripts/rpatch.in
+++ b/scripts/rpatch.in
@@ -45,8 +45,8 @@ verify_removal()
fi
@DIFF@ -Nu $DIFF_OPTS $bup $file \
- | sed -e 's:^--- [^ \t]*:--- '"$dir/$file.orig"':' \
- -e 's:^+++ [^ \t]*:+++ '"$dir/$file"':'
+ | @SED@ -e 's:^--- [^ '$'\t'']*:--- '"$dir/$file.orig"':' \
+ -e 's:^+++ [^ '$'\t'']*:+++ '"$dir/$file"':'
status=1
done
@@ -92,7 +92,7 @@ rollback_patch()
local patch=$1 pc_file=$(pc_file_name $patch)
@LIB@/backup-files $silent_unless_verbose \
-f $pc_file -z ~rpatch -r
- rm -f $(files_in_patch $patch | sed -e 's/$/\.rej/')
+ rm -f $(files_in_patch $patch | @SED@ -e 's/$/\.rej/')
}
interrupt()
diff --git a/scripts/spec2series.in b/scripts/spec2series.in
index f43a3fb..8d1c0aa 100755
--- a/scripts/spec2series.in
+++ b/scripts/spec2series.in
@@ -103,7 +103,7 @@ echo $" done" >&2
RPM="rpm --rcfile=/usr/lib/rpm/rpmrc:$WORK/rpmrc"
PATH="$WORK/bin:$PATH"
grep ^macrofiles /usr/lib/rpm/rpmrc \
- | sed -e "/macrofiles/s|$|:$WORK/rpmmacros|" \
+ | @SED@ -e "/macrofiles/s|$|:$WORK/rpmmacros|" \
> $WORK/rpmrc
cat <<-EOF > "$WORK/rpmmacros"
%_sourcedir $specdir
@@ -159,7 +159,7 @@ cat <<-'EOF' > "$WORK/bin/patch"
done
# print results
- unpackdir=`echo $unpackdir | sed -e "s|$RPM_BUILD_DIR|BUILD|"`
+ unpackdir=`echo $unpackdir | @SED@ -e "s|$RPM_BUILD_DIR|BUILD|"`
echo -n "# log: [$unpackdir] $uncompress $unpackfile" >>$WORK/cmdlog
echo " | $unpackcmd $unpackargs" >>$WORK/cmdlog
if test "$unpackcmd" = "patch" -a \
@@ -205,7 +205,7 @@ echo $" done" >&2
# additional info for trouble shooting
if test "$debug" = "1"; then
- cat $WORK/md5sum | sed -e 's/^/# md5: /'
+ cat $WORK/md5sum | @SED@ -e 's/^/# md5: /'
echo "#"
test -f $WORK/cmdlog && cat $WORK/cmdlog && echo "#"