quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Quilt-dev] [patch 3/4] makefile cleanup


From: John Vandenberg
Subject: [Quilt-dev] [patch 3/4] makefile cleanup
Date: Wed, 28 Sep 2005 11:54:43 +1000
User-agent: quilt/0.42-1

Run tests locally without installing

 Makefile.in         |   39 ++++++++++++++++++++++++++-------------
 scripts/patchfns.in |    6 +++---
 bin/quilt.in        |   30 +++++++++++++++++++++++-------
 quilt/add.in        |    8 ++++----
 quilt/annotate.in   |    6 +++---
 quilt/applied.in    |    6 +++---
 quilt/delete.in     |    6 +++---
 quilt/diff.in       |    6 +++---
 quilt/edit.in       |    6 +++---
 quilt/files.in      |    6 +++---
 quilt/fold.in       |    6 +++---
 quilt/fork.in       |    6 +++---
 quilt/graph.in      |    8 ++++----
 quilt/grep.in       |    6 +++---
 quilt/header.in     |    6 +++---
 quilt/import.in     |    6 +++---
 quilt/mail.in       |   18 +++++++++---------
 quilt/new.in        |    6 +++---
 quilt/next.in       |    6 +++---
 quilt/patches.in    |    6 +++---
 quilt/pop.in        |   10 +++++-----
 quilt/previous.in   |    6 +++---
 quilt/push.in       |    8 ++++----
 quilt/refresh.in    |   10 +++++-----
 quilt/remove.in     |    8 ++++----
 quilt/rename.in     |    6 +++---
 quilt/series.in     |    6 +++---
 quilt/setup.in      |    8 ++++----
 quilt/snapshot.in   |    8 ++++----
 quilt/top.in        |    6 +++---
 quilt/unapplied.in  |    6 +++---
 quilt/upgrade.in    |    6 +++---
 scripts/inspect.in  |    8 +++++---
 test/Makefile       |    9 ++++++---
 34 files changed, 166 insertions(+), 132 deletions(-)

--- quilt-local.orig/Makefile.in
+++ quilt-local/Makefile.in
@@ -119,9 +119,10 @@ all : $(BIN:%=bin/%) \
       $(QUILT:%=quilt/%) \
       $(SCRIPTS:%=scripts/%) \
       $(LIB:%=lib/%) \
+      $(COMPAT_SYMLINKS:%=compat/%) \
+      $(COMPAT_PROGRAMS:%=compat/%) \
       $(DOC:%=doc/%) \
       $(MAN1) \
-      $(COMPAT_PROGRAMS:%=compat/%) \
       $(if $(MSGFMT),$(LINGUAS:%=po/%.mo))
 
 $(LIB:%=lib/%) : $(LIB_SRC:%.c=lib/%.o)
@@ -172,20 +173,17 @@ doc/README : doc/README.in $(QUILT:%=qui
 
 doc/quilt.1: doc/quilt.1.in $(QUILT:%=quilt/%)
        @echo "quilt.1.in -> quilt.1"
-       @here=`pwd`;                                     \
-       PATH="$$here/compat:$$PATH";                     \
-       export PATH;                                     \
-        while read line; do                             \
+       @while read line; do                             \
          case "$$line" in                               \
            '@REFERENCE''@')                             \
-              for cmd in $(sort $(QUILT:%=quilt/%)) ; do \
-               ($(BASH) -c ". scripts/patchfns ; LC_ALL=C . $$here/$$cmd -h")| 
\
+              for cmd in $(sort $(QUILT)) ; do \
+               ($(BASH) -c "LC_ALL=C ./bin/quilt $$cmd -h")| \
                   sed -e 's/Usage: quilt //'            \
                       -e 's/^\([^ ]*\)/\\fB\1\\fP/'     \
                       -e 's/^/.IP "/' -e 's/$$/ " 4/' | \
                   head -n 1;                            \
                 echo ;                                  \
-               ($(BASH) -c ". scripts/patchfns ; LC_ALL=C . $$here/$$cmd -h")| 
\
+               ($(BASH) -c "LC_ALL=C ./bin/quilt $$cmd -h")| \
                 grep -v 'Usage: quilt' |                \
                   sed -e $$'s/^\t//'                    \
                       -e $$'s/\t/\\\n/' |               \
