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

Bug#812212: marked as done (apt: Please handle <libc>-linux-<cpu> as linux-any in dependency resolution)



Your message dated Thu, 04 Feb 2016 22:34:59 +0000
with message-id <E1aRSUN-00078u-Da@franck.debian.org>
and subject line Bug#812212: fixed in apt 1.2.2
has caused the Debian Bug report #812212,
regarding apt: Please handle <libc>-linux-<cpu> as linux-any in dependency resolution
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.)


-- 
812212: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=812212
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: apt
Version: 1.2
Severity: normal
Tags: patch
User: balint@balintreczey.hu
Usertags: hardened1-linux-amd64


Dear APT Maintainers,

There are differences in architecture handling logic between dpkg and APT.
The attached patch brings APT closer to what dpkg accepts.
Please consider accepting the patch which would help bootstrapping the
musl-linux-<cpu> and hardened1-linux-<cpu> architectures.

Thanks in advance,
Balint

PS: There is a related bug, #748936, but that patch does not change
handling of CPU wildcards.
From 8c2ae82356b76eea84e008a1df30c60555747ef3 Mon Sep 17 00:00:00 2001
From: Balint Reczey <balint@balintreczey.hu>
Date: Thu, 21 Jan 2016 15:17:01 +0100
Subject: [PATCH] Match <libc>-<kernel>-<cpu> triplets like dpkg

---
 apt-pkg/cachefilter.cc           | 32 +++++++++++++++++++++-----------
 apt-pkg/cachefilter.h            |  2 +-
 test/libapt/parsedepends_test.cc | 22 ++++++++++++++++++++++
 3 files changed, 44 insertions(+), 12 deletions(-)

diff --git a/apt-pkg/cachefilter.cc b/apt-pkg/cachefilter.cc
index 4362f43..ef39b3c 100644
--- a/apt-pkg/cachefilter.cc
+++ b/apt-pkg/cachefilter.cc
@@ -68,19 +68,29 @@ bool PackageNameMatchesFnmatch::operator() (pkgCache::GrpIterator const &Grp) {
    return fnmatch(Pattern.c_str(), Grp.Name(), FNM_CASEFOLD) == 0;
 }
 									/*}}}*/
-// Architecture matches <kernel>-<cpu> specification			/*{{{*/
+// Architecture matches <libc>-<kernel>-<cpu> specification		/*{{{*/
 //----------------------------------------------------------------------
