diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2005-09-18 00:04:00 +0000 |
---|---|---|
committer | Andreas Gruenbacher <agruen@suse.de> | 2005-09-18 00:04:00 +0000 |
commit | 19cf6de2f3070181014e9add7c067043b05d7ca6 (patch) | |
tree | b8c2da9339b58b607120c132bea3bdb4f3d8bc21 /scripts | |
parent | 9da8868de2d0f89fe81123425d60eb1fa39d2b99 (diff) | |
download | quilt-19cf6de2f3070181014e9add7c067043b05d7ca6.tar.gz |
- Replace @FOO@ macros in scripts with foo command where possible.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/inspect.in | 17 | ||||
-rw-r--r-- | scripts/patchfns.in | 48 |
2 files changed, 32 insertions, 33 deletions
diff --git a/scripts/inspect.in b/scripts/inspect.in index 7ad2b7a..b929b0f 100644 --- a/scripts/inspect.in +++ b/scripts/inspect.in @@ -85,11 +85,6 @@ done > $tmpdir/md5sums echo >&4 shopt -u nullglob -RPM=( @RPMBUILD@ --eval "%define _sourcedir $sourcedir" \ - --eval "%define _specdir $sourcedir" \ - --eval "%define _builddir $tmpdir/build" ) -PATH="$tmpdir/bin:$PATH" - # wrapper script for patch and tar cat <<-'EOF' > $tmpdir/bin/wrapper #! @BASH@ @@ -192,10 +187,14 @@ ln -s wrapper $tmpdir/bin/patch ln -s wrapper $tmpdir/bin/tar # let rpm do all the dirty specfile stuff ... -set -- @RPMBUILD@ -echo -n "### ${1##*/}: " >&4 - -"${RPM[@]}" --nodeps -bp "$specfile" < /dev/null >&2 +echo -n "### rpmbuild: " >&4 + +export PATH="$tmpdir/bin:$PATH" +rpmbuild --eval "%define _sourcedir $sourcedir" \ + --eval "%define _specdir $sourcedir" \ + --eval "%define _builddir $tmpdir/build" \ + --nodeps \ + -bp "$specfile" < /dev/null >&2 status=$? echo >&4 exit $status diff --git a/scripts/patchfns.in b/scripts/patchfns.in index 308548a..d378037 100644 --- a/scripts/patchfns.in +++ b/scripts/patchfns.in @@ -80,13 +80,13 @@ fi # 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() @@ -118,7 +118,7 @@ patch_args() if [ -e $SERIES ] then - @AWK@ ' + awk ' {sub(/(^|[ \t]+)#.*/, "") } $1 == "'"$patch"'" \ { if (NF >= 2) @@ -163,7 +163,7 @@ change_db_strip_level() if [ -e $SERIES ] then local tmpfile=$(gen_tempfile) - @AWK@ ' + awk ' /^'"$(quote_re $patch)"'([ \t]|$)/ \ { for(i=2; i<=NF; i++) if ($i ~ /^-p/) { @@ -212,7 +212,7 @@ insert_in_series() mkdir -p $(dirname $SERIES) if [ -n "$next" ] then - @AWK@ ' + awk ' /^'"$(quote_re $next)"'([ \t]|$)/ \ { print "'"$patch$patch_args"'" } { print } @@ -239,7 +239,7 @@ remove_from_series() local patch=$1 tmpfile=$(gen_tempfile) || return 1 - @AWK@ ' + awk ' ! /^'"$(quote_re $patch)"'([ \t]|$)/ \ { print } ' $SERIES > $tmpfile @@ -257,7 +257,7 @@ rename_in_series() local from=$1 to=$2 tmpfile=$(gen_tempfile) || return 1 - @AWK@ ' + awk ' /^'"$(quote_re $from)"'([ \t]|$)/ \ { sub(/'"$(quote_re $from)"'/, "'"${to//\"/\\\"}"'") good=1 } @@ -278,7 +278,7 @@ rename_in_db() local from=$1 to=$2 local tmpfile tmpfile=$(gen_tempfile) || return 1 - @AWK@ ' + awk ' /^'"$(quote_re $from)"'$/ \ { sub(/'"$(quote_re $from)"'/, "'"${to//\"/\\\"}"'") good=1 } @@ -309,8 +309,8 @@ cat_series() { if [ -e $SERIES ] then - @SED@ -e '/^$/d' -e '/^#/d' -e 's/^[ '$'\t'']*//' \ - -e 's/[ '$'\t''].*//' $SERIES + sed -e '/^$/d' -e '/^#/d' -e 's/^[ '$'\t'']*//' \ + -e 's/[ '$'\t''].*//' $SERIES else return 1 fi @@ -345,7 +345,7 @@ applied_before() if [ -n "$patch" ] then - @AWK@ ' + awk ' $0 == "'"$patch"'" { exit } { print } ' $DB @@ -359,7 +359,7 @@ patches_before() if [ -n "$patch" ] then cat_series \ - | @AWK@ ' + | awk ' $0 == "'"$patch"'" { exit } { print } ' @@ -372,7 +372,7 @@ patches_after() if [ -n "$patch" ] then cat_series \ - | @AWK@ ' + | awk ' seen { print } $0 == "'"$patch"'" { seen=1 } ' @@ -386,7 +386,7 @@ patches_on_top_of() { local patch=$1 [ -e $DB ] || return - @AWK@ ' + awk ' $0 == "'"$patch"'" { seen=1 ; next } seen { print } ' $DB @@ -437,7 +437,7 @@ find_patch() then local patch="${1#$SUBDIR_DOWN$QUILT_PATCHES/}" local bre=$(quote_bre "$patch") - set -- $(@SED@ -e "/^$bre\(\|\.patch\|\.diff\?\)\(\|\.gz\|\.bz2\)\([ "$'\t'"]\|$\)/!d" \ + set -- $(sed -e "/^$bre\(\|\.patch\|\.diff\?\)\(\|\.gz\|\.bz2\)\([ "$'\t'"]\|$\)/!d" \ -e 's/[ '$'\t''].*//' $SERIES) if [ $# -eq 1 ] then @@ -487,7 +487,7 @@ filenames_in_patch() if [ -e "$patch_file" ] then local strip=$(patch_strip_level $patch) - @AWK@ ' + awk ' ($1 == "+++" || $1 == "---" || $1 == "***") && \ $3 != "----" && $3 != "****" \ { sub(/\t.*/, "") @@ -505,7 +505,7 @@ files_in_patch_ordered() ( files_in_patch $patch | sort echo "-" filenames_in_patch $patch - ) | @AWK@ ' + ) | awk ' $1 == "-" { out=1 ; next } !out { files[$0]=1 new_files[++n]=$0 } @@ -562,8 +562,8 @@ diff_file() -r "$new_file") fi - @DIFF@ -N $QUILT_DIFF_OPTS $old_file $new_file \ - --label "$old_hdr$old_date" --label "$new_hdr$new_date" \ + diff -N $QUILT_DIFF_OPTS $old_file $new_file \ + --label "$old_hdr$old_date" --label "$new_hdr$new_date" \ | if read line then if [ -z "$QUILT_NO_DIFF_INDEX" ] @@ -615,7 +615,7 @@ cat_to_new_file() patch_header() { - @AWK@ ' + awk ' $1 == "***" || $1 == "---" \ { exit } /^Index:[ \t]|^diff[ \t]|^==*$|^RCS file: |^retrieving revision [0-9]+(\.[0-9]+)*$/ \ @@ -628,7 +628,7 @@ patch_header() patch_body() { - @AWK@ ' + awk ' /^Index:[ \t]|^diff[ \t]|^==*$|^RCS file: |^retrieving revision [0-9]+(\.[0-9]+)*$/ \ { eat = eat $0 "\n" next } @@ -657,9 +657,9 @@ gen_tempfile() local name if [ "$1" = -d ] then - @MKTEMP@ -d ${2:-${TMPDIR:-/tmp}/${0// /_}}.XXXXXX + mktemp -d ${2:-${TMPDIR:-/tmp}/${0// /_}}.XXXXXX else - @MKTEMP@ ${1:-${TMPDIR:-/tmp}/${0// /_}}.XXXXXX + mktemp ${1:-${TMPDIR:-/tmp}/${0// /_}}.XXXXXX fi } @@ -730,7 +730,7 @@ quilt_command () local command=$1 shift - QUILT_COMMAND="" @BASH@ $BASH_OPTS -c ". @QUILT@/$command" "quilt $command" "$@" + QUILT_COMMAND="" bash $BASH_OPTS -c ". @QUILT@/$command" "quilt $command" "$@" } # |