[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Fwd: detect-autoconf.pl and Debian [PATCH]
From:       Michael Pyne <pynm0001 () comcast ! net>
Date:       2005-08-31 0:20:23
Message-ID: 200508302020.29391.pynm0001 () comcast ! net
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


Hi all,

According to the below message, the automake shipped with Debian is 1.4 in the 
unversioned script, and so apparently detect-autoconf.pl will break there.  
detect-autoconf.pl uses the unversioned script if it exists to support 
variables like WANT_AUTOMAKE.

So I constructed a patch (attached) to reject unversioned scripts if they 
aren't of a minimum version.  I would appreciate it if someone could review 
(and if you have adequate karma, apply) the patch.

The alternative is to just prefer a versioned script instead.  It doesn't 
really bug me either way.

Regards,
 - Michael Pyne

----------  Forwarded Message  ----------

Subject: detect-autoconf.pl
Date: Saturday 27 August 2005 11:36
From: Christoph Cullmann <cullmann (at) babylon2k.de>
To: michael.pyne (at) kdemail.net

Hi,
as Debian and all based distros ship automake 1.4 aus "automake" binary
on default, even if you install higher versions in addition, your fallback to
the unversioned binary in that script should take in mind some lowest version
boundary, like rejecting this fallback if automake < 1.5.
The current stuff won't work on any debian with mixed automake install.

cu
Christoph

["debian-is-weird.diff" (text/x-diff)]

Index: detect-autoconf.pl
===================================================================
--- detect-autoconf.pl	(revision 454849)
+++ detect-autoconf.pl	(working copy)
@@ -28,6 +28,10 @@
     my ($program, @paths) = @_;
     my $best_version_found = '0'; # Deliberately a string.
     my %versions;
+    my %minimumVersions = (
+ 	'autoconf' => '2.5',
+	'automake' => '1.6',
+    );
 
     # Allow user to use environment variable to override search.
     return $ENV{uc $program} if $ENV{uc $program};
@@ -43,6 +47,26 @@
 	    ($version) = $file =~ /$prefix\/$program-?(.*)$/;
 	    $version =~ s/-|\.//g;
 
+	    # Special case some programs to make sure it has a minimum version.
+	    if (not $version and exists $minimumVersions{$program})
+	    {
+		my $min_version = $minimumVersions{$program};
+		my $versionOutput = `$program --version 2>/dev/null | head -n 1`;
+
+		# If we can't run the script to get the version it likely won't work later.
+		next unless $versionOutput; 
+
+		# Use number.number for version (we don't need the excess in general).
+		($versionOutput) = ($versionOutput =~ /(\d\.\d)/);
+
+		# Use lt to do lexicographical comparison of strings (which should be
+		# equivalent and doesn't involve issues with floating point conversions).
+		if (not $versionOutput or $versionOutput lt $min_version)
+		{
+		    next;
+		}
+	    }
+
 	    # If no version suffix then use it in favor of a versioned autotool
 	    # since the ever-popular WANT_AUTOFOO should then work (in theory).
 	    return $file unless $version;

[Attachment #6 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic