summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2005-09-18 08:13:07 +0000
committerAndreas Gruenbacher <agruen@suse.de>2005-09-18 08:13:07 +0000
commite9a3bc5476ec8e98e01fb4423577b42a09890d15 (patch)
treefc2062f327a56b3055fd792c0a869099c2d2bf10
parentba3107e66e526602a6fb08d451a82850bcba19f4 (diff)
downloadquilt-e9a3bc5476ec8e98e01fb4423577b42a09890d15.tar.gz
- Forgot to add new files to the repository.
-rw-r--r--aclocal.m431
-rw-r--r--compat/column.in3
-rw-r--r--compat/getopt.in98
-rw-r--r--compat/mktemp.in27
-rw-r--r--quilt.changes5
5 files changed, 164 insertions, 0 deletions
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..38b8852
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,31 @@
+dnl Allow configure to specify a specific binary
+dnl 1: Environment variable
+dnl 2: binary name
+dnl 3: optional list of alternatives
+AC_DEFUN([QUILT_COMPAT_PROG_PATH],[
+ m4_define([internal_$2_cmd],[esyscmd(ls compat/$2.in 2>/dev/null)])
+
+ AC_ARG_WITH($2, AC_HELP_STRING(
+ [--with-$2], [name of the $2 executable to use]
+ m4_if(internal_$2_cmd,[],[],[ (or 'none'
+ to use an internal mechanism)])),
+ [
+ if test ! x"$withval" = xnone; then
+ $1="$withval"
+ AC_MSG_NOTICE([Using $2 executable $$2])
+ COMPAT_SYMLINKS="$COMPAT_SYMLINKS $2"
+ fi
+ ],[
+ AC_PATH_PROG($1, m4_if([$3],[],[$2],[$3]))
+ ])
+ if test -z "$$1"; then
+ m4_if(internal_$2_cmd,[],[
+ AC_MSG_ERROR([Please specify the location of $2 with the option '--with-$2'])
+ ],[
+ AC_MSG_WARN([Using internal $2 mechanism. Use option '--with-$2' to override])
+ COMPAT_PROGRAMS="$COMPAT_PROGRAMS $2"
+ $1=$2
+ ])
+ fi
+ AC_SUBST($1)
+])
diff --git a/compat/column.in b/compat/column.in
new file mode 100644
index 0000000..f56bc32
--- /dev/null
+++ b/compat/column.in
@@ -0,0 +1,3 @@
+#! @BASH@
+
+cat
diff --git a/compat/getopt.in b/compat/getopt.in
new file mode 100644
index 0000000..d66bb5c
--- /dev/null
+++ b/compat/getopt.in
@@ -0,0 +1,98 @@
+#! @PERL@ -w
+
+# This script is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# See the COPYING and AUTHORS files for more details.
+
+use strict;
+
+my ($opts,$args) = split(/ -- /, join(' ',@ARGV));
+
+# there is no reason to parse
+# the opts if there are no args.
+if (! $args) {
+ print ' -- ';
+ exit;
+}
+
+my $short_opts = '';
+my @long_opts;
+
+# nothing fancy to see here; this script provides minimal compatibility
+# with the getopt from util-linux until a cross platform binary exists.
+if ($opts =~ /^-o ([a-zA-Z:]*)( --long .*)*/) {
+ $short_opts = $1;
+ if ($2) {
+ my $long_opts = $2;
+ $long_opts =~ s/^\s*--long //g;
+ $long_opts =~ s/ --long /,/g;
+ @long_opts = split(/,/,$long_opts);
+ }
+}
+
+my @words=split(/\s+/,$args);
+
+my @barewords;
+my @options;
+
+# set the the previous option name when a param is required
+my $need_param;
+
+foreach my $word (@words) {
+ # allow '-' to be an option value
+ if (!$need_param && $word !~ /^-./) {
+ push @barewords, $word;
+ next;
+ }
+ if ($need_param) {
+ die "expecting param for $need_param" if $word =~ /^-./;
+ push @options, $word;
+ $need_param = undef;
+ next;
+ }
+ # process short options
+ if ($word =~ s/^-([^-])/$1/) {
+ my @letters = reverse(split(//,$word));
+ while (@letters) {
+ my $letter = pop @letters;
+ my $found = grep(/$letter/, $short_opts);
+ push @options, '-'.$letter;
+ die "illegal option: $letter" if !$found;
+ if (grep(/$letter:/, $short_opts)) {
+ if (scalar(@letters) == 0) {
+ $need_param = $letter;
+ } else {
+ # short options can have numerical args
+ # embedded in the short option list: -UO
+ die "unexpected character after option $letter"
+ if ($letters[$#letters] !~ /[0-9]/);
+ my @digits;
+ while (scalar(@letters) && ($letters[$#letters] =~ /[0-9]/)) {
+ push @digits, pop @letters;
+ }
+ push @options, join('',reverse @digits);
+ }
+ }
+ }
+ }
+ # process long options
+ if ($word =~ s/^--//) {
+ my $param = '';
+ if ($word =~ /(.*)=(.*)/) {
+ $word = $1;
+ $param = $2;
+ }
+ my ($found) = grep(/^$word:?$/,@long_opts);
+ die "illegal option: $word" if !$found;
+ die "$word: unexpected paramater $param" if $found !~ /:$/ && $param ne '';
+
+ $need_param = $word if $found =~ /:$/ && $param eq '';
+ push @options, "--$word";
+ push @options, $param if $param;
+ }
+}
+
+print "@options -- @barewords"
+
diff --git a/compat/mktemp.in b/compat/mktemp.in
new file mode 100644
index 0000000..400b520
--- /dev/null
+++ b/compat/mktemp.in
@@ -0,0 +1,27 @@
+#! @BASH@
+
+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
+ 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
+ exit 1
+fi
diff --git a/quilt.changes b/quilt.changes
index 94c3943..9aa3f64 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Sun Sep 18 10:13:26 CEST 2005 - agruen@suse.de
+
+- Forgot to add new files to the repository.
+
+-------------------------------------------------------------------
Sun Sep 18 02:49:43 CEST 2005 - agruen@suse.de
- Merge compatibility layer from John Vandenberg <jayvdb@gmail.com>.