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

dpkg-architecture: finish support of DEB_{HOST,BUILD}_ARCH_{BITS,ENDIAN}

Enhanced cputable to describe the new columns.

Let dpkg-dev depend on dpkg (>= 1.15.4) to ensure that we have an updated
cputable (and so that a versioned build-dependency on dpkg-dev is enough to use
this new feature).

Document the new variables in the manual page dpkg-architecture(1).
Raphaël Hertzog лет назад: 17
Родитель
Сommit
ef51c154b0
5 измененных файлов с 30 добавлено и 10 удалено
  1. 2 0
      cputable
  2. 7 0
      debian/changelog
  3. 1 1
      debian/control
  4. 16 5
      man/dpkg-architecture.1
  5. 4 4
      scripts/dpkg-architecture.pl

+ 2 - 0
cputable

@@ -12,6 +12,8 @@
 # targets in ‘dpkg-architecture’.
 # targets in ‘dpkg-architecture’.
 # Column 3 is an extended regular expression used to match against the
 # Column 3 is an extended regular expression used to match against the
 # CPU part of the output of the GNU config.guess script.
 # CPU part of the output of the GNU config.guess script.
+# Column 4 is the size (in bits) of the integers/pointers
+# Column 5 is the endianness (byte ordering in numbers)
 #
 #
 # <Debian name>	<GNU name>	<config.guess regex>	<Bits>	<Endianness>
 # <Debian name>	<GNU name>	<config.guess regex>	<Bits>	<Endianness>
 i386		i486		(i[3456]86|pentium)	32	little
 i386		i486		(i[3456]86|pentium)	32	little

+ 7 - 0
debian/changelog

@@ -61,6 +61,13 @@ dpkg (1.15.4) UNRELEASED; urgency=low
     information if the version provided is older than the one already listed
     information if the version provided is older than the one already listed
     in the available file. Thanks to Ian Jackson
     in the available file. Thanks to Ian Jackson
     <ian@davenant.greenend.org.uk> for the patch. Closes: #496114
     <ian@davenant.greenend.org.uk> for the patch. Closes: #496114
+  * dpkg-architecture can now export DEB_{HOST,BUILD}_ARCH_{BITS,ENDIAN}
+    (pointer size and endianness):
+    - cputable (in dpkg) modified to contain those information
+    - dpkg-dev depends on dpkg (>= 1.15.4) to ensure that we have an updated
+      cputable (and so that a versioned build-dependency on dpkg-dev is enough
+      to use this new feature)
+    Closes: #531307
 
 
   [ Modestas Vainius ]
   [ Modestas Vainius ]
   * Provide a meaningful label for dpkg-gensymbols diff.
   * Provide a meaningful label for dpkg-gensymbols diff.

+ 1 - 1
debian/control

@@ -40,7 +40,7 @@ Package: dpkg-dev
 Section: utils
 Section: utils
 Priority: optional
 Priority: optional
 Architecture: all
 Architecture: all
-Depends: dpkg (>= 1.14.6), perl5, perl-modules, bzip2, lzma,
+Depends: dpkg (>= 1.15.4), perl5, perl-modules, bzip2, lzma,
  patch (>= 2.2-1), make, binutils, libtimedate-perl
  patch (>= 2.2-1), make, binutils, libtimedate-perl
 Recommends: gcc | c-compiler, build-essential, fakeroot, gnupg, gpgv
 Recommends: gcc | c-compiler, build-essential, fakeroot, gnupg, gpgv
 Suggests: debian-keyring, debian-maintainers
 Suggests: debian-keyring, debian-maintainers

+ 16 - 5
man/dpkg-architecture.1

@@ -105,6 +105,10 @@ The Debian architecture of the build machine.
 The Debian system name of the build machine.
 The Debian system name of the build machine.
 .IP "\s-1DEB_BUILD_ARCH_CPU\s0" 4
 .IP "\s-1DEB_BUILD_ARCH_CPU\s0" 4
 The Debian cpu name of the build machine.
 The Debian cpu name of the build machine.
+.IP "\s-1DEB_BUILD_ARCH_BITS\s0" 4
+The pointer size of the build machine (in bits).
+.IP "\s-1DEB_BUILD_ARCH_ENDIAN\s0" 4
+The endianness of the build machine (little / big).
 .IP "\s-1DEB_BUILD_GNU_TYPE\s0" 4
 .IP "\s-1DEB_BUILD_GNU_TYPE\s0" 4
 The \s-1GNU\s0 system type of the build machine.
 The \s-1GNU\s0 system type of the build machine.
 .IP "\s-1DEB_BUILD_GNU_CPU\s0" 4
 .IP "\s-1DEB_BUILD_GNU_CPU\s0" 4
@@ -117,6 +121,10 @@ The Debian architecture of the host machine.
 The Debian system name of the host machine.
 The Debian system name of the host machine.
 .IP "\s-1DEB_HOST_ARCH_CPU\s0" 4
 .IP "\s-1DEB_HOST_ARCH_CPU\s0" 4
 The Debian cpu name of the host machine.
 The Debian cpu name of the host machine.
+.IP "\s-1DEB_BUILD_ARCH_BITS\s0" 4
+The pointer size of the host machine (in bits).
+.IP "\s-1DEB_BUILD_ARCH_ENDIAN\s0" 4
+The endianness of the host machine (little / big).
 .IP "\s-1DEB_HOST_GNU_TYPE\s0" 4
 .IP "\s-1DEB_HOST_GNU_TYPE\s0" 4
 The \s-1GNU\s0 system type of the host machine.
 The \s-1GNU\s0 system type of the host machine.
 .IP "\s-1DEB_HOST_GNU_CPU\s0" 4
 .IP "\s-1DEB_HOST_GNU_CPU\s0" 4
