[Libreoffice-commits] .: autogen.sh

Jan Holesovsky kendy at kemper.freedesktop.org
Tue Apr 5 23:49:26 PDT 2011


 autogen.sh |   20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

New commits:
commit 020635f7b8ee3e7cbef136b0a8b0f44a3620e7ac
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Wed Apr 6 08:48:26 2011 +0200

    Migrate the old autogen.lastrun format to the new one automatically.

diff --git a/autogen.sh b/autogen.sh
index c2eacd4..642d523 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -20,7 +20,21 @@ sub read_args($)
     open ($fh, $file) || die "can't open file: $file";
     while (<$fh>) {
 	chomp();
-	push @lst, $_;
+	# migrate from the old system
+	if ( substr($_, 0, 1) eq "'" ) {
+	    print "Migrating options from the old autogen.lastrun format, using:\n";
+	    my @opts;
+	    @opts = split(/'/);
+	    foreach my $opt (@opts) {
+		if ( substr($opt, 0, 1) eq "-" ) {
+		    push @lst, $opt;
+		    print "  $opt\n";
+		}
+	    }
+	}
+	else {
+	    push @lst, $_;
+	}
     }
     close ($fh);
 #    print "read args from file '$file': @lst\n";
@@ -82,11 +96,11 @@ system ("autoconf") && die "Failed to run autoconf";
 if (defined $ENV{NOCONFIGURE}) {
     print "Skipping configure process.";
 } else {
-    if (@ARGV > 0) {
+    if ($#cmdline_args > 0) {
 	print "writing args to autogen.lastrun\n";
 	my $fh;
 	open ($fh, ">autogen.lastrun") || die "can't open autogen.lastrun: $!";
-	for my $arg (@ARGV) {
+	for my $arg (@cmdline_args) {
 	    print $fh "$arg\n";
 	}
 	close ($fh);


More information about the Libreoffice-commits mailing list