-/* The complete architecture, consisting of <kernel>-<cpu>. */
+/* The complete architecture, consisting of <libc>-<kernel>-<cpu>. */
 static std::string CompleteArch(std::string const &arch) {
-	if (arch.find('-') != std::string::npos) {
-		// ensure that only -any- is replaced and not something like company-
-		std::string complete = std::string("-").append(arch).append("-");
-		complete = SubstVar(complete, "-any-", "-*-");
-		complete = complete.substr(1, complete.size()-2);
-		return complete;
-	}
-	else if (arch == "any")			return "*-*";
-	else					return "linux-" + arch;
+  std::size_t found = arch.find('-');
+  if (found != std::string::npos) {
+    std::string complete = std::string("-").append(arch).append("-");
+    complete = SubstVar(complete, "-any-", "-*-");
+    // ensure that only -any- is replaced and not something like company-
+    complete = complete.substr(1, complete.size()-2);
+    if (arch.find('-', found+1) != std::string::npos) {
+      // <libc>-<kernel>-<cpu> format
+      return complete;
+    } else {
+      // <kernel>-<cpu> format
+      return "*-" + complete;
+    }
+  }
+  else
+    if (arch == "any")
+      return "*-*-*";
+    else
+      return "gnu-linux-" + arch;
 }
 PackageArchitectureMatchesSpecification::PackageArchitectureMatchesSpecification(std::string const &pattern, bool const isPattern) :
 					literal(pattern), complete(CompleteArch(pattern)), isPattern(isPattern) {
diff --git a/apt-pkg/cachefilter.h b/apt-pkg/cachefilter.h
index 9970b5b..6646f6c 100644
--- a/apt-pkg/cachefilter.h
+++ b/apt-pkg/cachefilter.h
@@ -119,7 +119,7 @@ class PackageArchitectureMatchesSpecification : public PackageMatcher {	/*{{{*/
    or the whole string, can be the wildcard "any" as defined in
    debian-policy §11.1 "Architecture specification strings".
 
-   Examples: i386, mipsel, linux-any, any-amd64, any */
+   Examples: i386, mipsel, musl-linux-amd64, linux-any, any-amd64, any */
 	std::string literal;
 	std::string complete;
 	bool isPattern;
diff --git a/test/libapt/parsedepends_test.cc b/test/libapt/parsedepends_test.cc
index f644599..1d62b33 100644
--- a/test/libapt/parsedepends_test.cc
+++ b/test/libapt/parsedepends_test.cc
@@ -31,6 +31,8 @@ static void parseDependency(bool const StripMultiArch,  bool const ParseArchFlag
       "not-for-darwin [ !darwin-any ], "
       "cpu-for-me [ any-amd64 ], "
       "os-for-me [ linux-any ], "
+      "libc-for-me [ gnu-linux-any ], "
+      "libc-not-for-me [ musl-linux-any ], "
       "cpu-not-for-me [ any-armel ], "
       "os-not-for-me [ kfreebsd-any ], "
       "not-in-stage1 <!stage1>, "
@@ -147,6 +149,26 @@ static void parseDependency(bool const StripMultiArch,  bool const ParseArchFlag
 
    if (ParseArchFlags == true) {
       Start = debListParser::ParseDepends(Start, End, Package, Version, Op, ParseArchFlags, StripMultiArch, ParseRestrictionsList);
+      EXPECT_EQ("libc-for-me", Package);
+      EXPECT_EQ("", Version);
+      EXPECT_EQ(Null | pkgCache::Dep::NoOp, Op);
+   } else {
+      EXPECT_EQ(true, 0 == debListParser::ParseDepends(Start, End, Package, Version, Op, ParseArchFlags, StripMultiArch, ParseRestrictionsList));
+      Start = strstr(Start, ",");
+      Start++;
+   }
+
+   if (ParseArchFlags == true) {
+      Start = debListParser::ParseDepends(Start, End, Package, Version, Op, ParseArchFlags, StripMultiArch, ParseRestrictionsList);
+      EXPECT_EQ("", Package); // libc-not-for-me
+   } else {
+      EXPECT_EQ(true, 0 == debListParser::ParseDepends(Start, End, Package, Version, Op, ParseArchFlags, StripMultiArch, ParseRestrictionsList));
+      Start = strstr(Start, ",");
+      Start++;
+   }
+
+   if (ParseArchFlags == true) {
+      Start = debListParser::ParseDepends(Start, End, Package, Version, Op, ParseArchFlags, StripMultiArch, ParseRestrictionsList);
       EXPECT_EQ("os-for-me", Package);
       EXPECT_EQ("", Version);
       EXPECT_EQ(Null | pkgCache::Dep::NoOp, Op);
-- 
2.1.4


--- End Message ---
--- Begin Message ---
Source: apt
Source-Version: 1.2.2

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 812212@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, 04 Feb 2016 22:50:43 +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.2.2
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: 137560 444930 489911 583914 728317 807367 809329 812111 812173 812212 812492 812497 813467
Changes:
 apt (1.2.2) unstable; urgency=medium
 .
   [ David Kalnischkies ]
   * always create pkg at the time pkg:arch is created
   * reimplement build-dep via apts normal resolver
     (Closes: #137560, #444930, #489911, #583914, #728317, #812173)
   * parse version correctly from binary Source field (Closes: 812492)
   * get sources for packages in multiple releases again (Closes: 812497)
   * only warn about missing/invalid Date field for now (Closes: 809329)
   * support <libc>-<kernel>-<cpu> in architecture specs.
     Thanks to Bálint Réczey for initial patch (Closes: #812212)
   * avoid building dependency tree in 'source' command
 .
   [ Stefan Bühler ]
   * fix "Mismatched free() / delete / delete []" in simple_buffer
 .
   [ Julian Andres Klode ]
   * Do not buffer writes larger than the buffer if possible
   * Drop the g++ build-dep, transition is done
   * NEWS: Prefix the keep deb option with Binary::apt:: (Closes: #812111)
   * rred: If there were I/O errors, fail
   * Correctly report write errors when flushing buffered writer
   * test: Fix apt-key tests to work with current gpg 2.1
 .
   [ Manuel "Venturi" Porras Peralta ]
   * Spanish program translation update (Closes: 813467)
 .
   [ Adrian Wielgosik ]
   * Try avoiding loading long package description
   * Avoid temporary strings in SubstVar.
 .
   [ Fredrik Fornwall ]
   * edspsystem.cc: include <stdlib.h> for mkdtemp (Closes: #807367)
Checksums-Sha1:
 a1bf8d6269d68fde1151ac9afe1db3edb99beaf5 2323 apt_1.2.2.dsc
 4acb1323da073be650d625e245529deea3ebbc43 2018908 apt_1.2.2.tar.xz
Checksums-Sha256:
 1fcc4e2acca9e82143a35f2dcc86ffd2ae20f39579bffe01580b14d694c170fb 2323 apt_1.2.2.dsc
 9ce1dcdc5e53057ad7647856fcb4e12580c9b164a59f46967fecacc1be2dea35 2018908 apt_1.2.2.tar.xz
Files:
 58b341a17601bedb6da245292ceb2284 2323 admin important apt_1.2.2.dsc
 8e820f5e87aa6d188c36c6fbe4ab2a5f 2018908 admin important apt_1.2.2.tar.xz

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

iQIcBAEBCgAGBQJWs8jFAAoJENc8OeVlgLOGHtEP/R0gdtDVQGn8Cy2vCb366tfa
KX7xgf1J3Uy6jBERio5xJbkXVoxwR6o/+l41LnE5khBTFiWhdYC2FKupwgHJsqV2
8NCEq3AishPzcjHyvPmemRxGxst1fQIVPJqH6fWryoFQ2/6gRjCG1CgTrbxVwh1C
wpiGWmxIdug1H3IFaMSfjY/4cfMmCu/7JvsgYSenQKskdfHYpvn7W8ZoKTgj+aIu
p7DOv1h2n7qCX8jI7CTX1uhVQkpiWjVDhVQXrv5IqsLXqdIx29gF6qdfaGCkSd4i
MBpEFTenlQsNDTKF14Jr0wIzgZMJsvJXSzcBUhljHKZ8W8748RV6ocIO3/mTEYaM
Sy5ARIU5IX+3t5sDhwWDm6LMO0KLa7QX+PJ6HJfksc1fn2EzYthInot2/tD4mfMe
RrHpHgi9wdUCV+20339PM22QRLVawjqqb92mXLioMaT0nFTkrU81ROTk3YoWP/OM
1yjMNfFLVTiXWqqN3n2H4lxPDJCXHB3jOPlw9KRmfXVC5jTQG5exM5TWxQaUYgEU
28rOr99UIZgUuxtaaWxjsr4ydLiwpXnskCbEW6M+jcBNi/o350eArXjjM7TYzOb4
ptI+Eu2fCPbbrIr1GBJVkGhQy+OM1CNU1N1U/Gltud1Wf95jx80lyW4PUTvN/eds
ozhB9rUtrE8Bed1P8uZr
=KlTM
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: