The branch, master has been updated
       via  4bb7dbb89a129685493f964cc50890560c5865dc (commit)
       via  04fb8521c2462ce2b5ce1855371531878a0e516e (commit)
       via  a91b20ff60142cef648c8443803032ad820ffc92 (commit)
       via  e8e170be413466a968359ab06c7b3fbb303a0a1a (commit)
       via  55c612f327853877bb5cdceba3f92697c1647e8b (commit)
       via  153bf5ea25f96928752f2028fd2efc58bc42c8c6 (commit)
       via  9b07d03f0f0c6043916882a8d7ac704a67ce8341 (commit)
       via  cd1ce010c0aa39dd4b030527c2c23f2df6bea6c1 (commit)
      from  42df659e5235f957934de2f508d5b90bd095d078 (commit)


- Shortlog ------------------------------------------------------------
4bb7dbb Dpkg::Arch: Force a sane input record separator for file parsing 
functions
04fb852 Fix some Polish translations or mark as fuzzy
a91b20f Force use of shipped perl modules instead of system ones for perl tests
e8e170b dpkg-architecture: Move host and build arch detection code to Dpkg::Arch
55c612f dpkg-architecture: Wrap long strings for die calls
153bf5e Dpkg::Arch: Add functions for direct debarch to/from gnutriplet 
conversion
9b07d03 dpkg-architecture: Perform -L actions inside argument processing loop
cd1ce01 Dpkg::Arch: Instead of printing make get_valid_arches return an array

Summary of changes:
 ChangeLog                    |   45 ++++++++++++++++++++++
 TODO                         |    2 +-
 debian/changelog             |    2 +
 scripts/Dpkg/Arch.pm         |   84 +++++++++++++++++++++++++++++++++++++++---
 scripts/Makefile.am          |    2 +-
 scripts/dpkg-architecture.pl |   77 ++++++++++++++------------------------
 scripts/po/ChangeLog         |    5 ++
 scripts/po/pl.po             |    8 ++-
 8 files changed, 165 insertions(+), 60 deletions(-)
-----------------------------------------------------------------------
Details of changes:

commit 4bb7dbb89a129685493f964cc50890560c5865dc
Author: Guillem Jover <[EMAIL PROTECTED]>
Date:   Thu Nov 15 21:35:26 2007 +0200

    Dpkg::Arch: Force a sane input record separator for file parsing functions

diff --git a/ChangeLog b/ChangeLog
index 07b45e8..9bf8831 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-11-15  Guillem Jover  <[EMAIL PROTECTED]>
+
+       * scripts/Dpkg/Arch.pm (read_cputable): Force a sane input record
+       separator.
+       (read_ostable): Likewise.
+       (read_triplettable): Likewise.
+
 2007-11-04  Guillem Jover  <[EMAIL PROTECTED]>
 
        * scripts/Makefile.am (clean): Set PERL5LIB to force use of shipped
