diff options
-rw-r--r-- | Makefile.in | 17 | ||||
-rwxr-xr-x | bin/patch-wrapper.in | 55 | ||||
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | quilt.changes | 7 |
4 files changed, 57 insertions, 29 deletions
diff --git a/Makefile.in b/Makefile.in index 84bd5b8..0230ffc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -40,6 +40,7 @@ RPMBUILD := @RPMBUILD@ SENDMAIL := @SENDMAIL@ USE_NLS := @USE_NLS@ +PATCH_WRAPPER := @PATCH_WRAPPER@ CC := @CC@ CPPFLAGS += @CPPFLAGS@ @DEFS@ @@ -67,11 +68,11 @@ SRC += COPYING AUTHORS TODO Makefile.in configure.ac \ bash_completion quilt.quiltrc aclocal.m4 DIRT += quilt.spec -BIN_IN := quilt guards patch-wrapper +BIN_IN := quilt guards BIN_SRC := $(BIN_IN:%=%.in) BIN := $(BIN_IN) -SRC += $(BIN_SRC:%=bin/%) -DIRT += $(BIN_IN:%=bin/%) +SRC += $(BIN_SRC:%=bin/%) bin/patch-wrapper.in +DIRT += $(BIN_IN:%=bin/%) bin/patch-wrapper QUILT_IN := $(patsubst quilt/%.in,%,$(wildcard quilt/*.in)) QUILT_SRC := $(QUILT_IN:%=%.in) @@ -148,7 +149,8 @@ endif $(MSGMERGE) -o $@ $@ $^ scripts : $(BIN:%=bin/%) $(QUILT:%=quilt/%) \ - $(SCRIPTS:%=quilt/scripts/%) $(LIB:%=lib/%) + $(SCRIPTS:%=quilt/scripts/%) $(LIB:%=lib/%) \ + $(if $(PATCH_WRAPPER),bin/patch-wrapper) dist : clean $(PACKAGE)-$(VERSION).tar.gz @@ -308,7 +310,12 @@ 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 644 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)/ diff --git a/bin/patch-wrapper.in b/bin/patch-wrapper.in index 5f2f107..caa600f 100755 --- a/bin/patch-wrapper.in +++ b/bin/patch-wrapper.in @@ -64,6 +64,18 @@ backup_files() { 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: \ @@ -149,17 +161,26 @@ else fi 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" -} +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) + if [[ "$patch" =~ "^pipe:" ]] + then + patch=$(find_pipe_patch "$patch") + fi + fi + patch=${patch#$PWD/} + + if [ ! -e "$patch" ] + then + cannot_handle=1 + fi +fi if [ -n "$cannot_handle" ] then @@ -167,18 +188,6 @@ then exit fi -if [ -n "$opt_input" ] -then - patch=$opt_input -else - patch=$(readlink /proc/self/fd/0) - if [[ "$patch" =~ "^pipe:" ]] - then - patch=$(find_pipe_patch "$patch") - fi -fi -patch=${patch#$PWD/} - quilt_patches=${QUILT_PATCHES:-patches} dir=$(dirname "$quilt_patches/$patch") mkdir -p "$dir" diff --git a/configure.ac b/configure.ac index 4f52a8e..accdb80 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.43],[quilt-dev@nongnu.org]) AC_CONFIG_AUX_DIR(config) AC_PREREQ(2.53) -AC_REVISION ($Revision: 1.73 $) +AC_REVISION ($Revision: 1.74 $) PACKAGE_RELEASE=1 AC_SUBST(PACKAGE_RELEASE) @@ -341,6 +341,11 @@ You can download GNU Gettext from ftp.gnu.org ]) 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 diff --git a/quilt.changes b/quilt.changes index f2746bc..78a3e8d 100644 --- a/quilt.changes +++ b/quilt.changes @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Feb 6 12:39:43 CET 2006 - agruen@suse.de + +- Add --with-patch-wrapper configure argument, and optionally + install the wrapper as /usr/share/quilt/wrapper/patch. +- bin/patch-wrapper.in: Minor cleanups. + +------------------------------------------------------------------- Mon Feb 6 06:26:59 CET 2006 - agruen@suse.de - bin/patch-wrapper.in: Add hack to follow pipes via /proc on |