The following commit has been merged in the master branch:
commit e8950d7e2d4a58f96c74782825e2edf7ceb583ca
Author: Colin Watson <[email protected]>
Date:   Tue Jan 8 03:57:23 2013 +0100

    Dpkg::Deps: Add support for a build_arch option in deps_parse()
    
    Dpkg::Deps::deps_parse takes a host_arch option, but doesn't take a
    corresponding build_arch option. This means that if you're evaluating
    dependencies relative to a non-default build architecture, you get
    Dpkg::Deps::* objects back with the wrong build_arch set, which may
    cause unexpected behaviour later in simplify_deps.
    
    Closes: #697297
    
    Signed-off-by: Guillem Jover <[email protected]>

diff --git a/debian/changelog b/debian/changelog
index bce4d52..a58d449 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -110,6 +110,8 @@ dpkg (1.17.0) UNRELEASED; urgency=low
   * Support parsing compressed changelog files transparently. Closes: #684196
   * Sort files inside new diffs generated by dpkg-source lexicographically.
     Closes: #689193
+  * Add support for a build_arch option in Dpkg::Deps deps_parse().
+    Thanks to Colin Watson <[email protected]>. Closes: #697297
 
   [ Updated programs translations ]
   * Fix typo in Spanish translation of update-alternatives.
diff --git a/scripts/Dpkg/Deps.pm b/scripts/Dpkg/Deps.pm
index dfd79db..449bafb 100644
--- a/scripts/Dpkg/Deps.pm
+++ b/scripts/Dpkg/Deps.pm
@@ -273,6 +273,11 @@ Set to 0 to completely ignore that information.
 Define the host architecture. By default it uses
 Dpkg::Arch::get_host_arch() to identify the proper architecture.
 
+=item build_arch (defaults to the current architecture)
+
+Define the build architecture. By default it uses
+Dpkg::Arch::get_build_arch() to identify the proper architecture.
+
 =item reduce_arch (defaults to 0)
 
 If set to 1, ignore dependencies that do not concern the current host
@@ -300,6 +305,7 @@ sub deps_parse {
     $options{use_arch} = 1 if not exists $options{use_arch};
     $options{reduce_arch} = 0 if not exists $options{reduce_arch};
     $options{host_arch} = get_host_arch() if not exists $options{host_arch};
+    $options{build_arch} = get_build_arch() if not exists $options{build_arch};
     $options{union} = 0 if not exists $options{union};
     $options{build_dep} = 0 if not exists $options{build_dep};
 
@@ -313,6 +319,8 @@ sub deps_parse {
         foreach my $dep_or (split(/\s*\|\s*/m, $dep_and)) {
            my $dep_simple = Dpkg::Deps::Simple->new($dep_or, host_arch =>
                                                     $options{host_arch},
+                                                    build_arch =>
+                                                    $options{build_arch},
                                                     build_dep =>
                                                     $options{build_dep});
            if (not defined $dep_simple->{package}) {

-- 
dpkg's main repository


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

Reply via email to