diff --git a/scripts/Dpkg/Arch.pm b/scripts/Dpkg/Arch.pm
index 714a63e..080ee59 100644
--- a/scripts/Dpkg/Arch.pm
+++ b/scripts/Dpkg/Arch.pm
@@ -104,6 +104,7 @@ sub get_valid_arches()
 sub read_cputable
 {
     local $_;
+    local $/ = "\n";
 
     open CPUTABLE, "$pkgdatadir/cputable"
        or syserr(_g("unable to open cputable"));
@@ -120,6 +121,7 @@ sub read_cputable
 sub read_ostable
 {
     local $_;
+    local $/ = "\n";
 
     open OSTABLE, "$pkgdatadir/ostable"
        or syserr(_g("unable to open ostable"));
@@ -138,6 +140,7 @@ sub read_triplettable()
     read_cputable() if ([EMAIL PROTECTED]);
 
     local $_;
+    local $/ = "\n";
 
     open TRIPLETTABLE, "$pkgdatadir/triplettable"
        or syserr(_g("unable to open triplettable"));

commit 04fb8521c2462ce2b5ce1855371531878a0e516e
Author: Guillem Jover <[EMAIL PROTECTED]>
Date:   Thu Nov 15 20:19:02 2007 +0200

    Fix some Polish translations or mark as fuzzy

diff --git a/scripts/po/ChangeLog b/scripts/po/ChangeLog
index 0de6fbb..6c68011 100644
--- a/scripts/po/ChangeLog
+++ b/scripts/po/ChangeLog
@@ -1,3 +1,8 @@
+2007-11-15  Guillem Jover  <[EMAIL PROTECTED]>
+
+       * pl.po: Mark two bogus translations as fuzzy. Fix one format
+       parameter from 's' to '%s' and another from '%d' to '%s'.
+
 2007-11-11  Helge Kreutzmann  <[EMAIL PROTECTED]>
 
        * de.po: Updated to 172t0f306u.
diff --git a/scripts/po/pl.po b/scripts/po/pl.po
index fcc3d8e..0b392d6 100644
--- a/scripts/po/pl.po
+++ b/scripts/po/pl.po
@@ -5,7 +5,7 @@ msgid ""
 msgstr "Project-Id-Version: dpkg 1.14.17\n"
 "Report-Msgid-Bugs-To: [EMAIL PROTECTED]"
 "POT-Creation-Date: 2007-10-26 08:47+0100\n"
-"PO-Revision-Date: 2007-11-04 11:33+0100\n"
+"PO-Revision-Date: 2007-11-15 20:15+0200\n"
 "Last-Translator: Robert Luberda <[EMAIL PROTECTED]>\n"
 "Language-Team: Polish <[EMAIL PROTECTED]>\n"
 "Content-Type: text/plain; charset=ISO-8859-2\n"
@@ -1612,7 +1612,7 @@ msgstr ""
 #: scripts/dpkg-shlibdeps.pl:367
 #, perl-format
 msgid "shared libs info file `%s' line %d: bad line `%s'"
-msgstr "plik bibliotek wspó³dzielonych %s, linia %s: niepoprawna linia `%s'"
+msgstr "plik bibliotek wspó³dzielonych %s, linia %d: niepoprawna linia `%s'"
 
 #: scripts/dpkg-shlibdeps.pl:407
 #, perl-format
@@ -1650,6 +1650,7 @@ msgstr ""
 
 #: scripts/dpkg-source.pl:155
 #, perl-format
+#, fuzzy
 msgid ""
 "Usage: %s [<option> ...] <command>\n"
 "\n"
@@ -2515,7 +2516,7 @@ msgstr "archiwum tar `%s' zawiera obiekt 'debian', który 
nie jest katalogiem"
 msgid ""
 "tarfile `%s' contains object `%s' but its containing directory `%s' does not "
 "precede it"
-msgstr "archiwum tar `%s' zawiera obiekt `s', niepoprzedzony katalogiem `%s', 
w którym siê znajduje"
+msgstr "archiwum tar `%s' zawiera obiekt `%s', niepoprzedzony katalogiem `%s', 
w którym siê znajduje"
 
 #: scripts/dpkg-source.pl:1372 scripts/dpkg-source.pl:1417
 #: scripts/dpkg-source.pl:1428
@@ -2776,6 +2777,7 @@ msgstr "niepoprawnie sformatowana warto¶æ pola urgency"
 
 #: scripts/changelog/debian.pl:112
 #, perl-format
+#, fuzzy
 msgid "unknown urgency value %s - comparing very low"
 msgstr "nieznana warto¶æ pola urgency - porównywanie bardzo nisko"
 

commit a91b20ff60142cef648c8443803032ad820ffc92
Author: Guillem Jover <[EMAIL PROTECTED]>
Date:   Sun Nov 4 22:10:43 2007 +0200

    Force use of shipped perl modules instead of system ones for perl tests

diff --git a/ChangeLog b/ChangeLog
index 3241f27..07b45e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2007-11-04  Guillem Jover  <[EMAIL PROTECTED]>
 
+       * scripts/Makefile.am (clean): Set PERL5LIB to force use of shipped
+       modules instead of system ones.
+
+2007-11-04  Guillem Jover  <[EMAIL PROTECTED]>
+
        * scripts/dpkg-architecture.pl: Move host and build arch detection
        to ...
        * scripts/Dpkg/Arch.pm (get_host_arch): ... here.
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index b18b513..538ac58 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -146,4 +146,4 @@ check: $(TEST_FILES) $(wildcard 
$(srcdir)/t/200_Dpkg_Shlibs/ld.so.conf*)
 # a bit hacky...
        $(mkdir_p) t.tmp
        cp -dRl $(srcdir)/t/200_Dpkg_Shlibs/ld.so.conf* t.tmp/
-       srcdir=$(srcdir) PERL_DL_NONLAZY=1 $(PERL) -I$(srcdir) 
"-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '.')" 
$(TEST_FILES)
+       srcdir=$(srcdir) PERL5LIB=$(srcdir) PERL_DL_NONLAZY=1 $(PERL) 
-I$(srcdir) "-MExtUtils::Command::MM" "-e" "test_harness($(TEST_VERBOSE), '.')" 
$(TEST_FILES)

commit e8e170be413466a968359ab06c7b3fbb303a0a1a
Author: Guillem Jover <[EMAIL PROTECTED]>
Date:   Sun Nov 4 21:41:31 2007 +0200

    dpkg-architecture: Move host and build arch detection code to Dpkg::Arch

diff --git a/ChangeLog b/ChangeLog
index 9c40bb3..3241f27 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2007-11-04  Guillem Jover  <[EMAIL PROTECTED]>
 
+       * scripts/dpkg-architecture.pl: Move host and build arch detection
+       to ...
+       * scripts/Dpkg/Arch.pm (get_host_arch): ... here.
+       (get_build_arch, get_gcc_host_gnu_type): Likewise. New function.
+
+2007-11-04  Guillem Jover  <[EMAIL PROTECTED]>
+
        * scripts/dpkg-architecture.pl: Wrap long strings for die calls
        at less than 80 chars.
 
diff --git a/TODO b/TODO
index 5daf07d..ef83880 100644
--- a/TODO
+++ b/TODO
@@ -12,7 +12,7 @@ lenny
 1.14.x
 ------
 
- * Make dpkg bootstrappable (modularize dpkg-architecture).
+ * Make dpkg bootstrappable.
 
  * Support udeb natively:
    - Add field Package-Type and friends.
diff --git a/debian/changelog b/debian/changelog
index c69c7b8..4dcd024 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -54,6 +54,8 @@ dpkg (1.14.8) UNRELEASED; urgency=low
   * Switch perl programs to use the new Dpkg/ErrorHandling module.
   * Switch perl programs to use the new Dpkg/Arch module.
   * Add support for format strings in Dpkg::ErrorHandling functions.
+  * Move build and host arch detection code from dpkg-architecture to
+    Dpkg::Arch.
 
   [ Updated dselect translations ]
   * Czech (Miroslav Kure).
diff --git a/scripts/Dpkg/Arch.pm b/scripts/Dpkg/Arch.pm
index 547d631..714a63e 100644
--- a/scripts/Dpkg/Arch.pm
+++ b/scripts/Dpkg/Arch.pm
@@ -5,13 +5,15 @@ use warnings;
 
 use Exporter;
 our @ISA = qw(Exporter);
-our @EXPORT_OK = qw(get_host_arch get_valid_arches debarch_eq debarch_is
+our @EXPORT_OK = qw(get_build_arch get_host_arch get_gcc_host_gnu_type
+                    get_valid_arches debarch_eq debarch_is
                     debarch_to_gnutriplet gnutriplet_to_debarch
                     debtriplet_to_gnutriplet gnutriplet_to_debtriplet
                     debtriplet_to_debarch debarch_to_debtriplet);
 
 use Dpkg;
-use Dpkg::ErrorHandling qw(syserr subprocerr);
+use Dpkg::Gettext;
+use Dpkg::ErrorHandling qw(syserr subprocerr warning);
 
 my (@cpu, @os);
 my (%cputable, %ostable);
@@ -21,15 +23,63 @@ my %debtriplet_to_debarch;
 my %debarch_to_debtriplet;
 
 {
+    my $build_arch;
     my $host_arch;
+    my $gcc_host_gnu_type;
+
+    sub get_build_arch()
+    {
+       return $build_arch if defined $build_arch;
+
+       my $build_arch = `dpkg --print-architecture`;
+       # FIXME: Handle bootstrapping
+       syserr("dpkg --print-architecture failed") if $? >> 8;
+
+       chomp $build_arch;
+       return $build_arch;
+    }
+
+    sub get_gcc_host_gnu_type()
+    {
+       return $gcc_host_gnu_type if defined $gcc_host_gnu_type;
+
+       my $gcc_host_gnu_type = `\${CC:-gcc} -dumpmachine`;
+       if ($? >> 8) {
+           $gcc_host_gnu_type = '';
+       } else {
+           chomp $gcc_host_gnu_type;
+       }
+
+       return $gcc_host_gnu_type;
+    }
 
     sub get_host_arch()
     {
        return $host_arch if defined $host_arch;
 
-       $host_arch = `dpkg-architecture -qDEB_HOST_ARCH`;
-       $? && subprocerr("dpkg-architecture -qDEB_HOST_ARCH");
-       chomp $host_arch;
+       my $gcc_host_gnu_type = get_gcc_host_gnu_type();
+
+       if ($gcc_host_gnu_type eq '') {
+           warning(_g("Couldn't determine gcc system type, falling back to " .
+                      "default (native compilation)"));
+       } else {
+           my (@host_archtriplet) = 
gnutriplet_to_debtriplet($gcc_host_gnu_type);
+           $host_arch = debtriplet_to_debarch(@host_archtriplet);
+
+           if (defined $host_arch) {
+               $gcc_host_gnu_type = 
debtriplet_to_gnutriplet(@host_archtriplet);
+           } else {
+               warning(_g("Unknown gcc system type %s, falling back to " .
+                          "default (native compilation)"), $gcc_host_gnu_type);
+               $gcc_host_gnu_type = '';
+           }
+       }
+
+       if (!defined($host_arch)) {
+           # Switch to native compilation.
+           $host_arch = get_build_arch();
+       }
+
        return $host_arch;
     }
 }
diff --git a/scripts/dpkg-architecture.pl b/scripts/dpkg-architecture.pl
index 858d6e4..e44956e 100755
--- a/scripts/dpkg-architecture.pl
+++ b/scripts/dpkg-architecture.pl
@@ -25,9 +25,8 @@ use warnings;
 use Dpkg;
 use Dpkg::Gettext;
 use Dpkg::ErrorHandling qw(warning syserr usageerr);
-use Dpkg::Arch qw(get_valid_arches debarch_eq debarch_is
-                  debtriplet_to_gnutriplet gnutriplet_to_debtriplet
-                  debtriplet_to_debarch debarch_to_debtriplet
+use Dpkg::Arch qw(get_build_arch get_host_arch get_gcc_host_gnu_type
+                  get_valid_arches debarch_eq debarch_is debarch_to_debtriplet
                   debarch_to_gnutriplet gnutriplet_to_debarch);
 
 textdomain("dpkg-dev");
@@ -124,38 +123,13 @@ while (@ARGV) {
 
 # Set default values:
 
-chomp (my $deb_build_arch = `dpkg --print-architecture`);
-&syserr("dpkg --print-architecture failed") if $?>>8;
+my $deb_build_arch = get_build_arch();
 my $deb_build_gnu_type = debarch_to_gnutriplet($deb_build_arch);
 
-# Default host: Current gcc.
-my $gcc = `\${CC:-gcc} -dumpmachine`;
-if ($?>>8) {
-    warning(_g("Couldn't determine gcc system type, falling back to default 
(native compilation)"));
-    $gcc = '';
-} else {
-    chomp $gcc;
-}
+my $deb_host_arch = get_host_arch();
+my $deb_host_gnu_type = debarch_to_gnutriplet($deb_host_arch);
 
-my $deb_host_arch = undef;
-my $deb_host_gnu_type;
-
-if ($gcc ne '') {
-    my (@deb_host_archtriplet) = gnutriplet_to_debtriplet($gcc);
-    $deb_host_arch = debtriplet_to_debarch(@deb_host_archtriplet);
-    unless (defined $deb_host_arch) {
-       warning(_g("Unknown gcc system type %s, falling back to default " .
-                  "(native compilation)"), $gcc);
-       $gcc = '';
-    } else {
-       $gcc = $deb_host_gnu_type = 
debtriplet_to_gnutriplet(@deb_host_archtriplet);
-    }
-}
-if (!defined($deb_host_arch)) {
-    # Default host: Native compilation.
-    $deb_host_arch = $deb_build_arch;
-    $deb_host_gnu_type = $deb_build_gnu_type;
-}
+# Set user values:
 
 if ($req_host_arch ne '' && $req_host_gnu_type eq '') {
     $req_host_gnu_type = debarch_to_gnutriplet($req_host_arch);
@@ -185,8 +159,8 @@ if ($req_host_gnu_type ne '' && $req_host_arch ne '') {
 $deb_host_arch = $req_host_arch if $req_host_arch ne '';
 $deb_host_gnu_type = $req_host_gnu_type if $req_host_gnu_type ne '';
 
-#$gcc = `\${CC:-gcc} --print-libgcc-file-name`;
-#$gcc =~ s!^.*gcc-lib/(.*)/\d+(?:.\d+)*/libgcc.*$!$1!s;
+my $gcc = get_gcc_host_gnu_type();
+
 warning(_g("Specified GNU system type %s does not match gcc system type %s."),
         $deb_host_gnu_type, $gcc)
     if !($req_is_arch or $req_eq_arch) &&

commit 55c612f327853877bb5cdceba3f92697c1647e8b
Author: Guillem Jover <[EMAIL PROTECTED]>
Date:   Sun Nov 4 20:53:46 2007 +0200

    dpkg-architecture: Wrap long strings for die calls

diff --git a/ChangeLog b/ChangeLog
index 9bb255c..9c40bb3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2007-11-04  Guillem Jover  <[EMAIL PROTECTED]>
 
+       * scripts/dpkg-architecture.pl: Wrap long strings for die calls
+       at less than 80 chars.
+
+2007-11-04  Guillem Jover  <[EMAIL PROTECTED]>
+
        * scripts/Dpkg/Arch.pm (debarch_to_gnutriplet): New function.
        (gnutriplet_to_debarch): Likewise.
        * scripts/dpkg-architecture.pl: Use debarch_to_gnutriplet and
diff --git a/scripts/dpkg-architecture.pl b/scripts/dpkg-architecture.pl
index ad9dd3d..858d6e4 100755
--- a/scripts/dpkg-architecture.pl
+++ b/scripts/dpkg-architecture.pl
@@ -159,12 +159,16 @@ if (!defined($deb_host_arch)) {
 
 if ($req_host_arch ne '' && $req_host_gnu_type eq '') {
     $req_host_gnu_type = debarch_to_gnutriplet($req_host_arch);
-    die (sprintf(_g("unknown Debian architecture %s, you must specify GNU 
system type, too"), $req_host_arch)) unless defined $req_host_gnu_type;
+    die (sprintf(_g("unknown Debian architecture %s, you must specify " .
+                    "GNU system type, too"), $req_host_arch))
+        unless defined $req_host_gnu_type;
 }
 
 if ($req_host_gnu_type ne '' && $req_host_arch eq '') {
     $req_host_arch = gnutriplet_to_debarch($req_host_gnu_type);
-    die (sprintf(_g("unknown GNU system type %s, you must specify Debian 
architecture, too"), $req_host_gnu_type)) unless defined $req_host_arch;
+    die (sprintf(_g("unknown GNU system type %s, you must specify " .
+                    "Debian architecture, too"), $req_host_gnu_type))
+        unless defined $req_host_arch;
 }
 
 if ($req_host_gnu_type ne '' && $req_host_arch ne '') {

commit 153bf5ea25f96928752f2028fd2efc58bc42c8c6
Author: Guillem Jover <[EMAIL PROTECTED]>
Date:   Sun Nov 4 02:21:42 2007 +0200

    Dpkg::Arch: Add functions for direct debarch to/from gnutriplet conversion

diff --git a/ChangeLog b/ChangeLog
index adad184..9bb255c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2007-11-04  Guillem Jover  <[EMAIL PROTECTED]>
 
+       * scripts/Dpkg/Arch.pm (debarch_to_gnutriplet): New function.
+       (gnutriplet_to_debarch): Likewise.
+       * scripts/dpkg-architecture.pl: Use debarch_to_gnutriplet and
+       gnutriplet_to_debarch instead of nested calls to
+       debtriplet_to_gnutriplet and debarch_to_debtriplet,
+       debtriplet_to_debarch and gnutriplet_to_debtriplet.
+
+2007-11-04  Guillem Jover  <[EMAIL PROTECTED]>
+
        * scripts/dpkg-architecture.pl: Move setting of host and build arch
        variables after argument processing. Call list_arches from argument
        processing loop. Move architecture listing to ...
diff --git a/scripts/Dpkg/Arch.pm b/scripts/Dpkg/Arch.pm
index 7ffca35..547d631 100644
--- a/scripts/Dpkg/Arch.pm
+++ b/scripts/Dpkg/Arch.pm
@@ -6,6 +6,7 @@ use warnings;
 use Exporter;
 our @ISA = qw(Exporter);
 our @EXPORT_OK = qw(get_host_arch get_valid_arches debarch_eq debarch_is
+                    debarch_to_gnutriplet gnutriplet_to_debarch
                     debtriplet_to_gnutriplet gnutriplet_to_debtriplet
                     debtriplet_to_debarch debarch_to_debtriplet);
 
@@ -192,6 +193,20 @@ sub debarch_to_debtriplet($)
     }
 }
 
+sub debarch_to_gnutriplet($)
+{
+    my ($arch) = @_;
+
+    return debtriplet_to_gnutriplet(debarch_to_debtriplet($arch));
+}
+
+sub gnutriplet_to_debarch($)
+{
+    my ($gnu) = @_;
+
+    return debtriplet_to_debarch(gnutriplet_to_debtriplet($gnu));
+}
+
 sub debwildcard_to_debtriplet($)
 {
     local ($_) = @_;
diff --git a/scripts/dpkg-architecture.pl b/scripts/dpkg-architecture.pl
index 3ea9499..ad9dd3d 100755
--- a/scripts/dpkg-architecture.pl
+++ b/scripts/dpkg-architecture.pl
@@ -27,7 +27,8 @@ use Dpkg::Gettext;
 use Dpkg::ErrorHandling qw(warning syserr usageerr);
 use Dpkg::Arch qw(get_valid_arches debarch_eq debarch_is
                   debtriplet_to_gnutriplet gnutriplet_to_debtriplet
-                  debtriplet_to_debarch debarch_to_debtriplet);
+                  debtriplet_to_debarch debarch_to_debtriplet
+                  debarch_to_gnutriplet gnutriplet_to_debarch);
 
 textdomain("dpkg-dev");
 
@@ -125,7 +126,7 @@ while (@ARGV) {
 
 chomp (my $deb_build_arch = `dpkg --print-architecture`);
 &syserr("dpkg --print-architecture failed") if $?>>8;
-my $deb_build_gnu_type = 
debtriplet_to_gnutriplet(debarch_to_debtriplet($deb_build_arch));
+my $deb_build_gnu_type = debarch_to_gnutriplet($deb_build_arch);
 
 # Default host: Current gcc.
 my $gcc = `\${CC:-gcc} -dumpmachine`;
@@ -157,17 +158,17 @@ if (!defined($deb_host_arch)) {
 }
 
 if ($req_host_arch ne '' && $req_host_gnu_type eq '') {
-    $req_host_gnu_type = 
debtriplet_to_gnutriplet(debarch_to_debtriplet($req_host_arch));
+    $req_host_gnu_type = debarch_to_gnutriplet($req_host_arch);
     die (sprintf(_g("unknown Debian architecture %s, you must specify GNU 
system type, too"), $req_host_arch)) unless defined $req_host_gnu_type;
 }
 
 if ($req_host_gnu_type ne '' && $req_host_arch eq '') {
-    $req_host_arch = 
debtriplet_to_debarch(gnutriplet_to_debtriplet($req_host_gnu_type));
+    $req_host_arch = gnutriplet_to_debarch($req_host_gnu_type);
     die (sprintf(_g("unknown GNU system type %s, you must specify Debian 
architecture, too"), $req_host_gnu_type)) unless defined $req_host_arch;
 }
 
 if ($req_host_gnu_type ne '' && $req_host_arch ne '') {
-    my $dfl_host_gnu_type = 
debtriplet_to_gnutriplet(debarch_to_debtriplet($req_host_arch));
+    my $dfl_host_gnu_type = debarch_to_gnutriplet($req_host_arch);
     die (sprintf(_g("unknown default GNU system type for Debian architecture 
%s"),
                  $req_host_arch))
        unless defined $dfl_host_gnu_type;

commit 9b07d03f0f0c6043916882a8d7ac704a67ce8341
Author: Guillem Jover <[EMAIL PROTECTED]>
Date:   Sun Nov 4 02:12:41 2007 +0200

    dpkg-architecture: Perform -L actions inside argument processing loop
    
    To preserve the same behaviour move the initialization of host and build
    variables after the argument processing loop.

diff --git a/ChangeLog b/ChangeLog
index c46d2c9..adad184 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2007-11-04  Guillem Jover  <[EMAIL PROTECTED]>
 
+       * scripts/dpkg-architecture.pl: Move setting of host and build arch
+       variables after argument processing. Call list_arches from argument
+       processing loop. Move architecture listing to ...
+       (list_arches): ... here. New function.
+
+2007-11-04  Guillem Jover  <[EMAIL PROTECTED]>
+
        * scripts/Dpkg/Arch.pm (get_valid_arches): Return an array instead of
        printing the architectures.
 
diff --git a/scripts/dpkg-architecture.pl b/scripts/dpkg-architecture.pl
index e44d50f..3ea9499 100755
--- a/scripts/dpkg-architecture.pl
+++ b/scripts/dpkg-architecture.pl
@@ -67,47 +67,11 @@ Actions:
 "), $progname;
 }
 
-# Check for -L
-if (grep { m/^-L$/ } @ARGV) {
+sub list_arches()
+{
     foreach my $arch (get_valid_arches()) {
        print "$arch\n";
     }
-    exit unless $#ARGV;
-}
-
-# Set default values:
-
-chomp (my $deb_build_arch = `dpkg --print-architecture`);
-&syserr("dpkg --print-architecture failed") if $?>>8;
-my $deb_build_gnu_type = 
debtriplet_to_gnutriplet(debarch_to_debtriplet($deb_build_arch));
-
-# Default host: Current gcc.
-my $gcc = `\${CC:-gcc} -dumpmachine`;
-if ($?>>8) {
-    warning(_g("Couldn't determine gcc system type, falling back to default 
(native compilation)"));
-    $gcc = '';
-} else {
-    chomp $gcc;
-}
-
-my $deb_host_arch = undef;
-my $deb_host_gnu_type;
-
-if ($gcc ne '') {
-    my (@deb_host_archtriplet) = gnutriplet_to_debtriplet($gcc);
-    $deb_host_arch = debtriplet_to_debarch(@deb_host_archtriplet);
-    unless (defined $deb_host_arch) {
-       warning(_g("Unknown gcc system type %s, falling back to default " .
-                  "(native compilation)"), $gcc);
-       $gcc = '';
-    } else {
-       $gcc = $deb_host_gnu_type = 
debtriplet_to_gnutriplet(@deb_host_archtriplet);
-    }
-}
-if (!defined($deb_host_arch)) {
-    # Default host: Native compilation.
-    $deb_host_arch = $deb_build_arch;
-    $deb_host_gnu_type = $deb_build_gnu_type;
 }
 
 
@@ -144,7 +108,8 @@ while (@ARGV) {
        $action = 'c';
        last;
     } elsif (m/^-L$/) {
-       # Handled already
+        list_arches();
+        exit unless @ARGV;
     } elsif (m/^-(h|-help)$/) {
        &usage;
        exit 0;
@@ -156,6 +121,41 @@ while (@ARGV) {
     }
 }
 
+# Set default values:
+
+chomp (my $deb_build_arch = `dpkg --print-architecture`);
+&syserr("dpkg --print-architecture failed") if $?>>8;
+my $deb_build_gnu_type = 
debtriplet_to_gnutriplet(debarch_to_debtriplet($deb_build_arch));
+
+# Default host: Current gcc.
+my $gcc = `\${CC:-gcc} -dumpmachine`;
+if ($?>>8) {
+    warning(_g("Couldn't determine gcc system type, falling back to default 
(native compilation)"));
+    $gcc = '';
+} else {
+    chomp $gcc;
+}
+
+my $deb_host_arch = undef;
+my $deb_host_gnu_type;
+
+if ($gcc ne '') {
+    my (@deb_host_archtriplet) = gnutriplet_to_debtriplet($gcc);
+    $deb_host_arch = debtriplet_to_debarch(@deb_host_archtriplet);
+    unless (defined $deb_host_arch) {
+       warning(_g("Unknown gcc system type %s, falling back to default " .
+                  "(native compilation)"), $gcc);
+       $gcc = '';
+    } else {
+       $gcc = $deb_host_gnu_type = 
debtriplet_to_gnutriplet(@deb_host_archtriplet);
+    }
+}
+if (!defined($deb_host_arch)) {
+    # Default host: Native compilation.
+    $deb_host_arch = $deb_build_arch;
+    $deb_host_gnu_type = $deb_build_gnu_type;
+}
+
 if ($req_host_arch ne '' && $req_host_gnu_type eq '') {
     $req_host_gnu_type = 
debtriplet_to_gnutriplet(debarch_to_debtriplet($req_host_arch));
     die (sprintf(_g("unknown Debian architecture %s, you must specify GNU 
system type, too"), $req_host_arch)) unless defined $req_host_gnu_type;

commit cd1ce010c0aa39dd4b030527c2c23f2df6bea6c1
Author: Guillem Jover <[EMAIL PROTECTED]>
Date:   Sun Nov 4 02:05:14 2007 +0200

    Dpkg::Arch: Instead of printing make get_valid_arches return an array

diff --git a/ChangeLog b/ChangeLog
index da778b5..c46d2c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-11-04  Guillem Jover  <[EMAIL PROTECTED]>
+
+       * scripts/Dpkg/Arch.pm (get_valid_arches): Return an array instead of
+       printing the architectures.
+
 2007-10-18  Raphael Hertzog  <[EMAIL PROTECTED]>
 
        * scripts/Dpkg/Deps.pm: new module to handle dependencies, to
diff --git a/scripts/Dpkg/Arch.pm b/scripts/Dpkg/Arch.pm
index 3cf7e4d..7ffca35 100644
--- a/scripts/Dpkg/Arch.pm
+++ b/scripts/Dpkg/Arch.pm
@@ -38,12 +38,16 @@ sub get_valid_arches()
     read_cputable() if ([EMAIL PROTECTED]);
     read_ostable() if ([EMAIL PROTECTED]);
 
+    my @arches;
+
     foreach my $os (@os) {
        foreach my $cpu (@cpu) {
            my $arch = debtriplet_to_debarch(split(/-/, $os, 2), $cpu);
-           print $arch."\n" if defined($arch);
+           push @arches, $arch if defined($arch);
        }
     }
+
+    return @arches;
 }
 
 sub read_cputable

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to