[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#845969: marked as done (apt: Support explicit architecture for ParseDepends architecture filter)



Your message dated Thu, 05 Jan 2017 21:03:45 +0000
with message-id <E1cPFCL-00085H-A2@fasolo.debian.org>
and subject line Bug#845969: fixed in apt 1.4~beta3
has caused the Debian Bug report #845969,
regarding apt: Support explicit architecture for ParseDepends architecture filter
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
845969: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=845969
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: apt
Version: 1.3.1
Severity: wishlist
Tags: patch

Hi,

The provided patch adds an optional "Arch" parameter to the
ParseDepends, which can be used to override the implicit
_config->Find("APT::Architecture").  This would be helpful for
e.g. Britney, where we would like to parse the Build-Depends for
multiple architectures.
  With this patch (and a similar change to python-apt), Britney can
parse the Build-Depends without having to mess with the global state
configuration.

The attached patch is /not/ build tested as I had issues getting past
the configure step.

Thanks,
~Niels
>From ad81bc49f0ce63e30dbadf9b11b8d484b2a0ddf6 Mon Sep 17 00:00:00 2001
From: Niels Thykier <niels@thykier.net>
Date: Sun, 27 Nov 2016 10:54:33 +0000
Subject: [PATCH] ParseDepends: Support passing the desired architecture

This is useful for e.g. Britney, where the Build-Depends would have to
be parsed for multiple architectures.  With this change, the call can
choose the architecture without having to mess with the config.

Signed-off-by: Niels Thykier <niels@thykier.net>
---
 apt-pkg/deb/deblistparser.cc | 28 +++++++++++++++++++++++++---
 apt-pkg/deb/deblistparser.h  | 16 ++++++++++++++++
 2 files changed, 41 insertions(+), 3 deletions(-)

diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index 0fc08d8..5f16752 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -547,11 +547,23 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop,
 					bool const &StripMultiArch,
 					bool const &ParseRestrictionsList)
 {
+   return debListParser::ParseDepends(Start, Stop, Package, Ver, Op, ParseArchFlags,
+                                      StripMultiArch, ParseRestrictionsList,
+                                      _config->Find("APT::Architecture"));
+}
+
+const char *debListParser::ParseDepends(const char *Start,const char *Stop,
+					string &Package,string &Ver,
+					unsigned int &Op, bool const &ParseArchFlags,
+					bool const &StripMultiArch,
+					bool const &ParseRestrictionsList,
+                                        const string Arch)
+{
    StringView PackageView;
    StringView VerView;
 
    auto res = ParseDepends(Start, Stop, PackageView, VerView, Op, (bool)ParseArchFlags,
-   (bool) StripMultiArch, (bool) ParseRestrictionsList);
+   (bool) StripMultiArch, (bool) ParseRestrictionsList, Arch);
    Package = PackageView.to_string();
    Ver = VerView.to_string();
 
