Punt perl version of wrapper in favor of bash by Gregorio Guidi #66478.
authorMike Frysinger <vapier@gentoo.org>
Sun, 14 Nov 2004 05:32:54 +0000 (05:32 +0000)
committerMike Frysinger <vapier@gentoo.org>
Sun, 14 Nov 2004 05:32:54 +0000 (05:32 +0000)
sys-devel/automake-wrapper/ChangeLog
sys-devel/automake-wrapper/Manifest
sys-devel/automake-wrapper/automake-wrapper-1.ebuild
sys-devel/automake-wrapper/files/am-wrapper-1.pl [deleted file]
sys-devel/automake-wrapper/files/am-wrapper-1.sh [new file with mode: 0644]
sys-devel/automake/Manifest

index 1826772640708f5e72f8e847f4714b7a7fa4b3c2..8b4460cf15ba931f114bff3e4cc0a0168b947dff 100644 (file)
@@ -1,6 +1,10 @@
 # ChangeLog for sys-devel/automake-wrapper
 # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/automake-wrapper/ChangeLog,v 1.1 2004/10/22 23:45:23 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/automake-wrapper/ChangeLog,v 1.2 2004/11/14 05:32:54 vapier Exp $
+
+  14 Nov 2004; Mike Frysinger <vapier@gentoo.org> -files/am-wrapper-1.pl,
+  +files/am-wrapper-1.sh, automake-wrapper-1.ebuild:
+  Punt perl version of wrapper in favor of bash by Gregorio Guidi #66478.
 
 *automake-wrapper-1 (22 Oct 2004)
 
index 14a2b01cb397bebf2c5b3d8e381d4bbfe429b1af..11e9d865de6df3f9503b66c2d5bf0c1d0ab0336e 100644 (file)
@@ -1,15 +1,15 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-MD5 7a3c9c16025c5595e83740e223e8387e automake-wrapper-1.ebuild 748
-MD5 cb9eb7b03089e2dffedc3c7d837ac669 ChangeLog 382
+MD5 0dfe60f44a425d88456e93514bb89ac4 automake-wrapper-1.ebuild 752
+MD5 e35adb9d986d73a30339f4f5fcea3c5c ChangeLog 584
 MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
-MD5 b2616b03dfd3516a4cc52c4b769e6b96 files/am-wrapper-1.pl 5721
 MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-automake-wrapper-1 0
+MD5 a0eb4365a8a82a24c28dcbcd579044a2 files/am-wrapper-1.sh 3133
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.9.10 (GNU/Linux)
 
-iD8DBQFBeZu0HTu7gpaalycRAvi4AKD29WT5sJ4VIwytiNpLi6Hfn1tlswCgjWiW
-XEkfEtp82Ui8xsmOHC7Eewk=
-=J7GK
+iD8DBQFBlu41HTu7gpaalycRAmDJAJ0Yo2tw3HoFEQdNwiVbarSqsMex1QCg7Ra6
+FOy5QpASUe1Tt+vO4houIxI=
+=LcrJ
 -----END PGP SIGNATURE-----
index 49ad375a42fabb3a2e9075ab1f210463751cbe76..4c1b92a298c56b53a3d1d1c4cd3e4636e8bc5f85 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/automake-wrapper/automake-wrapper-1.ebuild,v 1.1 2004/10/22 23:45:23 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/automake-wrapper/automake-wrapper-1.ebuild,v 1.2 2004/11/14 05:32:54 vapier Exp $
 
 DESCRIPTION="wrapper for autoconf to manage multiple autoconf versions"
 HOMEPAGE="http://www.gentoo.org/"
@@ -8,7 +8,7 @@ SRC_URI=""
 
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
 IUSE=""
 
 RDEPEND="dev-lang/perl"
@@ -17,13 +17,13 @@ S=${WORKDIR}
 
 src_install() {
        exeinto /usr/lib/misc
-       newexe ${FILESDIR}/am-wrapper-${PV}.pl am-wrapper.pl || die
+       newexe ${FILESDIR}/am-wrapper-${PV}.sh am-wrapper.sh || die
 
        keepdir /usr/share/aclocal
 
        dodir /usr/bin
        local x=
        for x in aclocal automake ; do
-               dosym ../lib/misc/am-wrapper.pl /usr/bin/${x}
+               dosym ../lib/misc/am-wrapper.sh /usr/bin/${x}
        done
 }
diff --git a/sys-devel/automake-wrapper/files/am-wrapper-1.pl b/sys-devel/automake-wrapper/files/am-wrapper-1.pl
deleted file mode 100644 (file)
index 4deff78..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-#!/usr/bin/perl
-#
-#
-# Author: Guillaume Cottenceau (gc@mandrakesoft.com)
-# Modified by: Martin Schlemmer (azarah@gentoo.org)
-#
-# Copyright 2001 MandrakeSoft
-#
-# This software may be freely redistributed under the terms of the GNU
-# public license.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-#
-#
-# Executes the correct autoconf version.
-#
-# - defaults to automake-1.4
-# - runs automake-1.8 if it exists and...
-#   - envvar WANT_AUTOMAKE is set to `1.8'
-#     -or-
-#   - `Makefile.in' was generated by automake-1.8 or superior, which
-#     specifically needs automake-1.8
-#     -or_
-#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.8
-# - runs automake-1.7 if it exists and...
-#   - envvar WANT_AUTOMAKE is set to `1.7'
-#     -or-
-#   - `Makefile.in' was generated by automake-1.7 or superior, which
-#     specifically needs automake-1.7
-#     -or-
-#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifyint the use of 1.7
-#     -or-
-# - runs automake-1.6 if it exists and...
-#   - envvar WANT_AUTOMAKE is set to `1.6'
-#     -or-
-#   - `Makefile.in' was generated by automake-1.6 or superior, which
-#     specifically needs automake-1.6
-#     -or-
-#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifyint the use of 1.6
-#     -or-
-#   - `configure.in' contains AC_PREREQ and the value's 3 first letters
-#      are stringwise greater than '2.53c'
-#     -or-
-#   - `configure' is already present and was generated by autoconf greater than
-#     '2.53c'
-# - runs automake-1.5 if it exists and...
-#   - envvar WANT_AUTOMAKE is set to `1.5'
-#     -or-
-#   - configure.ac is present
-#     -or-
-#   - `configure.in' contains AC_PREREQ and the value's 3 first letters
-#      are stringwise greater than '2.13'
-#     -or-
-#   - `configure' is already present and was generated by autoconf greater than
-#     '2.13'
-#     -or-
-#   - `Makefile.in' was generated by automake-1.5 or superior, which
-#     specifically needs automake-1.5
-#
-#use MDK::Common;
-
-sub cat_ { local *F; open F, $_[0] or return; my @l = <F>; wantarray ? @l : join '', @l }
-sub am_version {
-       my $file = cat_(shift);
-       return (@versions = $file =~ /^\s*\[?AM_AUTOMAKE_VERSION\(\[?([^\)]{3}[0-9]?)[^\)]*\]?\)/mg) ? ((sort @versions)[-1]) : '';
-}
-sub ac_version {
-       my $file = cat_(shift);
-       return (@versions = $file =~ /^\s*\[?AC_PREREQ\(\[?([^\)]{3}[0-9]?)[^\)]*\]?\)/mg) ? ((sort @versions)[-1]) : '';
-}
-
-
-
-my $binary      = "$0-1.4";
-my $binary_1_5  = "$0-1.5";
-my $binary_1_6  = "$0-1.6";
-my $binary_1_7  = "$0-1.7";
-my $binary_1_8  = "$0-1.8";
-
-# question here is do we really want 1.5 or 1.6?  Out of a KDE outlook, it
-# should rather be 1.5, and since most people would rather have migrated to
-# 1.5, and then stay with it for a bit (those 1.4 die hards ..), only have
-# the 'configure.ac' test for 1.5 ...
-if ($ENV{WANT_AUTOMAKE} ne '1.4') {
-       if (-x $binary_1_8              # user may not have _1_8 ...
-       && (($ENV{WANT_AUTOMAKE} eq '1.8')
-           || (cat_('Makefile.in') =~ /^# Makefile\.in generated by automake (\S+)/ ? $1 : '') ge '1.8'
-           || (cat_('aclocal.m4') =~ /^# aclocal.m4 generated automatically by aclocal (\S+)/ ? $1 : '') ge '1.8'
-           || am_version('aclocal.m4') ge '1.8')) {
-       $ENV{WANT_AUTOMAKE} = '1.8';    # to prevent further "cats" and to enhance consistency (possible cwd etc)
-       $binary         = $binary_1_8;
-        } elsif (-x $binary_1_7         # user may not have 1.7 ...
-       && (($ENV{WANT_AUTOMAKE} eq '1.7')
-           || (cat_('Makefile.in') =~ /^# Makefile\.in generated by automake (\S+)/ ? $1 : '') ge '1.7'
-           || (cat_('aclocal.m4') =~ /^# aclocal.m4 generated automatically by aclocal (\S+)/ ? $1 : '') ge '1.7'
-           || am_version('aclocal.m4') ge '1.7')) {
-       $ENV{WANT_AUTOMAKE} = '1.7';    # to prevent further "cats" and to enhance consistency (possible cwd etc)
-       $binary         = $binary_1_7;
-       } elsif (-x $binary_1_6         # user may not have 1.6 ...
-       && (($ENV{WANT_AUTOMAKE} eq '1.6')
-           || (cat_('Makefile.in') =~ /^# Makefile\.in generated by automake (\S+)/ ? $1 : '') ge '1.6'
-           || (cat_('aclocal.m4') =~ /^# aclocal.m4 generated automatically by aclocal (\S+)/ ? $1 : '') ge '1.6'
-           || am_version('aclocal.m4') ge '1.6'
-               # Autoconf 2.53d and later need automake-1.6c, so enable 1.6 for 2.53
-               # and up .....
-           || ac_version('configure.in') gt '2.52'
-           || (cat_('configure') =~ /^# Generated by Autoconf (\S+)/m ? $1 : '') gt '2.52'
-           || ac_version('aclocal.m4') gt '2.52')) {
-       $ENV{WANT_AUTOMAKE} = '1.6';    # to prevent further "cats" and to enhance consistency (possible cwd etc)
-       $binary                 = $binary_1_6;
-    } elsif (-x $binary_1_5         # user may have only 1.4 ...
-       && (($ENV{WANT_AUTOMAKE} eq '1.5')
-           || -r 'configure.ac'
-           || (cat_('Makefile.in') =~ /^# Makefile\.in generated by automake (\S+)/ ? $1 : '') ge '1.5'
-           || (cat_('aclocal.m4') =~ /^# aclocal.m4 generated automatically by aclocal (\S+)/ ? $1 : '') ge '1.5'
-           || ac_version('configure.in') gt '2.13'
-           || (cat_('configure') =~ /^# Generated by Autoconf (\S+)/m ? $1 : '') gt '2.13'
-           || ac_version('aclocal.m4') gt '2.13')) {
-       $ENV{WANT_AUTOMAKE} = '1.5';    # to prevent further "cats" and to enhance consistency (possible cwd etc)
-       $binary                 = $binary_1_5;
-    } else {
-       if (-r 'configure.in' || -r 'configure.ac') {
-               $ENV{WANT_AUTOMAKE} = '1.4';    # for further consistency
-       } else {
-               $ENV{WANT_AUTOMAKE} = '1.8';
-               $binary         = $binary_1_8;
-       }
-    }
-}
-
-$ENV{WANT_AMWRAPPER_DEBUG} and print STDERR "am-wrapper: will execute <$binary>\n";
-
-exec $binary, @ARGV;
-
-die "am-wrapper: ouch, couldn't call binary ($binary).\n";
diff --git a/sys-devel/automake-wrapper/files/am-wrapper-1.sh b/sys-devel/automake-wrapper/files/am-wrapper-1.sh
new file mode 100644 (file)
index 0000000..6733f65
--- /dev/null
@@ -0,0 +1,120 @@
+#!/bin/bash
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/automake-wrapper/files/am-wrapper-1.sh,v 1.1 2004/11/14 05:32:54 vapier Exp $
+
+# Based on the am-wrapper.pl script provided by MandrakeSoft
+# Rewritten in bash by Gregorio Guidi
+#
+# Executes the correct automake version.
+#
+# - defaults to automake-1.8
+# - runs automake-1.7 if:
+#   - envvar WANT_AUTOMAKE is set to `1.7'
+#     -or-
+#   - `Makefile.in' was generated by automake-1.7
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.7
+# - runs automake-1.6 if:
+#   - envvar WANT_AUTOMAKE is set to `1.6'
+#     -or-
+#   - `Makefile.in'
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.6
+# - runs automake-1.5 if:
+#   - envvar WANT_AUTOMAKE is set to `1.5'
+#     -or-
+#   - `Makefile.in' was generated by automake-1.5
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.5
+# - runs automake-1.4 if:
+#   - envvar WANT_AUTOMAKE is set to `1.4'
+#     -or-
+#   - `Makefile.in' was generated by automake-1.4
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.4
+
+if [ "${0##*/}" = "am-wrapper.sh" ] ; then
+       echo "Don't call this script directly." >&2
+       exit 1
+fi
+
+vers="$(seq 1.9 -0.1 1.4)"
+
+for v in ${vers} ; do
+       eval binary_${v/./_}="${0}-${v}"
+done
+binary="binary_1_9"
+
+#
+# autodetect routine
+#
+for v in ${vers} x ; do
+       if [ "${v}" = "x" ] ; then
+               unset WANT_AUTOMAKE
+               break
+       fi
+
+       if [ "${WANT_AUTOMAKE}" = "${v}" ] ; then
+               binary="binary_${v/./_}"
+               binary="${!binary}"
+               break
+       fi
+done
+
+do_awk() {
+       local file=$1 ; shift
+       local arg=$1 ; shift
+       echo $(awk "{ if (match(\$0, \"$*\", res)) { print res[${arg}]; exit } }" ${file})
+}
+
+if [ -z "${WANT_AUTOMAKE}" ] ; then
+       if [ -r "Makefile.in" ] ; then
+               confversion_mf=$(do_awk Makefile.in 2 "^# Makefile.in generated (automatically )?by automake ([0-9].[0-9])")
+       fi
+       if [ -r "aclocal.m4" ] ; then
+               confversion_ac=$(do_awk aclocal.m4 1 'generated automatically by aclocal ([0-9].[0-9])')
+               confversion_am=$(do_awk aclocal.m4 1 '[[:space:]]*\\[?AM_AUTOMAKE_VERSION\\(\\[?([0-9].[0-9])[^)]*\\]?\\)')
+       fi
+
+       for v in ${vers} ; do
+               if [ "${confversion_mf}" = "${v}" ] \
+                  || [ "${confversion_ac}" = "${v}" ] \
+                  || [ "${confversion_am}" = "${v}" ] ; then
+                       binary="binary_${v/./_}"
+                       binary="${!binary}"
+                       break
+               fi
+       done
+fi
+
+if [ "${WANT_AMWRAPPER_DEBUG}" ] ; then
+       if [ "${WANT_AUTOMAKE}" ] ; then
+               echo "am-wrapper: DEBUG: WANT_AUTOMAKE is set to ${WANT_AUTOMAKE}" >&2
+       fi
+       echo "am-wrapper: DEBUG: will execute <$binary>" >&2
+fi
+
+#
+# for further consistency
+#
+for v in ${vers} ; do
+       mybin="binary_${v/./_}"
+       if [ "${binary}" = "${!mybin}" ] ; then
+               export WANT_AUTOMAKE="${v}"
+       fi
+done
+
+#
+# Now try to run the binary
+#
+if [ ! -x "${binary}" ] ; then
+       echo "am-wrapper: $binary is missing or not executable." >&2
+       echo "            Please try emerging the correct version of automake." >&2
+       exit 1
+fi
+
+exec "$binary" "$@"
+
+echo "am-wrapper: was unable to exec $binary !?" >&2
+exit 1
index b3a55233f2c7b9b49d6428c566d8e343af740c0d..b0e382f5c36c598f9838e9b3367cf1ccd5ed81b2 100644 (file)
@@ -1,12 +1,13 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-MD5 c5295968fd59f66cf5092877134f40d5 ChangeLog 10002
+MD5 3c5aa3d50912107c076c7ee9aa7fb20c ChangeLog 10131
 MD5 03fdf62516fd63326ecfdc8d6c26916f automake-1.4_p6.ebuild 1594
 MD5 9be8a78062e8d0c84a6602bc78e60bcb automake-1.5.ebuild 1577
 MD5 86d93bfc6161f414a09e2ede135824f2 automake-1.6.3.ebuild 1430
 MD5 fba78d906e5e338f46ac8f5845c7e6fd automake-1.7.9.ebuild 1464
 MD5 e1de6dd22d91d28403cd9fb91d02be56 automake-1.8.5-r2.ebuild 1505
+MD5 c07471021c0c13bf33de4073ec1c2196 automake-1.9.3.ebuild 1378
 MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
 MD5 79cf393f980b9967949326562bdaecb3 automake-1.8.5-r1.ebuild 12924
 MD5 78e8a0f1cc7ad91267499625df0de314 files/automake-1.5-slot.patch 1161
@@ -18,6 +19,7 @@ MD5 61706a6ada025b2f032fb24668457cef files/digest-automake-1.5 64
 MD5 a591fd70f20b40a46667f57326ad4b7c files/digest-automake-1.6.3 67
 MD5 29dec70b283dffd42358d3643b1754c3 files/digest-automake-1.7.9 67
 MD5 0fe9854b3a6384ef4c7b0bd2bad72c59 files/digest-automake-1.8.5-r2 67
+MD5 f43e95bca19333d9ba3db03015ca47e1 files/digest-automake-1.9.3 67
 MD5 7abe94459d460b0af03ee8720383607b files/digest-automake-1.8.5-r1 332
 MD5 e93136e02eb000c938f564484d306d76 files/automake-1.7.9-infopage-namechange.patch 592
 MD5 9587f00ace066c11b5c22d72afe630a9 files/automake-1.8.2-infopage-namechange.patch 1131
@@ -25,7 +27,7 @@ MD5 d576cbc9cda51d6288db8b8569eb9e2a files/automake-1.8.5-config-guess-uclibc.pa
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.9.10 (GNU/Linux)
 
-iD8DBQFBltXZHTu7gpaalycRAmfAAKCF4G+gOkHZtB2Fzq1/HLTwpVpqwACgy0SM
-dyGpF4FsLgGCKShs9qzXaZo=
-=K/8j
+iD8DBQFBlu8fHTu7gpaalycRArLjAJ9uSs8/aBH8YLRuH77zCp0rbfeM2ACg8jtf
+1bcMvnyzNLrpR+5AhJww9LM=
+=wCKK
 -----END PGP SIGNATURE-----