Просмотр исходного кода

dpkg-buildflags: Rename configure exporter to cmdline

Rename to something generic and not tied to a single specific use
pattern. Preserve configure as a legacy alias, because there's no
reason to break the current users, and the name they are using is
fine in case it's being used in a configure script call.
Guillem Jover лет назад: 13
Родитель
Сommit
fd320a3ad5
3 измененных файлов с 20 добавлено и 11 удалено
  1. 2 0
      debian/changelog
  2. 10 5
      man/dpkg-buildflags.1
  3. 8 6
      scripts/dpkg-buildflags.pl

+ 2 - 0
debian/changelog

@@ -43,6 +43,8 @@ dpkg (1.17.0) UNRELEASED; urgency=low
     Closes: #681470
   * Document dpkg-buildflags export mode usage in man page. Closes: #691449
     Thanks to Jonathan Nieder <jrnieder@gmail.com>.
+  * Rename dpkg-buildflags configure exporter to cmdline, but preserve
+    configure as a legacy alias.
 
  -- Guillem Jover <guillem@debian.org>  Fri, 03 Aug 2012 13:21:00 +0200
 

+ 10 - 5
man/dpkg-buildflags.1

@@ -2,6 +2,7 @@
 .\"
 .\" Copyright © 2010-2011 Raphaël Hertzog <hertzog@debian.org>
 .\" Copyright © 2011 Kees Cook <kees@debian.org>
+.\" Copyright © 2011-2013 Guillem Jover <guillem@debian.org>
 .\"
 .\" This is free software; you can redistribute it and/or modify
 .\" it under the terms of the GNU General Public License as published by
@@ -95,9 +96,13 @@ Shell commands to set and export all the compilation flags in the
 environment. The flag values are quoted so the output is ready for
 evaluation by a shell.
 .TP
+.B cmdline
+Arguments to pass to a build program's command line to use all the
+compilation flags (since dpkg 1.17.0). The flag values are quoted in
+shell syntax.
+.TP
 .B configure
-Arguments to pass to a GNU-style configuration script to use all
-the compilation flags. The flag values are quoted in shell syntax.
+This is a legacy alias for \fBcmdline\fP.
 .TP
 .B make
 Make directives to set and export all the compilation flags in the
@@ -328,9 +333,9 @@ To pass build flags to a build command in a makefile:
 .PP
 .RS 4
 .nf
-$(MAKE) $(shell dpkg\-buildflags \-\-export=configure)
+$(MAKE) $(shell dpkg\-buildflags \-\-export=cmdline)
 
-\&./configure $(shell dpkg\-buildflags \-\-export=configure)
+\&./configure $(shell dpkg\-buildflags \-\-export=cmdline)
 .fi
 .RE
 .PP
@@ -347,7 +352,7 @@ or to set the positional parameters to pass to a command:
 .PP
 .RS 4
 .nf
-eval "set \-\- $(dpkg\-buildflags \-\-export=configure)"
+eval "set \-\- $(dpkg\-buildflags \-\-export=cmdline)"
 for dir in a b c; do (cd $dir && ./configure "$@" && make); done
 .fi
 .RE

+ 8 - 6
scripts/dpkg-buildflags.pl

@@ -3,6 +3,7 @@
 # dpkg-buildflags
 #
 # Copyright © 2010-2011 Raphaël Hertzog <hertzog@debian.org>
+# Copyright © 2012-2013 Guillem Jover <guillem@debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -48,10 +49,9 @@ sub usage {
   --query-features <area>
                      output the status of features for the given area.
   --list             output a list of the flags supported by the current vendor.
-  --export=(sh|make|configure)
-                     output something convenient to import the
-                     compilation flags in a shell script, in make,
-                     or on a ./configure command line.
+  --export=(sh|make|cmdline|configure)
+                     output something convenient to import the compilation
+                     flags in a shell script, in make, or in a command line.
   --dump             output all compilation flags with their values
   --status           print a synopsis with all parameters affecting the
                      behaviour of dpkg-buildflags and the resulting flags
@@ -71,10 +71,12 @@ while (@ARGV) {
         $action = $1;
         $param = shift(@ARGV);
 	usageerr(_g("%s needs a parameter"), $_) unless defined $param;
-    } elsif (m/^--export(?:=(sh|make|configure))?$/) {
+    } elsif (m/^--export(?:=(sh|make|cmdline|configure))?$/) {
         usageerr(_g("two commands specified: --%s and --%s"), "export", $action)
             if defined($action);
         my $type = $1 || "sh";
+        # Map legacy aliases.
+        $type = 'cmdline' if $type eq 'configure';
         $action = "export-$type";
     } elsif (m/^--(list|status|dump)$/) {
         usageerr(_g("two commands specified: --%s and --%s"), $1, $action)
@@ -136,7 +138,7 @@ if ($action eq "get") {
 	} elsif ($export_type eq "make") {
 	    $value =~ s/\$/\$\$/g;
 	    print "export $flag := $value\n";
-	} elsif ($export_type eq "configure") {
+	} elsif ($export_type eq "cmdline") {
 	    print "$flag=\"$value\" ";
 	}
     }