@@ -179,11 +187,14 @@ Especially the \-\-print\-architecture option is unreliable since we have
 Debian architectures which don't equal a processor name.
 Debian architectures which don't equal a processor name.
 .
 .
 .SH "BACKWARD COMPATIBILITY"
 .SH "BACKWARD COMPATIBILITY"
-The DEB_HOST_ARCH_CPU and DEB_HOST_ARCH_OS variables were only introduced
-in relatively recent versions of \fBdpkg\-architecture\fR (since dpkg 1.13.2),
-before this \fIdebian/rules\fR files tended to check the values of the
-DEB_HOST_GNU_CPU or DEB_HOST_GNU_TYPE variables which have been subject
-to change.
+The DEB_*_ARCH_BITS and DEB_*_ARCH_ENDIAN variables were introduced
+in dpkg-dev 1.15.4. Using them in \fIdebian/rules\fR thus requires a
+build-dependency on dpkg-dev (>= 1.15.4).
+.PP
+The DEB_HOST_ARCH_CPU and DEB_HOST_ARCH_OS variables were introduced
+in dpkg-dev 1.13.2. Before this \fIdebian/rules\fR files tended to check
+the values of the DEB_HOST_GNU_CPU or DEB_HOST_GNU_TYPE variables which
+have been subject to change.
 .PP
 .PP
 Where \fIdebian/rules\fR files check these variables to decide how or what
 Where \fIdebian/rules\fR files check these variables to decide how or what
 to compile, this should be updated to use the new variables and values.
 to compile, this should be updated to use the new variables and values.

+ 4 - 4
scripts/dpkg-architecture.pl

@@ -126,10 +126,10 @@ while (@ARGV) {
 my %v;
 my %v;
 
 
 my @ordered = qw(DEB_BUILD_ARCH DEB_BUILD_ARCH_OS DEB_BUILD_ARCH_CPU
 my @ordered = qw(DEB_BUILD_ARCH DEB_BUILD_ARCH_OS DEB_BUILD_ARCH_CPU
-                 DEB_BUILD_ARCH_BITS DEB_BUILD_ARCH_ENDIANNESS
+                 DEB_BUILD_ARCH_BITS DEB_BUILD_ARCH_ENDIAN
                  DEB_BUILD_GNU_CPU DEB_BUILD_GNU_SYSTEM DEB_BUILD_GNU_TYPE
                  DEB_BUILD_GNU_CPU DEB_BUILD_GNU_SYSTEM DEB_BUILD_GNU_TYPE
                  DEB_HOST_ARCH DEB_HOST_ARCH_OS DEB_HOST_ARCH_CPU
                  DEB_HOST_ARCH DEB_HOST_ARCH_OS DEB_HOST_ARCH_CPU
-                 DEB_HOST_ARCH_BITS DEB_HOST_ARCH_ENDIANNESS
+                 DEB_HOST_ARCH_BITS DEB_HOST_ARCH_ENDIAN
                  DEB_HOST_GNU_CPU DEB_HOST_GNU_SYSTEM DEB_HOST_GNU_TYPE);
                  DEB_HOST_GNU_CPU DEB_HOST_GNU_SYSTEM DEB_HOST_GNU_TYPE);
 
 
 $v{DEB_BUILD_ARCH} = get_raw_build_arch();
 $v{DEB_BUILD_ARCH} = get_raw_build_arch();
@@ -183,8 +183,8 @@ my $abi;
 ($v{DEB_HOST_GNU_CPU}, $v{DEB_HOST_GNU_SYSTEM}) = split(/-/, $v{DEB_HOST_GNU_TYPE}, 2);
 ($v{DEB_HOST_GNU_CPU}, $v{DEB_HOST_GNU_SYSTEM}) = split(/-/, $v{DEB_HOST_GNU_TYPE}, 2);
 ($v{DEB_BUILD_GNU_CPU}, $v{DEB_BUILD_GNU_SYSTEM}) = split(/-/, $v{DEB_BUILD_GNU_TYPE}, 2);
 ($v{DEB_BUILD_GNU_CPU}, $v{DEB_BUILD_GNU_SYSTEM}) = split(/-/, $v{DEB_BUILD_GNU_TYPE}, 2);
 
 
-($v{DEB_HOST_ARCH_BITS}, $v{DEB_HOST_ARCH_ENDIANNESS}) = debarch_to_cpuattrs($v{DEB_HOST_ARCH});
-($v{DEB_BUILD_ARCH_BITS}, $v{DEB_BUILD_ARCH_ENDIANNESS}) = debarch_to_cpuattrs($v{DEB_BUILD_ARCH});
+($v{DEB_HOST_ARCH_BITS}, $v{DEB_HOST_ARCH_ENDIAN}) = debarch_to_cpuattrs($v{DEB_HOST_ARCH});
+($v{DEB_BUILD_ARCH_BITS}, $v{DEB_BUILD_ARCH_ENDIAN}) = debarch_to_cpuattrs($v{DEB_BUILD_ARCH});
 
 
 for my $k (@ordered) {
 for my $k (@ordered) {
     $v{$k} = $ENV{$k} if (defined ($ENV{$k}) && !$force);
     $v{$k} = $ENV{$k} if (defined ($ENV{$k}) && !$force);