@@ -563,6 +575,17 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop,
 					bool StripMultiArch,
 					bool ParseRestrictionsList)
 {
+   return debListParser::ParseDepends(Start, Stop, Package, Ver, Op, ParseArchFlags,
+                                      StripMultiArch, ParseRestrictionsList,
+                                      _config->Find("APT::Architecture"));
+}
+
+const char *debListParser::ParseDepends(const char *Start,const char *Stop,
+					StringView &Package,StringView &Ver,
+					unsigned int &Op, bool ParseArchFlags,
+					bool StripMultiArch,
+					bool ParseRestrictionsList, string const Arch)
+{
    // Strip off leading space
    for (;Start != Stop && isspace_ascii(*Start) != 0; ++Start);
    
@@ -630,8 +653,7 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop,
 
    if (unlikely(ParseArchFlags == true))
    {
-      string const arch = _config->Find("APT::Architecture");
-      APT::CacheFilter::PackageArchitectureMatchesSpecification matchesArch(arch, false);
+      APT::CacheFilter::PackageArchitectureMatchesSpecification matchesArch(Arch, false);
 
       // Parse an architecture
       if (I != Stop && *I == '[')
diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h
index 3d50659..9162717 100644
--- a/apt-pkg/deb/deblistparser.h
+++ b/apt-pkg/deb/deblistparser.h
@@ -102,6 +102,16 @@ class APT_HIDDEN debListParser : public pkgCacheListParser
 	 std::string &Package,std::string &Ver,unsigned int &Op,
 	 bool const &ParseArchFlags, bool const &StripMultiArch,
 	 bool const &ParseRestrictionsList);
+   APT_PUBLIC static const char *ParseDepends(const char *Start,const char *Stop,
+	 std::string &Package,std::string &Ver,unsigned int &Op,
+	 bool const &ParseArchFlags, bool const &StripMultiArch,
+	 bool const &ParseRestrictionsList);
+
+   APT_PUBLIC static const char *ParseDepends(const char *Start,const char *Stop,
+	 std::string &Package,std::string &Ver,unsigned int &Op,
+	 bool const &ParseArchFlags, bool const &StripMultiArch,
+	 bool const &ParseRestrictionsList,
+	 string const Arch);
 
 #ifdef APT_PKG_EXPOSE_STRING_VIEW
    APT_HIDDEN static const char *ParseDepends(const char *Start,const char *Stop,
@@ -109,6 +119,12 @@ class APT_HIDDEN debListParser : public pkgCacheListParser
     APT::StringView &Ver,unsigned int &Op,
 	 bool const ParseArchFlags = false, bool StripMultiArch = true,
 	 bool const ParseRestrictionsList = false);
+   APT_HIDDEN static const char *ParseDepends(const char *Start,const char *Stop,
+	 APT::StringView &Package,
+	 APT::StringView &Ver,unsigned int &Op,
+	 bool const ParseArchFlags = false, bool StripMultiArch = true,
+	 bool const ParseRestrictionsList = false,
+	 string const Arch);
 #endif
 
    APT_PUBLIC static const char *ConvertRelation(const char *I,unsigned int &Op);
-- 
2.10.2


--- End Message ---
--- Begin Message ---
Source: apt
Source-Version: 1.4~beta3

We believe that the bug you reported is fixed in the latest version of
apt, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 845969@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Julian Andres Klode <jak@debian.org> (supplier of updated apt package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Thu, 05 Jan 2017 20:50:01 +0100
Source: apt
Binary: apt libapt-pkg5.0 libapt-inst2.0 apt-doc libapt-pkg-dev libapt-pkg-doc apt-utils apt-transport-https
Architecture: source
Version: 1.4~beta3
Distribution: unstable
Urgency: medium
Maintainer: APT Development Team <deity@lists.debian.org>
Changed-By: Julian Andres Klode <jak@debian.org>
Description:
 apt        - commandline package manager
 apt-doc    - documentation for APT
 apt-transport-https - https download transport for APT
 apt-utils  - package management related utility programs
 libapt-inst2.0 - deb package format runtime library
 libapt-pkg-dev - development files for APT's libapt-pkg and libapt-inst
 libapt-pkg-doc - documentation for APT development
 libapt-pkg5.0 - package management runtime library
Closes: 440057 709092 724744 813786 845775 845969 846514 849235
Changes:
 apt (1.4~beta3) unstable; urgency=medium
 .
   [ Lukasz Kawczynski ]
   * Honour Acquire::ForceIPv4/6 in the https transport
 .
   [ David Kalnischkies ]
   * reword "Can't drop priv" warning message (Closes: #813786) (LP: #1522675)
   * let {dsc,tar,diff}-only implicitly enable download-only
   * remove needless fork() in apt-get source
   * default to --no-check for dpkg-source call (Closes: 724744)
   * warn if clearsigned file has ignored content parts
   * ensure generation of valid EDSP error stanzas
   * add --indep-only for build-dep command (Closes: #845775)
   * allow default build-essentials to be overridden
   * expand -f to --fix-broken in error messages.
     Thanks to Kristian Glass for initial patch! (Closes: #709092)
   * separating state variables regarding server/request (Closes: #440057)
   * fix minimum pkgs option for dpkg --recursive usage
   * allow warning generation for non-whitelisted options
 .
   [ Oriol Debian ]
   * Catalan program translation update (Closes: #846514)
 .
   [ Frans Spiesschaert ]
   * Dutch manpages translation update (Closes: #849235)
 .
   [ Niels Thykier ]
   * ParseDepends: Support passing the desired architecture (Closes: #845969)
Checksums-Sha1:
 79cec732b9721a4a3ba432ba491346c760791344 2565 apt_1.4~beta3.dsc
 13b1b47165d69252810c6f84ae0019c7554c5640 2061292 apt_1.4~beta3.tar.xz
Checksums-Sha256:
 04428e7fbb0887bafe598ec5ad0589b757b2956c622a8aa638ed5f8a956a1c08 2565 apt_1.4~beta3.dsc
 f721b03fa3f8a2013fdd0f42312f765143ccc98f0f0c07fb4c78d82794314ea4 2061292 apt_1.4~beta3.tar.xz
Files:
 01076a1136405b99601664e190cda817 2565 admin important apt_1.4~beta3.dsc
 e43e896bc4c7a1e8e40d67804ad3410f 2061292 admin important apt_1.4~beta3.tar.xz

-----BEGIN PGP SIGNATURE-----

iQJDBAEBCgAtFiEEzeVhi4gF/W4gLOnC1zw55WWAs4YFAlhupD4PHGpha0BkZWJp
YW4ub3JnAAoJENc8OeVlgLOGn/4P/jqzBcEyOLCCsGXesOJ6Gur8TjO1yfpVydy0
jboAF7O11sgEDsVHSMfVeIvIK/CCqPo9D9aSfaKmGxxeg6w2LiPvyGZzw8eOAyFo
3hZQTqKIoM31AaPPRoGJRWJR5k95Mh+NtQHbWxsXVFP7AF/FUQ6xQn6PrciiHGR8
8VYIZ3v2Ev/Qs4qKcMbedyy3ePZdVrLDbROdVOtI+XZnoxLY7O5BjFkbc4jEMtxE
1gbkdLxxKj/+y+Ofc6wfXYjuzct5mJyfXO3gWYMisEdbr+vTifEDqzCr8c7UQwZI
FHkEG+/0EYiVslPcpY8soDsQ3KnNcSpRsEj4/0afspVEfvuyFX5UIKRTeKoK6Y+z
iG4orZkOAxRtkejDihdYFkhPUX1LOdFpK6R9BJ25liZI19+1L12maTDUEyJ5PqOO
aUXRne3/rVVeSee1BkzjrHSPb9rRoPukVBCKhxVwMwljK1efOcTltVON0YCYDlJZ
+fWusVjNFwLARuU2Ut+VCWuHLD6h7nmNZ1n8mupnWKbYk5SUr0QATQKy04E6uJIE
+OApCwvne2EZWRRrrHKKVCbxFqB+kpFIISLtKlB/MlUvDndOivKfceDGd/TWwrT0
+hcbzjKF3O7pnmUJfT9HVjpxy+QkyI4Zg7gj2YiSEXbNIpnzD5xW5KLYnL1vY9aY
FOEB4RuH
=RM2y
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: