quilt-dev
[Top][All Lists]
Advanced

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

[Quilt-dev] [patch] resend - remove patch-wrapper


From: Dean Roehrich
Subject: [Quilt-dev] [patch] resend - remove patch-wrapper
Date: Fri, 31 Oct 2008 15:29:31 -0500
User-agent: Mutt/1.5.9i

On Fri, Oct 31, 2008 at 02:51:19PM -0500, Dean Roehrich wrote:
> Per discussion today, here's a patch to remove patch-wrapper.  It doesn't
> appear that patch-wrapper is being used for anything.

And in that first patch I forgot to remove bin/patch-wrapper.in.

Dean


-----


Index: quilt20081022/configure.ac
===================================================================
--- quilt20081022.orig/configure.ac     2008-10-31 15:28:49.048881000 -0500
+++ quilt20081022/configure.ac  2008-10-31 15:28:57.060948000 -0500
@@ -366,11 +366,6 @@ You can download GNU Gettext from ftp.gn
 ])
 fi
 
-AC_ARG_WITH(patch-wrapper, AC_HELP_STRING(
-    [--with-patch-wrapper], [include GNU patch wrapper]))
-PATCH_WRAPPER=$withval
-AC_SUBST(PATCH_WRAPPER)
-
 if test $USE_NLS = no ; then
     AC_MSG_NOTICE([Building without natural language support])
 fi
Index: quilt20081022/Makefile.in
===================================================================
--- quilt20081022.orig/Makefile.in      2008-10-31 15:28:49.259827000 -0500
+++ quilt20081022/Makefile.in   2008-10-31 15:28:57.062831000 -0500
@@ -42,7 +42,6 @@ RPMBUILD :=   @RPMBUILD@
 SENDMAIL :=    @SENDMAIL@
 
 USE_NLS :=     @USE_NLS@
-PATCH_WRAPPER := @PATCH_WRAPPER@
 
 CC :=          @CC@
 CPPFLAGS +=    @CPPFLAGS@ @DEFS@
@@ -73,8 +72,8 @@ DIRT +=               quilt.spec
 BIN_IN :=      quilt guards
 BIN_SRC :=     $(BIN_IN:%=%.in)
 BIN :=         $(BIN_IN)
-SRC +=         $(BIN_SRC:%=bin/%) bin/patch-wrapper.in
-DIRT +=                $(BIN_IN:%=bin/%) bin/patch-wrapper
+SRC +=         $(BIN_SRC:%=bin/%)
+DIRT +=                $(BIN_IN:%=bin/%)
 
 QUILT_IN :=    $(patsubst quilt/%.in,%,$(wildcard quilt/*.in))
 QUILT_SRC :=   $(QUILT_IN:%=%.in)
@@ -154,8 +153,7 @@ endif
        $(MSGMERGE) -o $@ $@ $^
 
 scripts : $(BIN:%=bin/%) $(QUILT:%=quilt/%)                            \
-         $(SCRIPTS:%=quilt/scripts/%) $(LIB:%=lib/%)                   \
-         $(if $(PATCH_WRAPPER),bin/patch-wrapper)
+         $(SCRIPTS:%=quilt/scripts/%) $(LIB:%=lib/%)
 
 dist : clean $(PACKAGE)-$(VERSION).tar.gz
 
@@ -316,11 +314,6 @@ install-main :: scripts
                   $(BUILD_ROOT)$(datadir)/$(PACKAGE)/scripts
        $(INSTALL) -m 644 quilt/scripts/patchfns                        \
                   $(BUILD_ROOT)$(datadir)/$(PACKAGE)/scripts
-ifneq ($(PATCH_WRAPPER),)
-       $(INSTALL) -d $(BUILD_ROOT)$(datadir)/$(PACKAGE)/wrapper
-       $(INSTALL) -m 755 bin/patch-wrapper                             \
-                  $(BUILD_ROOT)$(datadir)/$(PACKAGE)/wrapper/patch
-endif
        
        $(INSTALL) -d $(BUILD_ROOT)$(libdir)/$(PACKAGE)
        $(INSTALL) -m 755 $(LIB:%=lib/%) $(BUILD_ROOT)$(libdir)/$(PACKAGE)/
@@ -381,8 +374,6 @@ ifneq ($(findstring test,$(MAKECMDGOALS)
 -include test/.depend
 endif # (test|check)
 
-test/.patch-wrapper.ok : bin/patch-wrapper
-
 # Include a run-time generated list of dependencies for each test case
 test/.depend : Makefile $(TESTS)
        @(  printf "%s : bin/quilt quilt/scripts/patchfns $(LIB:%=lib/%) 
$(COMPAT)\n" $(TESTS); \
Index: quilt20081022/test/patch-wrapper.test
===================================================================
--- quilt20081022.orig/test/patch-wrapper.test  2008-10-31 15:28:47.661273000 
-0500
+++ /dev/null   1970-01-01 00:00:00.000000000 +0000
@@ -1,74 +0,0 @@
-$ rm -rf d
-$ mkdir -p d/somewhere
-$ cd d
-
-$ cat > foo.orig
-< 1
-<
-< 3
-<
-< 5
-$ sed -e 's/3/3a/' foo.orig > foo
-$ diff -u foo.orig foo > foo.diff
-$ mv foo.orig foo
-
-$ patch-wrapper -s -p0 < foo.diff
-$ quilt pop -q
-> Removing patch patches/foo.diff
-> No patches applied
-$ rm -rf ${QUILT_PATCHES:-patches} ${QUILT_PC:-.pc}
-
-$ patch-wrapper --backup -B xxx/ -s -p0 < foo.diff
-$ find xxx -type f
-> xxx/foo
-$ quilt pop -q
-> Removing patch patches/foo.diff
-> No patches applied
-$ rm -rf ${QUILT_PATCHES:-patches} ${QUILT_PC:-.pc}
-
-$ patch-wrapper -s -p0 -i foo.diff
-$ quilt pop -q
-> Removing patch patches/foo.diff
-> No patches applied
-$ rm -rf ${QUILT_PATCHES:-patches} ${QUILT_PC:-.pc}
-
-$ patch-wrapper -p0 < foo.diff
-> patching file foo
-$ quilt pop -q
-> Removing patch patches/foo.diff
-> No patches applied
-$ rm -rf ${QUILT_PATCHES:-patches} ${QUILT_PC:-.pc}
-
-$ mv foo.diff somewhere/
-$ patch-wrapper -p0 < somewhere/foo.diff
-> patching file foo
-$ quilt pop -q
-> Removing patch patches/somewhere/foo.diff
-> No patches applied
-$ rm -rf ${QUILT_PATCHES:-patches} ${QUILT_PC:-.pc}
-
-$ patch-wrapper -p0 -i somewhere/foo.diff
-> patching file foo
-$ quilt pop -q
-> Removing patch patches/somewhere/foo.diff
-> No patches applied
-$ rm -rf ${QUILT_PATCHES:-patches} ${QUILT_PC:-.pc}
-
-$ sed -e 's/5/5b/' foo > foo.new
-$ mv foo.new foo
-$ patch-wrapper -p0 < somewhere/foo.diff
-> patching file foo
-> Hunk #1 succeeded at 1 with fuzz 1.
-$ cat foo.orig
-> 1
->
-> 3
->
-> 5b
-$ quilt pop -q
-> Removing patch patches/somewhere/foo.diff
-> No patches applied
-$ rm -rf ${QUILT_PATCHES:-patches} ${QUILT_PC:-.pc}
-
-$ cd ..
-$ rm -rf d
Index: quilt20081022/bin/patch-wrapper.in
===================================================================
--- quilt20081022.orig/bin/patch-wrapper.in     2008-10-31 15:28:47.661946000 
-0500
+++ /dev/null   1970-01-01 00:00:00.000000000 +0000
@@ -1,242 +0,0 @@
-#! @BASH@
-
-# This is a wrapper to GNU patch that recognizes the most common
-# options and mimics GNU patch's behavior and output, and creates the
-# quilt metadata as if quilt push was used to apply the patches.  When
-# options are used that this wrapper does not recognize, GNU patch is
-# used directly, and no quilt metadata will get created.
-
address@hidden@
-original_options=("$@")
-
-# GNU patch recognizes these environment variables
-if [ -n "$SIMPLE_BACKUP_SUFFIX" ]
-then
-    set -- --suffix "$SIMPLE_BACKUP_SUFFIX" "$@"
-fi
-if [ -n "$PATCH_VERSION_CONTROL" ]
-then
-    set -- --version-control "$PATCH_VERSION_CONTROL" "$@"
-elif [ -n "$VERSION_CONTROL" ]
-then
-    set -- --version-control "$VERSION_CONTROL" "$@"
-fi
-if [ -n "$POSIXLY_CORRECT" ]
-then
-    set -- --posix "$@"
-fi
-
-backup_files() {
-    declare dir=${QUILT_PC:-.pc}/$patch
-
-    if [ "$backup_mode" = --backup-if-mismatch ]
-    then
-       awk '
-       /^patching file / \
-           { file=$0
-             sub(/^patching file /, "", file)
-           }
-       /^Hunk #[0-9]* / \
-           { if (!(file in backup)) {
-               backup[file] = 1
-               #print "ln -f "dir"/"file" "prefix file suffix > "/dev/stderr"
-               system("ln -f "dir"/"file" "prefix file suffix)
-             }
-           }
-           { if (!silent)
-               print
-           }
-       ' dir="${dir//\\/\\\\}" \
-         prefix="${opt_prefix//\\/\\\\}" \
-         suffix="${opt_suffix//\\/\\\\}" \
-         silent="${opt_silent:+1}"
-    elif [ -n "$opt_silent" ]; then
-       cat > /dev/null
-    fi
-    if [ "$backup_mode" = --backup -a -d "$dir" ]
-    then
-       for file in $(find "$dir" -type f -a ! -path "$path/.timestamp")
-       do
-           dest=$opt_prefix${file#$dir/}$opt_suffix
-           mkdir -p $(dirname "$dest")
-           ln -f $file $dest
-       done
-    fi
-}
-
-find_pipe_patch() {
-    declare patch=$1
-    patch=${patch//\[/\\[}
-    patch=${patch//\]/\\]}
-    set -- $(stat -c $'%a %N\n' /proc/*/fd/* 2>/dev/null \
-            | sed -nre "s,^300 \`(/proc/.*/fd)/.*' -> \`$patch'$,\\1,p")
-    set -- $(stat -c $'%a %N\n' $1/* 2>/dev/null \
-            | sed -nre "s,^500 \`.*' -> \`(.*)',\\1,p")
-    [ $# -eq 1 ] || set -- "$patch"
-    echo "$1"
-}
-
-options=`getopt -q -o bsB:z:i:p:d: \
-                  --long quiet,silent,backup,backup-if-mismatch \
-                  --long no-backup-if-mismatch,prefix: \
-                  --long suffix:,posix,input:,strip:,directory: -- "$@"`
-if [ $? -ne 0 ]
-then
-    cannot_handle=1
-else
-       case "${LC_ALL:-${LC_MESSAGES:-${LANG}}}" in
-       ''|C|POSIX|en*)
-               ;;
-       *)      cannot_handle=1
-               ;;
-       esac
-fi
-if [ -z "$cannot_handle" ]; then
-    eval set -- "$options"
-
-    backup_mode=--backup-if-mismatch
-    opt_prefix=
-    opt_suffix=
-    opt_silent=
-    opt_input=
-    opt_strip=
-    opt_directory=$PWD
-
-    while :
-    do
-       case "$1" in
-       -b|--backup)
-           backup_mode=--backup
-           ;;
-       --backup-if-mismatch)
-           backup_mode=--backup-if-mismatch
-           ;;
-       -d|--directory)
-           cd "$2" || exit 1
-           shift
-           ;;
-       -i|--input)
-           opt_input=$2
-           address@hidden
-           address@hidden
-           shift
-           ;;
-       --no-backup-if-mismatch)
-           backup_mode=--no-backup-if-mismatch
-           ;;
-       -B|--prefix)
-           opt_prefix=$2
-           address@hidden
-           address@hidden
-           shift
-           ;;
-       -s|--silent|--quiet)
-           opt_silent=--silent
-           ;;
-       -p|--strip)
-           opt_strip=-p$2
-           address@hidden
-           shift
-           ;;
-       -z|--suffix)
-           opt_suffix=$2
-           address@hidden
-           address@hidden
-           shift
-           ;;
-       --posix)
-           backup_mode=--no-backup-if-mismatch
-           address@hidden
-           ;;
-       --)
-           shift
-           break
-           ;;
-       *)
-           address@hidden
-           ;;
-       esac
-       shift
-    done
-
-    [ -n "$opt_prefix$opt_suffix" ] || opt_suffix=.orig
-    if [ -z "$opt_strip" -o $# -ne 0 ]
-    then
-       cannot_handle=1
-    fi
-fi
-
-if [ -z "$cannot_handle" ]
-then
-    if [ -n "$opt_input" ]
-    then
-       patch=$opt_input
-    elif [ -e /proc/self/fd/0 ]
-    then
-       patch=$(readlink /proc/self/fd/0)
-       case "$patch" in
-       pipe:*)
-               patch=$(find_pipe_patch "$patch")
-               ;;
-       esac
-    fi
-    patch=${patch#$PWD/}
-
-    if [ ! -e "$patch" ]
-    then
-       cannot_handle=1
-    fi
-fi
-
-if [ -n "$cannot_handle" ]
-then
-    $PATCH "address@hidden"
-    exit
-fi
-
-quilt_patches=${QUILT_PATCHES:-patches}
-dir=$(dirname "$quilt_patches/$patch")
-mkdir -p "$dir"
-if [ -e "$patch" ]
-then
-    if [ "${patch:0:1}" = / ]
-    then
-       ln -s "$patch" "$quilt_patches$patch"
-       patch=${patch#/}
-    else
-       while ! [ "$dir/$updir$patch" -ef "$patch" ]
-       do
-           updir=$updir../
-           [ ${#updir} -gt 96 ] && break
-       done
-       if [ "$dir/$updir$patch" -ef "$patch" ]
-       then
-           ln -s "$updir$patch" "$quilt_patches/$patch"
-       fi
-    fi
-fi
-
-if [ "$opt_strip" = -p1 ]; then
-    echo "$patch"
-else
-    echo "$patch $opt_strip"
-fi >> $quilt_patches/series
-
-$PATCH "address@hidden" --backup --prefix "${QUILT_PC:-.pc}/$patch/" \
-    | backup_files
-status=${PIPESTATUS[0]}
-if [ $status -eq 0 ]
-then
-    dir=${QUILT_PC:-.pc}/$patch
-    if [ ! -e "$dir" ]
-    then
-       mkdir -p "$dir"
-    fi
-    echo -n "" > $dir/.timestamp
-    if [ ! -e ${QUILT_PC:-.pc}/.version ]
-    then
-       echo 2 > ${QUILT_PC:-.pc}/.version
-    fi
-    echo "$patch" >> "${QUILT_PC:-.pc}/applied-patches"
-fi
-exit $status




reply via email to

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