@@ -202,13 +200,10 @@ doc/quilt.1: doc/quilt.1.in $(QUILT:%=qu
 
 .PHONY : reference
 reference : $(QUILT:%=quilt/%) scripts/patchfns
-       @PATH="`pwd`/compat:$$PATH"; \
-       export PATH; \
-       dir=$(CURDIR); \
-       for i in $(QUILT:%=quilt/%); \
+       @for cmd in $(sort $(QUILT)); \
        do \
                echo; \
-               ($(BASH) -c ". scripts/patchfns ; cd $$dir ;LC_ALL=C . $$i 
-h"); \
+               ($(BASH) -c "LC_ALL=C ./bin/quilt $$cmd -h"); \
                echo; \
        done | \
        sed -e 's/\$$EDITOR ([^)]*)/$$EDITOR/' \
@@ -258,12 +253,30 @@ define substitute
 endef
 
 $(patsubst %.in,%,$(wildcard */*.in)) : Makefile
+bin/% : bin/%.in
+       $(call substitute)
+       chmod +x $@
+scripts/% : scripts/%.in
+       $(call substitute)
+       chmod +x $@
+quilt/% : quilt/%.in
+       $(call substitute)
+       chmod +x $@
 compat/% : compat/%.in
        $(call substitute)
        chmod +x $@
 % : %.in
        $(call substitute)
 
+define COMPAT_SYMLINK_local_install
+compat/$(strip $(1)) : $($(shell echo $(1) | $(AWK) '{print toupper($$1)}'))
+       ln -sf $($(shell echo $(1) | $(AWK) '{print toupper($$1)}')) 
compat/$(strip $(1))
+
+endef
+
+$(foreach symlink,$(COMPAT_SYMLINKS),$(eval $(call 
COMPAT_SYMLINK_local_install, $(symlink))))
+
+
 lib/backup-files.o : Makefile
 
 Makefile : Makefile.in
--- quilt-local.orig/scripts/patchfns.in
+++ quilt-local/scripts/patchfns.in
@@ -24,9 +24,9 @@ DB_VERSION=2
 : ${QUILT_PC:=.pc}
 
 # Support compatibility layer
-if [ -d @QUILT@/compat ]
+if [ -d "$QUILT_DIR/compat" ]
 then
-       export PATH="@QUILT@/compat:$PATH"
+       export PATH="$QUILT_DIR/compat:$PATH"
 fi
 
 unset CDPATH
@@ -726,7 +726,7 @@ quilt_command ()
        local command=$1
        shift
 
-       QUILT_COMMAND="" bash $BASH_OPTS -c ". @QUILT@/$command" "quilt 
$command" "$@"
+       QUILT_COMMAND="" bash $BASH_OPTS -c ". $QUILT_DIR/$command" "quilt 
$command" "$@"
 }
 
 #
--- quilt-local.orig/bin/quilt.in
+++ quilt-local/bin/quilt.in
@@ -17,10 +17,17 @@ then
        export QUILTRC
 fi
 
-# Support compatibility layer
-if [ -d @QUILT@/compat ]
+: ${QUILT_DIR:=.}
+if [ -n "$QUILT_DIR" -a -d "$QUILT_DIR/CVS"  ]
 then
-       export PATH="@QUILT@/compat:$PATH"
+       QUILT_SCRIPTS="$QUILT_DIR/scripts"
+       QUILT_LIB="$QUILT_DIR/lib"
+       QUILT_COMMAND_DIR="$QUILT_DIR/quilt"
+else
+       QUILT_DIR="@QUILT@"
+       QUILT_SCRIPTS="@SCRIPTS@"
+       QUILT_LIB="@LIB@"
+       QUILT_COMMAND_DIR="$QUILT_DIR"
 fi
 
 usage()
@@ -53,11 +60,11 @@ Global options:
 quilt_commands()
 {
        local command
-       for command in @QUILT@/*
+       for command in $(ls "$QUILT_COMMAND_DIR"/* | grep -v \.in)
        do
                if [ -f "$command" -a -x "$command" ]
                then
-                       echo address@hidden@/}
+                       echo ${command##"$QUILT_COMMAND_DIR"/}
                fi
        done
 }
@@ -105,7 +112,13 @@ do
        shift
 done
 
-if ! [ -f "@QUILT@/$command" -a -x "@QUILT@/$command" ]
+# Support compatibility layer
+if [ -d "$QUILT_DIR"/compat ]
+then
+       export PATH="$QUILT_DIR/compat:$PATH"
+fi
+
+if ! [ -f "$QUILT_COMMAND_DIR/$command" -a -x "$QUILT_COMMAND_DIR/$command" ]
 then
        if [ -n "$command" ]
        then
@@ -137,4 +150,7 @@ set -- "address@hidden"
 unset args
 
 export QUILT_COMMAND="${command##*/}"
-bash $BASH_OPTS -c ". @QUILT@/$command" "quilt ${command##*/}" "$@"
+
+export QUILT_DIR QUILT_SCRIPTS QUILT_LIB QUILT_COMMAND_DIR
+
+bash $BASH_OPTS -c ". $QUILT_COMMAND_DIR/$command" "quilt ${command##*/}" "$@"
--- quilt-local.orig/quilt/add.in
+++ quilt-local/quilt/add.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
@@ -139,7 +139,7 @@ do
                continue
        fi
 
-       if ! @LIB@/backup-files -b -s -L -B $QUILT_PC/$patch/ $SUBDIR$file
+       if ! "$QUILT_LIB"/backup-files -b -s -L -B $QUILT_PC/$patch/ 
$SUBDIR$file
        then
                printf $"Failed to back up file %s\n" "$SUBDIR$file" >&2
                status=1
--- quilt-local.orig/quilt/annotate.in
+++ quilt-local/quilt/annotate.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
--- quilt-local.orig/quilt/applied.in
+++ quilt-local/quilt/applied.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
--- quilt-local.orig/quilt/delete.in
+++ quilt-local/quilt/delete.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
--- quilt-local.orig/quilt/diff.in
+++ quilt-local/quilt/diff.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 setup_colors
--- quilt-local.orig/quilt/edit.in
+++ quilt-local/quilt/edit.in
@@ -11,12 +11,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
--- quilt-local.orig/quilt/files.in
+++ quilt-local/quilt/files.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
--- quilt-local.orig/quilt/fold.in
+++ quilt-local/quilt/fold.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
--- quilt-local.orig/quilt/fork.in
+++ quilt-local/quilt/fork.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
--- quilt-local.orig/quilt/graph.in
+++ quilt-local/quilt/graph.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
@@ -143,7 +143,7 @@ pipe=
 [ -n "$opt_format" ] && pipe="| dot -T$opt_format"
 
 applied_patches \
-| eval @SCRIPTS@/dependency-graph $options - $pipe
+| eval "$QUILT_SCRIPTS/dependency-graph" $options - $pipe
 ### Local Variables:
 ### mode: shell-script
 ### End:
--- quilt-local.orig/quilt/grep.in
+++ quilt-local/quilt/grep.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
--- quilt-local.orig/quilt/header.in
+++ quilt-local/quilt/header.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 : ${EDITOR:=vi}
--- quilt-local.orig/quilt/import.in
+++ quilt-local/quilt/import.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
--- quilt-local.orig/quilt/mail.in
+++ quilt-local/quilt/mail.in
@@ -11,12 +11,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
@@ -65,14 +65,14 @@ process_mail()
        local tmpfile=$(gen_tempfile)
 
        cat > $tmpfile
-       set -- $(@SCRIPTS@/edmail --charset $opt_charset \
+       set -- $($QUILT_SCRIPTS/edmail --charset $opt_charset \
                                  --extract-recipients To \
                                  --extract-recipients Cc \
                                  --extract-recipients Bcc \
                                  < $tmpfile)
        if [ -n "$opt_send" ]; then
                echo sendmail ${QUILT_SENDMAIL_ARGS--f "$opt_sender"} "$@"
-               @SCRIPTS@/edmail --charset $opt_charset \
+               "$QUILT_DIR"/scripts/edmail --charset $opt_charset \
                                 --remove-header Bcc "$@" < $tmpfile \
                | sendmail ${QUILT_SENDMAIL_ARGS--f "$opt_sender"} "$@"
        else
@@ -186,7 +186,7 @@ introduction=$(gen_tempfile)
        --
        EOF
        [ -r $HOME/.signature ] && cat $HOME/.signature
-) | @SCRIPTS@/edmail --charset $opt_charset > $introduction
+) | "$QUILT_SCRIPTS/edmail" --charset $opt_charset > $introduction
 
 $EDITOR $introduction || exit 1
 
@@ -207,7 +207,7 @@ p=${p//@total@/$total}
 sed -e $'s/^\\(Subject:[ \t]\\)/\\1'"$p"'/' \
     -e '/^Subject-Prefix:/d' \
 $introduction \
-| @SCRIPTS@/edmail --charset $opt_charset \
+| "$QUILT_SCRIPTS/edmail" --charset $opt_charset \
                  --remove-empty-headers To Cc Bcc \
 | process_mail
 
@@ -263,13 +263,13 @@ for patch in "$@"; do
                ' $body
                echo -e '\n--'
                [ -r $HOME/.signature ] && cat $HOME/.signature
-       ) | eval @SCRIPTS@/edmail --charset $opt_charset \
+       ) | eval "$QUILT_SCRIPTS/edmail" --charset $opt_charset \
                --replace-header Date="\"$new_date\"" \
                To Cc Bcc \
                $modify \
        | sed -e $'s/^\\(Subject:[ \t]\\)/\\1'"$p"'/' \
              -e '/^Subject-Prefix:/d' \
-       | @SCRIPTS@/edmail --remove-empty-headers \
+       | "$QUILT_SCRIPTS/edmail" --remove-empty-headers \
        | process_mail
 
        if [ ${PIPESTATUS[1]} -ne 0 ]; then
--- quilt-local.orig/quilt/new.in
+++ quilt-local/quilt/new.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
--- quilt-local.orig/quilt/next.in
+++ quilt-local/quilt/next.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
--- quilt-local.orig/quilt/patches.in
+++ quilt-local/quilt/patches.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
--- quilt-local.orig/quilt/pop.in
+++ quilt-local/quilt/pop.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
@@ -170,7 +170,7 @@ remove_patch()
                        status=0
                else
                        printf $"Removing patch %s\n" "$(print_patch $patch)"
-                       @LIB@/backup-files $silent -r -t -B $QUILT_PC/$patch/ -
+                       "$QUILT_LIB"/backup-files $silent -r -t -B 
$QUILT_PC/$patch/ -
                        status=$?
                fi
                remove_from_db $patch
@@ -285,7 +285,7 @@ else
        # of one: This will automatically be the case in the usual
        # situations, but we don't want to risk file corruption in weird
        # corner cases such as files added to a patch but not modified.
-       @LIB@/backup-files -L -s -B $QUILT_PC/$patch/ -
+       "$QUILT_LIB"/backup-files -L -s -B $QUILT_PC/$patch/ -
        printf $"Now at patch %s\n" "$(print_patch $patch)"
 fi
 ### Local Variables:
--- quilt-local.orig/quilt/previous.in
+++ quilt-local/quilt/previous.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
--- quilt-local.orig/quilt/push.in
+++ quilt-local/quilt/push.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 setup_colors
@@ -119,7 +119,7 @@ rollback_patch()
 {
        local patch=$1
 
-       @LIB@/backup-files $silent_unless_verbose -r -B $QUILT_PC/$patch/ -
+       "$QUILT_LIB"/backup-files $silent_unless_verbose -r -B 
$QUILT_PC/$patch/ -
 }
 
 cleanup_patch_output() {
--- quilt-local.orig/quilt/refresh.in
+++ quilt-local/quilt/refresh.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
@@ -223,11 +223,11 @@ fi
 # Check for trailing whitespace
 if [ -z "$opt_strip_whitespace" ]
 then
-       @SCRIPTS@/remove-trailing-ws -n -p$opt_strip_level \
+       "$QUILT_SCRIPTS/remove-trailing-ws" -n -p$opt_strip_level \
        < $tmp_patch
 else
        tmp_patch2=$(gen_tempfile)
-       if @SCRIPTS@/remove-trailing-ws -p$opt_strip_level \
+       if "$QUILT_SCRIPTS/remove-trailing-ws" -p$opt_strip_level \
                                        < $tmp_patch > $tmp_patch2
        then
                rm -f $tmp_patch
--- quilt-local.orig/quilt/remove.in
+++ quilt-local/quilt/remove.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
@@ -104,7 +104,7 @@ do  
        fi
 
        # Restore file from backup
-       if ! @LIB@/backup-files -r -t -s -B $QUILT_PC/$patch/ $SUBDIR$file
+       if ! "$QUILT_LIB"/backup-files -r -t -s -B $QUILT_PC/$patch/ 
$SUBDIR$file
        then
                printf $"Failed to remove file %s from patch %s\n" \
                       "$SUBDIR$file" "$(print_patch $patch)" >&2
--- quilt-local.orig/quilt/rename.in
+++ quilt-local/quilt/rename.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
--- quilt-local.orig/quilt/series.in
+++ quilt-local/quilt/series.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
--- quilt-local.orig/quilt/setup.in
+++ quilt-local/quilt/setup.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
        if [ -n "$SUBDIR" ]
        then
                cd $SUBDIR
@@ -113,7 +113,7 @@ case "$1" in
 *.spec)
        spec_file="$1"
 
-       if ! @SCRIPTS@/inspect $verbose "$spec_file" 2>&1 > $tmpfile
+       if ! "$QUILT_SCRIPTS/inspect" $verbose "$spec_file" 2>&1 > $tmpfile
        then
                printf $"The %%prep section of %s failed; results may be 
incomplete\n" "$spec_file"
                if [ -z "$verbose" ]
--- quilt-local.orig/quilt/snapshot.in
+++ quilt-local/quilt/snapshot.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
@@ -85,7 +85,7 @@ done \
        }
        { print }
 ' \
-| @LIB@/backup-files -b -s -L -f - -B "$QUILT_PC/$snap_subdir/"
+| "$QUILT_LIB"/backup-files -b -s -L -f - -B "$QUILT_PC/$snap_subdir/"
 
 ### Local Variables:
 ### mode: shell-script
