Przeglądaj źródła

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 lat temu
rodzic
commit
fd320a3ad5
3 zmienionych plików z 20 dodań i 11 usunięć
  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
     Closes: #681470
   * Document dpkg-buildflags export mode usage in man page. Closes: #691449
   * Document dpkg-buildflags export mode usage in man page. Closes: #691449
     Thanks to Jonathan Nieder <jrnieder@gmail.com>.
     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
  -- 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 © 2010-2011 Raphaël Hertzog <hertzog@debian.org>
 .\" Copyright © 2011 Kees Cook <kees@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
 .\" This is free software; you can redistribute it and/or modify
 .\" it under the terms of the GNU General Public License as published by
 .\" 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
 environment. The flag values are quoted so the output is ready for
 evaluation by a shell.
 evaluation by a shell.
 .TP
 .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
 .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
 .TP
 .B make
 .B make
 Make directives to set and export all the compilation flags in the
 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
 .PP
 .RS 4
 .RS 4
 .nf
 .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
 .fi
 .RE
 .RE
 .PP
 .PP
@@ -347,7 +352,7 @@ or to set the positional parameters to pass to a command:
 .PP
 .PP
 .RS 4
 .RS 4
 .nf
 .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
 for dir in a b c; do (cd $dir && ./configure "$@" && make); done
 .fi
 .fi
 .RE
 .RE

+ 8 - 6
scripts/dpkg-buildflags.pl

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