summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2005-09-17 23:56:07 +0000
committerAndreas Gruenbacher <agruen@suse.de>2005-09-17 23:56:07 +0000
commit2d3a503aa8651215e7bb939b995c33356bbce913 (patch)
tree87e9f0b8121e6e93e3e79af47f6fc8a471c17e38
parenta267b29dbe851b647643d2026cf39de85c5b11f4 (diff)
downloadquilt-2d3a503aa8651215e7bb939b995c33356bbce913.tar.gz
- Merge compatibility layer from John Vandenberg <jayvdb@gmail.com>.
-rw-r--r--Makefile.in59
-rw-r--r--bin/quilt.in9
-rw-r--r--configure.ac125
-rw-r--r--po/de.po12
-rw-r--r--po/fr.po12
-rw-r--r--po/ja.po12
-rw-r--r--po/quilt.pot12
-rw-r--r--quilt.changes5
-rw-r--r--scripts/patchfns.in40
9 files changed, 134 insertions, 152 deletions
diff --git a/Makefile.in b/Makefile.in
index 584b8a7..7e1d136 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -15,11 +15,16 @@ etcdir := $(subst /usr/etc,/etc,$(prefix)/etc)
QUILT_DIR = $(datadir)/$(PACKAGE)
SCRIPTS_DIR = $(QUILT_DIR)/scripts
+COMPAT_DIR = $(QUILT_DIR)/compat
LIB_DIR = $(libdir)/$(PACKAGE)
INSTALL := @INSTALL@
+POD2MAN := @POD2MAN@
+COLUMN := @COLUMN@
+GETOPT := @GETOPT@
PERL := @PERL@
BASH := @BASH@
+GREP := @GREP@
SED := @SED@
AWK := @AWK@
DIFF := @DIFF@
@@ -30,6 +35,27 @@ DIFFSTAT := @DIFFSTAT@
RPMBUILD := @RPMBUILD@
MTA := @MTA@
+COMPAT_SYMLINKS := @COMPAT_SYMLINKS@
+COMPAT_FUNCTIONS := @COMPAT_FUNCTIONS@
+COMPAT_PROGRAMS := @COMPAT_PROGRAMS@
+
+default: all
+
+define COMPAT_SYMLINK_install
+install-compat-symlink-$(strip $(1)):
+ ln -sf $($(shell echo $(1)| $(AWK) '{print toupper($$1)}')) $(COMPAT_DIR)/$(strip $(1))
+endef
+
+$(foreach symlink, $(COMPAT_SYMLINKS), $(eval $(call COMPAT_SYMLINK_install, $(symlink))))
+
+install-compat-symlinks: $(COMPAT_SYMLINKS:%=install-compat-symlink-%)
+
+define COMPAT_SYMLINK_redefine
+$(shell echo $(1) | $(AWK) '{print toupper($$0)}') := $(1)
+endef
+
+$(foreach symlink, $(COMPAT_SYMLINKS), $(eval $(call COMPAT_SYMLINK_redefine, $(symlink))))
+
ifeq "$(MSGFMT)" ""
MAKE_NLS := @true
else
@@ -69,10 +95,12 @@ DIRT += $(QUILT_IN:%=quilt/%)
SCRIPTS_IN := patchfns parse-patch inspect dependency-graph edmail \
remove-trailing-ws
+
+COMPAT := $(COMPAT_PROGRAMS:%=compat/%) $(COMPAT_FUNCTIONS:%=compat/%)
SCRIPTS_SRC := $(SCRIPTS_IN:%=%.in)
SCRIPTS := $(SCRIPTS_IN)
-SRC += $(SCRIPTS_SRC:%=scripts/%)
-DIRT += $(SCRIPTS_IN:%=scripts/%)
+SRC += $(SCRIPTS_SRC:%=scripts/%) $(COMPAT_PROGRAMS:%=compat/%.in)
+DIRT += $(SCRIPTS_IN:%=scripts/%) $(COMPAT) compat/compatfns
LIB_SRC := backup-files.c
LIB := backup-files$(EXEEXT)
@@ -112,7 +140,12 @@ all : scripts
$(LIB:%=lib/%) : $(LIB_SRC:%.c=lib/%.o)
$(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
-scripts : $(BIN:%=bin/%) $(QUILT:%=quilt/%) $(SCRIPTS:%=scripts/%) \
+compat : $(COMPAT)
+ifneq ($(COMPAT_FUNCTIONS),)
+ cat $(COMPAT_FUNCTIONS:%=compat/%) > compat/compatfns
+endif
+
+scripts : $(BIN:%=bin/%) $(QUILT:%=quilt/%) $(SCRIPTS:%=scripts/%) compat \
$(LIB:%=lib/%) $(DOC:%=doc/%) $(MAN1)
dist : clean $(PACKAGE)-$(VERSION).tar.gz
@@ -135,7 +168,7 @@ doc/README : doc/README.in $(QUILT:%=quilt/%)
esac ; \
done 2>&1 < $< > $@
-doc/quilt.1: doc/quilt.1.in $(QUILT:%=quilt/%)
+doc/quilt.1: doc/quilt.1.in $(QUILT:%=quilt/%) $(COMPAT)
@echo "quilt.1.in -> quilt.1"
@here=`pwd`; \
while read line; do \
@@ -178,7 +211,7 @@ reference : $(QUILT:%=quilt/%) scripts/patchfns
bin/guards.1 : bin/guards
mkdir -p `dirname $@`
- pod2man $< > $@
+ $(POD2MAN) $< > $@
$(PACKAGE)-$(VERSION).tar.gz : $(SRC) configure $(PACKAGE).spec
rm -f $(PACKAGE)-$(VERSION) $@
@@ -232,7 +265,7 @@ Makefile : Makefile.in
@echo "Please run ./configure by hand"
@false
-install : scripts
+install-main: scripts
@INSTALL@ -d $(BUILD_ROOT)$(bindir)
@INSTALL@ -m 755 $(BIN:%=bin/%) $(BUILD_ROOT)$(bindir)/
@@ -265,6 +298,20 @@ install : scripts
@INSTALL@ -m 644 bash_completion $(BUILD_ROOT)$(etcdir)/bash_completion.d/quilt
@INSTALL@ -m 644 quilt.quiltrc $(BUILD_ROOT)$(etcdir)/
+install-compat:
+ifneq ($(COMPAT_PROGRAMS)$(COMPAT_FUNCTIONS)$(COMPAT_SYMLINKS),)
+ @INSTALL@ -d $(BUILD_ROOT)$(COMPAT_DIR)
+ @rm -f $(BUILD_ROOT)$(COMPAT_DIR)/*
+ifneq ($(COMPAT_PROGRAMS),)
+ @INSTALL@ -m 755 $(COMPAT_PROGRAMS:%=compat/%) $(BUILD_ROOT)$(COMPAT_DIR)
+endif
+ifneq ($(COMPAT_FUNCTIONS),)
+ @INSTALL@ -m 644 compat/compatfns $(BUILD_ROOT)$(COMPAT_DIR)
+endif
+endif
+
+install: scripts install-main install-compat $(COMPAT_SYMLINKS:%=install-compat-symlink-%)
+
uninstall:
rm -rf $(BIN:%=$(BUILD_ROOT)$(bindir)/%) \
$(BUILD_ROOT)$(LIB_DIR) \
diff --git a/bin/quilt.in b/bin/quilt.in
index 34361da..600270b 100644
--- a/bin/quilt.in
+++ b/bin/quilt.in
@@ -17,6 +17,15 @@ then
export QUILTRC
fi
+# Support compatibility layer
+if [ -r @QUILT@/compat/compatfns ]
+then
+ source @QUILT@/compat/compatfns
+fi
+
+
+export PATH="@QUILT@/compat:$PATH"
+
usage()
{
diff --git a/configure.ac b/configure.ac
index 3537eff..2d71f58 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.42],[quilt-dev@nongnu.org])
AC_CONFIG_AUX_DIR(config)
AC_PREREQ(2.53)
-AC_REVISION ($Revision: 1.41 $)
+AC_REVISION ($Revision: 1.42 $)
PACKAGE_RELEASE=1
AC_SUBST(PACKAGE_RELEASE)
@@ -36,18 +36,8 @@ fi
dnl Check for Bourne-Again Shell
unset BASH # bash sets this itself!
-AC_ARG_WITH(bash, AC_HELP_STRING(
- [--with-bash], [name of the bash executable to use]),
- [
- BASH="$withval"
- AC_SUBST(BASH)
- AC_MSG_NOTICE([Using bash executable $BASH])
- ],[
- AC_PATH_PROG(BASH, bash)
- ])
-if test -z "$BASH" ; then
- AC_MSG_ERROR([Please specify the location of bash with the option '--with-bash'])
-fi
+
+QUILT_COMPAT_PROG_PATH(BASH, bash)
# It would be nice not to have to use backticks, but too many retarded sh
# implementations still don't support $( )
@@ -64,62 +54,38 @@ version of bash from ftp.gnu.org
fi
dnl Check for Perl
-AC_ARG_WITH(perl, AC_HELP_STRING(
- [--with-perl], [name of the Perl executable to use]),
- [
- PERL="$withval"
- AC_SUBST(PERL)
- AC_MSG_NOTICE([Using Perl executable $PERL])
- ],[
- AC_PATH_PROGS(PERL, [perl perl5])
- ])
-if test -z "$PERL" ; then
- AC_MSG_ERROR([Please specify the location of Perl with the option '--with-perl'])
-fi
-
+QUILT_COMPAT_PROG_PATH(PERL, perl, [perl perl5])
+QUILT_COMPAT_PROG_PATH(GREP, grep)
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)
- ])
-
+QUILT_COMPAT_PROG_PATH(SED, 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 "$AWK" ; then
- AC_MSG_ERROR([Please specify the location of awk with the option '--with-awk'])
+QUILT_COMPAT_PROG_PATH(AWK, awk, [gawk awk])
+
+QUILT_COMPAT_PROG_PATH(POD2MAN, pod2man)
+QUILT_COMPAT_PROG_PATH(COLUMN, column)
+QUILT_COMPAT_PROG_PATH(GETOPT, getopt)
+
+if test -n "$GETOPT"; then
+ AC_MSG_CHECKING(for getopt --long syntax)
+ dnl check GNU syntax
+ $GETOPT -o t --long test -- --test | grep -q 'illegal option'
+ getopt_long_errors=$?
+ $GETOPT -o t --long test -- --test | grep -qe '^ *--test *--'
+ getopt_long_works=$?
+ if test $getopt_long_errors -eq 1 -a $getopt_long_works -eq 0; then
+ getopt_long_syntax=yes
+ AC_MSG_RESULT(yes)
+ else
+ getopt_long_syntax=no
+ AC_MSG_WARN(no)
+ GETOPT=''
+ fi
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'
- to use a quilt internal mechanism)]),
- [
- MKTEMP="$withval"
- AC_SUBST(MKTEMP)
- AC_MSG_NOTICE([Using mktemp executable $MKTEMP])
- ],[
- AC_PATH_PROG(MKTEMP, mktemp)
- ])
-if test -z "$MKTEMP" -o "$MKTEMP" = "none" ; then
- MKTEMP=internal_mktemp
-else
+QUILT_COMPAT_PROG_PATH(MKTEMP, mktemp)
+
+if test -n "$MKTEMP" ; then
AC_MSG_CHECKING(whether $MKTEMP -d works)
if tempdir=`$MKTEMP -d /tmp/$PACKAGE_NAME.XXXXXX 2>/dev/null` && \
rmdir "$tempdir" ; then
@@ -136,32 +102,9 @@ internal tempfile generation mechanism.
fi
dnl Check for diff
-AC_ARG_WITH(diff, AC_HELP_STRING(
- [--with-diff], [name of the diff executable to use]),
- [
- DIFF="$withval"
- AC_SUBST(DIFF)
- AC_MSG_NOTICE([Using diff executable $DIFF])
- ],[
- AC_PATH_PROG(DIFF, diff)
- ])
-if test -z "$DIFF"; then
- AC_MSG_ERROR([Please specify the location of diff with the option '--with-diff'])
-fi
-
+QUILT_COMPAT_PROG_PATH(DIFF, diff)
dnl Check for patch
-AC_ARG_WITH(patch, AC_HELP_STRING(
- [--with-patch], [name of the patch executable to use]),
- [
- PATCH="$withval"
- AC_SUBST(PATCH)
- AC_MSG_NOTICE([Using patch executable $PATCH])
- ],[
- AC_PATH_PROG(PATCH, patch)
- ])
-if test -z "$PATCH"; then
- AC_MSG_ERROR([Please specify the location of patch with the option '--with-patch'])
-fi
+QUILT_COMPAT_PROG_PATH(PATCH, patch)
# Sun's patch is a mess, issue a warning. But we are going to continue with
# the build because you might just be lucky.
@@ -283,6 +226,10 @@ dnl Check for rpmbuild (v4) vs. rpm (v3)
AC_PATH_PROGS(RPMBUILD, [rpmbuild rpm])
AC_SUBST(RPMBUILD)
+AC_SUBST(COMPAT_SYMLINKS)
+AC_SUBST(COMPAT_PROGRAMS)
+AC_SUBST(COMPAT_FUNCTIONS)
+
AC_CONFIG_FILES(Makefile)
AC_OUTPUT
diff --git a/po/de.po b/po/de.po
index ce1044f..728b867 100644
--- a/po/de.po
+++ b/po/de.po
@@ -14,19 +14,19 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.10\n"
-#: bin/quilt.in:23
+#: bin/quilt.in:33
msgid "Usage: quilt [--trace[=verbose]] [--quiltrc=XX] command [-h] ..."
msgstr "Verwendung: quilt [--trace[=verbose]] [--quiltrc=XX] befehl [-h] ..."
-#: bin/quilt.in:24
+#: bin/quilt.in:34
msgid " quilt --version"
msgstr " quilt --version"
-#: bin/quilt.in:26
+#: bin/quilt.in:36
msgid "Commands are:"
msgstr "Vorhandene Befehle:"
-#: bin/quilt.in:31
+#: bin/quilt.in:41
msgid ""
"\n"
"Global options:\n"
@@ -1374,7 +1374,7 @@ msgstr "Datei %s ist verschwunden\n"
msgid "Failed to rename %s to %s: %s\n"
msgstr "Konnte %s nicht auf %s umbenennen: %s\n"
-#: scripts/patchfns.in:727
+#: scripts/patchfns.in:704
msgid ""
"The quilt meta-data in this tree has version %s, but this version of quilt "
"can only handle meta-data formats up to and including version %s. Please pop "
@@ -1387,7 +1387,7 @@ msgstr ""
"quilt alle Patches mit der Version von quilt, die zur Erstellung des "
"Arbeitsverzeichnisses verwendet wurde.\\n"
-#: scripts/patchfns.in:812
+#: scripts/patchfns.in:789
msgid ""
"The working tree was created by an older version of quilt. Please run 'quilt "
"upgrade'.\\n"
diff --git a/po/fr.po b/po/fr.po
index 2d04b79..6394fd7 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -13,19 +13,19 @@ msgstr ""
"Content-Type: text/plain; charset=ISO-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
-#: bin/quilt.in:23
+#: bin/quilt.in:33
msgid "Usage: quilt [--trace[=verbose]] [--quiltrc=XX] command [-h] ..."
msgstr "Usage : quilt [--trace[=verbose]] [--quiltrc=XX] commande [-h] ..."
-#: bin/quilt.in:24
+#: bin/quilt.in:34
msgid " quilt --version"
msgstr " quilt --version"
-#: bin/quilt.in:26
+#: bin/quilt.in:36
msgid "Commands are:"
msgstr "Les commandes sont :"
-#: bin/quilt.in:31
+#: bin/quilt.in:41
msgid ""
"\n"
"Global options:\n"
@@ -1390,7 +1390,7 @@ msgstr "Le fichier %s a disparu !\n"
msgid "Failed to rename %s to %s: %s\n"
msgstr "Impossible de renommer %s en %s : %s\n"
-#: scripts/patchfns.in:727
+#: scripts/patchfns.in:704
msgid ""
"The quilt meta-data in this tree has version %s, but this version of quilt "
"can only handle meta-data formats up to and including version %s. Please pop "
@@ -1402,7 +1402,7 @@ msgstr ""
"format %s (inclus). Veuillez retirer vos patches avec la version \n"
"utilisée pour les appliquer avant d'installer une version plus ancienne.\\n"
-#: scripts/patchfns.in:812
+#: scripts/patchfns.in:789
msgid ""
"The working tree was created by an older version of quilt. Please run 'quilt "
"upgrade'.\\n"
diff --git a/po/ja.po b/po/ja.po
index 1eee811..b8c2d4f 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -12,19 +12,19 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: bin/quilt.in:23
+#: bin/quilt.in:33
msgid "Usage: quilt [--trace[=verbose]] [--quiltrc=XX] command [-h] ..."
msgstr "使ã„æ–¹: quilt [--trace[=verbose]] [--quiltrc=XX] command [-h] ..."
-#: bin/quilt.in:24
+#: bin/quilt.in:34
msgid " quilt --version"
msgstr " quilt --version"
-#: bin/quilt.in:26
+#: bin/quilt.in:36
msgid "Commands are:"
msgstr "コマンド一覧:"
-#: bin/quilt.in:31
+#: bin/quilt.in:41
msgid ""
"\n"
"Global options:\n"
@@ -1351,7 +1351,7 @@ msgstr "ファイル %s ãŒæ¶ˆãˆã¾ã—ãŸ!\n"
msgid "Failed to rename %s to %s: %s\n"
msgstr "パッム%s ã‹ã‚‰ %sã¸ã®åå‰ã®å¤‰æ›´ã«å¤±æ•—ã—ã¾ã—ãŸ: %s\n"
-#: scripts/patchfns.in:727
+#: scripts/patchfns.in:704
msgid ""
"The quilt meta-data in this tree has version %s, but this version of quilt "
"can only handle meta-data formats up to and including version %s. Please pop "
@@ -1363,7 +1363,7 @@ msgstr ""
"ã¦ã„ã¾ã›ã‚“。ダウングレードã™ã‚‹å‰ã«ã€pushã—ãŸãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® quiltを使ã£ã¦ã€\n"
"ã™ã¹ã¦ã®ãƒ‘ッãƒã‚’ pop ã—ã¦ãã ã•ã„。\\n"
-#: scripts/patchfns.in:812
+#: scripts/patchfns.in:789
msgid ""
"The working tree was created by an older version of quilt. Please run 'quilt "
"upgrade'.\\n"
diff --git a/po/quilt.pot b/po/quilt.pot
index 6918748..08685b9 100644
--- a/po/quilt.pot
+++ b/po/quilt.pot
@@ -1,16 +1,16 @@
-#: bin/quilt.in:23
+#: bin/quilt.in:33
msgid "Usage: quilt [--trace[=verbose]] [--quiltrc=XX] command [-h] ..."
msgstr ""
-#: bin/quilt.in:24
+#: bin/quilt.in:34
msgid " quilt --version"
msgstr ""
-#: bin/quilt.in:26
+#: bin/quilt.in:36
msgid "Commands are:"
msgstr ""
-#: bin/quilt.in:31
+#: bin/quilt.in:41
msgid ""
"\n"
"Global options:\n"
@@ -969,7 +969,7 @@ msgstr ""
msgid "Failed to rename %s to %s: %s\n"
msgstr ""
-#: scripts/patchfns.in:727
+#: scripts/patchfns.in:704
msgid ""
"The quilt meta-data in this tree has version %s, but this version of quilt "
"can only handle meta-data formats up to and including version %s. Please pop "
@@ -977,7 +977,7 @@ msgid ""
"downgrading.\\n"
msgstr ""
-#: scripts/patchfns.in:812
+#: scripts/patchfns.in:789
msgid ""
"The working tree was created by an older version of quilt. Please run 'quilt "
"upgrade'.\\n"
diff --git a/quilt.changes b/quilt.changes
index 840fdf2..32be7d2 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Sun Sep 18 01:56:03 CEST 2005 - agruen@suse.de
+
+- Merge compatibility layer from John Vandenberg <jayvdb@gmail.com>.
+
+-------------------------------------------------------------------
Fri Sep 16 20:57:32 CEST 2005 - khali@linux-fr.org
- configure.ac: Fix a copy-n-paste bug which was causing perl to
diff --git a/scripts/patchfns.in b/scripts/patchfns.in
index 89fd216..2e0b9b0 100644
--- a/scripts/patchfns.in
+++ b/scripts/patchfns.in
@@ -23,6 +23,13 @@ DB_VERSION=2
: ${QUILT_PATCHES:=patches}
: ${QUILT_PC:=.pc}
+# Support compatibility layer
+if [ -r @QUILT@/compat/compatfns ]
+then
+ source @QUILT@/compat/compatfns
+fi
+
+export PATH="@QUILT@/compat:$PATH"
unset CDPATH
shopt -s dotglob
@@ -644,39 +651,6 @@ in_array()
gen_tempfile()
{
- # This is a substitute for the mktemp executable.
- internal_mktemp()
- {
- local try n
- if [ x"$1" = x"-d" ]
- then
- for ((n=0 ; $n<100 ; n++))
- do
- try=${2%XXXXXX}$RANDOM
- mkdir -m 700 $try 2>/dev/null \
- && break
- done
- else
- local user_mask=$(umask)
- umask 077
- set -o noclobber
- for ((n=0 ; $n<100 ; n++))
- do
- try=${1%XXXXXX}$RANDOM
- echo -n "" 2> /dev/null > $try \
- && break
- done
- set +o noclobber
- umask $user_mask
- fi
- if [ $n -lt 100 ]
- then
- echo $try
- else
- return 1
- fi
- }
-
local name
if [ "$1" = -d ]
then