--- quilt-local.orig/quilt/top.in
+++ quilt-local/quilt/top.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
--- quilt-local.orig/quilt/unapplied.in
+++ quilt-local/quilt/unapplied.in
@@ -9,12 +9,12 @@
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
--- quilt-local.orig/quilt/upgrade.in
+++ quilt-local/quilt/upgrade.in
@@ -12,12 +12,12 @@ skip_version_check=1
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
-       if ! [ -r @SCRIPTS@/patchfns ]
+       if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
        then
-               echo "Cannot read library @SCRIPTS@/patchfns" >&2
+               echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
                exit 1
        fi
-       . @SCRIPTS@/patchfns
+       . "$QUILT_SCRIPTS/patchfns"
 fi
 
 usage()
--- quilt-local.orig/scripts/inspect.in
+++ quilt-local/scripts/inspect.in
@@ -6,12 +6,14 @@
 #
 #  See the COPYING and AUTHORS files for more details.
 
-if ! [ -r @SCRIPTS@/patchfns ]
+: ${QUILT_SCRIPTS:address@hidden@}
+
+if ! [ -r "$QUILT_SCRIPTS/patchfns" ]
 then
-       echo "Cannot read library @SCRIPTS@/patchfns" >&2
+       echo "Cannot read library $QUILT_SCRIPTS/patchfns" >&2
        exit 1
 fi
-. @SCRIPTS@/patchfns
+. "$QUILT_SCRIPTS/patchfns"
 cd ${SUBDIR:-.}
 
 usage() {
--- quilt-local.orig/test/Makefile
+++ quilt-local/test/Makefile
@@ -1,7 +1,10 @@
 TESTS=$(shell ls -tr *.test)
 
-QUILTRC=$(CURDIR)/test.quiltrc
-export QUILTRC
+QUILT_DIR:=$(shell cd $(CURDIR)/.. && pwd)
+PATH:=$(QUILT_DIR)/bin:$(PATH)
+QUILTRC:=$(CURDIR)/test.quiltrc
+export PATH QUILTRC QUILT_DIR
+
 ifneq ($(shell . $(QUILTRC) ;  echo $$QUILT_PATCHES_PREFIX),)
 P=patches/
 _P=../patches/
@@ -15,4 +18,4 @@ all: $(TESTS)
 
 $(TESTS):
        @echo "address@hidden"
-       @LANG=POSIX ./run $@
+       LANG=POSIX ./run $@

--
John




reply via email to

[Prev in Thread] Current Thread [Next in Thread]