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

Merge remote-tracking branch 'upstream/debian/jessie' into debian/sid

Conflicts:
	apt-pkg/deb/dpkgpm.cc
Michael Vogt лет назад: 11
Родитель
Сommit
0f3150e704
61 измененных файлов с 22563 добавлено и 22273 удалено
  1. 12 2
      apt-pkg/acquire-item.cc
  2. 1 1
      apt-pkg/contrib/strutl.h
  3. 1 1
      apt-pkg/deb/deblistparser.cc
  4. 0 4
      apt-pkg/deb/dpkgpm.cc
  5. 1 13
      apt-pkg/pkgcache.cc
  6. 1 1
      apt-pkg/pkgcache.h
  7. 1 1
      apt-private/private-cmndline.cc
  8. 1 1
      cmdline/apt-key.in
  9. 1 1
      configure.ac
  10. 29 0
      debian/changelog
  11. 1 1
      doc/apt-verbatim.ent
  12. 2 2
      doc/po/apt-doc.pot
  13. 4 14
      methods/https.cc
  14. 492 492
      po/apt-all.pot
  15. 493 493
      po/ar.po
  16. 519 519
      po/ast.po
  17. 521 521
      po/bg.po
  18. 506 506
      po/bs.po
  19. 496 496
      po/ca.po
  20. 519 519
      po/cs.po
  21. 507 507
      po/cy.po
  22. 517 517
      po/da.po
  23. 497 497
      po/de.po
  24. 516 516
      po/dz.po
  25. 494 494
      po/el.po
  26. 516 516
      po/es.po
  27. 509 509
      po/eu.po
  28. 508 508
      po/fi.po
  29. 505 505
      po/fr.po
  30. 499 499
      po/gl.po
  31. 501 501
      po/hu.po
  32. 492 492
      po/it.po
  33. 515 515
      po/ja.po
  34. 508 508
      po/km.po
  35. 514 514
      po/ko.po
  36. 493 493
      po/ku.po
  37. 508 508
      po/lt.po
  38. 479 479
      po/mr.po
  39. 516 516
      po/nb.po
  40. 516 516
      po/ne.po
  41. 500 500
      po/nl.po
  42. 513 513
      po/nn.po
  43. 495 495
      po/pl.po
  44. 517 517
      po/pt.po
  45. 485 485
      po/pt_BR.po
  46. 494 494
      po/ro.po
  47. 493 493
      po/ru.po
  48. 517 517
      po/sk.po
  49. 497 497
      po/sl.po
  50. 516 516
      po/sv.po
  51. 507 507
      po/th.po
  52. 480 480
      po/tl.po
  53. 500 500
      po/tr.po
  54. 498 498
      po/uk.po
  55. 491 491
      po/vi.po
  56. 507 507
      po/zh_CN.po
  57. 511 511
      po/zh_TW.po
  58. 6 0
      test/integration/test-apt-key
  59. 72 0
      test/integration/test-bug-782777-single-arch-weirdness
  60. 109 50
      test/integration/test-multiarch-foreign
  61. 144 4
      test/integration/test-specific-architecture-dependencies

+ 12 - 2
apt-pkg/acquire-item.cc

@@ -1194,8 +1194,18 @@ void pkgAcqIndex::Done(string Message,unsigned long long Size,string Hash,
    Desc.URI = decompProg + ":" + FileName;
    QueueURI(Desc);
 
-   // FIXME: this points to a c++ string that goes out of scope
-   Mode = decompProg.c_str();
+   if (decompProg == "copy")
+      Mode = "copy";
+   else if (decompProg == "xz")
+      Mode = "xz";
+   else if (decompProg == "lzma")
+      Mode = "lzma";
+   else if (decompProg == "bzip2")
+      Mode = "bzip2";
+   else if (decompProg == "gzip")
+      Mode = "gzip";
+   else
+      Mode = "decomp";
 }
 									/*}}}*/
 // AcqIndexTrans::pkgAcqIndexTrans - Constructor			/*{{{*/

+ 1 - 1
apt-pkg/contrib/strutl.h

@@ -79,7 +79,7 @@ bool TokSplitString(char Tok,char *Input,char **List,
 		    unsigned long ListMax);
 
 // split a given string by a char
-std::vector<std::string> VectorizeString(std::string const &haystack, char const &split) APT_CONST;
+std::vector<std::string> VectorizeString(std::string const &haystack, char const &split) APT_PURE;
 
 /* \brief Return a vector of strings from string "input" where "sep"
  * is used as the delimiter string.

+ 1 - 1
apt-pkg/deb/deblistparser.cc

@@ -770,7 +770,7 @@ bool debListParser::ParseDepends(pkgCache::VerIterator &Ver,
 	 if (NewDepends(Ver,Package,"none",Version,Op,Type) == false)
 	    return false;
       }
-      else if (MultiArchEnabled == true && found != string::npos &&
+      else if (found != string::npos &&
 	       strcmp(Package.c_str() + found, ":any") != 0)
       {
 	 string Arch = Package.substr(found+1, string::npos);

+ 0 - 4
apt-pkg/deb/dpkgpm.cc

@@ -1908,10 +1908,6 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg)
       "Purge",
       "ConfigurePending",
       "TriggersPending",
-      "reserved-1",
-      "reserved-2",
-      "reserved-3",
-      "reserved-4",
    };
    fprintf(report, "AptOrdering:\n");
    for (vector<Item>::iterator I = List.begin(); I != List.end(); ++I)

+ 1 - 13
apt-pkg/pkgcache.cc

@@ -230,12 +230,7 @@ pkgCache::PkgIterator pkgCache::SingleArchFindPkg(const string &Name)
 pkgCache::PkgIterator pkgCache::FindPkg(const string &Name) {
 	size_t const found = Name.find(':');
 	if (found == string::npos)
-	{
-		if (MultiArchCache() == false)
-			return SingleArchFindPkg(Name);
-		else
-			return FindPkg(Name, "native");
-	}
+	   return FindPkg(Name, "native");
 	string const Arch = Name.substr(found+1);
 	/* Beware: This is specialcased to handle pkg:any in dependencies as
 	   these are linked to virtual pkg:any named packages with all archs.
@@ -249,13 +244,6 @@ pkgCache::PkgIterator pkgCache::FindPkg(const string &Name) {
 // ---------------------------------------------------------------------
 /* Returns 0 on error, pointer to the package otherwise */
 pkgCache::PkgIterator pkgCache::FindPkg(const string &Name, string const &Arch) {
-	if (MultiArchCache() == false && Arch != "none") {
-		if (Arch == "native" || Arch == "all" || Arch == "any" ||
-		    Arch == NativeArch())
-			return SingleArchFindPkg(Name);
-		else
-			return PkgIterator(*this,0);
-	}
 	/* We make a detour via the GrpIterator here as
 	   on a multi-arch environment a group is easier to
 	   find than a package (less entries in the buckets) */

+ 1 - 1
apt-pkg/pkgcache.h

@@ -218,7 +218,7 @@ class pkgCache								/*{{{*/
 
 private:
    bool MultiArchEnabled;
-   PkgIterator SingleArchFindPkg(const std::string &Name);
+   APT_DEPRECATED PkgIterator SingleArchFindPkg(const std::string &Name);
 };
 									/*}}}*/
 // Header structure							/*{{{*/

+ 1 - 1
apt-private/private-cmndline.cc

@@ -165,7 +165,7 @@ static bool addArgumentsAPTGet(std::vector<CommandLine::Args> &Args, char const
       addArg(0, "color", "APT::Moo::Color", 0);
 
    if (CmdMatches("install", "remove", "purge", "upgrade", "dist-upgrade",
-	    "deselect-upgrade", "autoremove", "clean", "autoclean", "check",
+	    "dselect-upgrade", "autoremove", "clean", "autoclean", "check",
 	    "build-dep", "full-upgrade", "source"))
    {
       addArg('s', "simulate", "APT::Get::Simulate", 0);

+ 1 - 1
cmdline/apt-key.in

@@ -180,7 +180,7 @@ update() {
 remove_key_from_keyring() {
     local GPG="$GPG_CMD --keyring $1"
     # check if the key is in this keyring: the key id is in the 5 column at the end
-    if ! $GPG --with-colons --list-keys 2>&1 | grep -q "^pub:[^:]*:[^:]*:[^:]*:[0-9A-F]*$2:"; then
+    if ! $GPG --with-colons --list-keys 2>&1 | grep -iq "^pub:[^:]*:[^:]*:[^:]*:[0-9A-F]*$2:"; then
 	return
     fi
     if [ ! -w "$1" ]; then

+ 1 - 1
configure.ac

@@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib)
 AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in)
 
 PACKAGE="apt"
-PACKAGE_VERSION="1.0.9.6"
+PACKAGE_VERSION="1.0.9.8"
 PACKAGE_MAIL="APT Development Team <deity@lists.debian.org>"
 AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
 AC_DEFINE_UNQUOTED(PACKAGE_VERSION,"$PACKAGE_VERSION")

+ 29 - 0
debian/changelog

@@ -1,3 +1,32 @@
+apt (1.0.9.9) unstable; urgency=medium
+
+  [ David Kalnischkies ]
+  * parse specific-arch dependencies correctly on single-arch systems
+    (Closes: 777760)
+  * remove "first package seen is native package" assumption.
+    Thanks to Axel Beckert for testing (Closes: 782777)
+
+ -- David Kalnischkies <david@kalnischkies.de>  Tue, 28 Apr 2015 16:11:27 +0200
+
+apt (1.0.9.8) unstable; urgency=medium
+
+  [ David Kalnischkies ]
+  * fix another d(e)select-upgrade typo (LP: #1399037)
+  * properly handle expected filesize in https.
+    Thanks to Robert Edmonds and Anders Kaseorg for initial patchs
+    (Closes: 777565, 781509) (LP: #807303)
+  * avoid depends on std::string implementation for pkgAcquire::Item::Mode
+    (Closes: 781858)
+  * demote VectorizeString gcc attribute from const to pure
+  * keyids in "apt-key del" should be case-insensitive (Closes: 781696)
+  * parse specific-arch dependencies correctly on single-arch systems
+    (Closes: 777760)
+
+  [ Michael Vogt ]
+  * fix crash in order writing in pkgDPkgPM::WriteApportReport() (LP: #1436626)
+
+ -- David Kalnischkies <david@kalnischkies.de>  Mon, 13 Apr 2015 07:14:36 +0200
+
 apt (1.0.9.7) unstable; urgency=medium
 
   [ Tomasz Buchert ]

+ 1 - 1
doc/apt-verbatim.ent

@@ -225,7 +225,7 @@
 ">
 
 <!-- this will be updated by 'prepare-release' -->
-<!ENTITY apt-product-version "1.0.9.6">
+<!ENTITY apt-product-version "1.0.9.8">
 
 <!-- (Code)names for various things used all over the place -->
 <!ENTITY oldstable-codename "wheezy">

+ 2 - 2
doc/po/apt-doc.pot

@@ -6,9 +6,9 @@
 #, fuzzy
 msgid ""
 msgstr ""
-"Project-Id-Version: apt-doc 1.0.9.5\n"
+"Project-Id-Version: apt-doc 1.0.9.8\n"
 "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n"
-"POT-Creation-Date: 2015-01-16 04:37-0500\n"
+"POT-Creation-Date: 2015-04-13 07:23+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"

+ 4 - 14
methods/https.cc

@@ -68,6 +68,8 @@ HttpsMethod::parse_header(void *buffer, size_t size, size_t nmemb, void *userp)
 
       me->File->Truncate(me->Server->StartPos);
       me->File->Seek(me->Server->StartPos);
+
+      me->Res.Size = me->Server->Size;
    }
    else if (me->Server->HeaderLine(line) == false)
       return 0;
@@ -97,17 +99,6 @@ HttpsMethod::write_data(void *buffer, size_t size, size_t nmemb, void *userp)
    return buffer_size;
 }
 
-int
-HttpsMethod::progress_callback(void *clientp, double dltotal, double /*dlnow*/,
-                             double /*ultotal*/, double /*ulnow*/)
-{
-   HttpsMethod *me = (HttpsMethod *)clientp;
-   if(dltotal > 0 && me->Res.Size == 0) {
-      me->Res.Size = (unsigned long long)dltotal;
-   }
-   return 0;
-}
-
 // HttpsServerState::HttpsServerState - Constructor			/*{{{*/
 HttpsServerState::HttpsServerState(URI Srv,HttpsMethod * /*Owner*/) : ServerState(Srv, NULL)
 {
@@ -201,10 +192,8 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
    curl_easy_setopt(curl, CURLOPT_WRITEHEADER, this);
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, this);
-   curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback);
-   curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, this);
    // options
-   curl_easy_setopt(curl, CURLOPT_NOPROGRESS, false);
+   curl_easy_setopt(curl, CURLOPT_NOPROGRESS, true);
    curl_easy_setopt(curl, CURLOPT_FILETIME, true);
    // only allow curl to handle https, not the other stuff it supports
    curl_easy_setopt(curl, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);
@@ -357,6 +346,7 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
    // go for it - if the file exists, append on it
    File = new FileFd(Itm->DestFile, FileFd::WriteAny);
    Server = new HttpsServerState(Itm->Uri, this);
+   Res = FetchResult();
 
    // keep apt updated
    Res.Filename = Itm->DestFile;

Разница между файлами не показана из-за своего большого размера
+ 492 - 492
po/apt-all.pot


Разница между файлами не показана из-за своего большого размера
+ 493 - 493
po/ar.po


Разница между файлами не показана из-за своего большого размера
+ 519 - 519
po/ast.po


Разница между файлами не показана из-за своего большого размера
+ 521 - 521
po/bg.po


Разница между файлами не показана из-за своего большого размера
+ 506 - 506
po/bs.po


Разница между файлами не показана из-за своего большого размера
+ 496 - 496
po/ca.po


Разница между файлами не показана из-за своего большого размера
+ 519 - 519
po/cs.po


Разница между файлами не показана из-за своего большого размера
+ 507 - 507
po/cy.po


Разница между файлами не показана из-за своего большого размера
+ 517 - 517
po/da.po


Разница между файлами не показана из-за своего большого размера
+ 497 - 497
po/de.po


Разница между файлами не показана из-за своего большого размера
+ 516 - 516
po/dz.po


Разница между файлами не показана из-за своего большого размера
+ 494 - 494
po/el.po


Разница между файлами не показана из-за своего большого размера
+ 516 - 516
po/es.po


Разница между файлами не показана из-за своего большого размера
+ 509 - 509
po/eu.po


Разница между файлами не показана из-за своего большого размера
+ 508 - 508
po/fi.po


Разница между файлами не показана из-за своего большого размера
+ 505 - 505
po/fr.po


Разница между файлами не показана из-за своего большого размера
+ 499 - 499
po/gl.po


Разница между файлами не показана из-за своего большого размера
+ 501 - 501
po/hu.po


Разница между файлами не показана из-за своего большого размера
+ 492 - 492
po/it.po


Разница между файлами не показана из-за своего большого размера
+ 515 - 515
po/ja.po


Разница между файлами не показана из-за своего большого размера
+ 508 - 508
po/km.po


Разница между файлами не показана из-за своего большого размера
+ 514 - 514
po/ko.po


Разница между файлами не показана из-за своего большого размера
+ 493 - 493
po/ku.po


Разница между файлами не показана из-за своего большого размера
+ 508 - 508
po/lt.po


Разница между файлами не показана из-за своего большого размера
+ 479 - 479
po/mr.po


Разница между файлами не показана из-за своего большого размера
+ 516 - 516
po/nb.po


Разница между файлами не показана из-за своего большого размера
+ 516 - 516
po/ne.po


Разница между файлами не показана из-за своего большого размера
+ 500 - 500
po/nl.po


Разница между файлами не показана из-за своего большого размера
+ 513 - 513
po/nn.po


Разница между файлами не показана из-за своего большого размера
+ 495 - 495
po/pl.po


Разница между файлами не показана из-за своего большого размера
+ 517 - 517
po/pt.po


Разница между файлами не показана из-за своего большого размера
+ 485 - 485
po/pt_BR.po


Разница между файлами не показана из-за своего большого размера
+ 494 - 494
po/ro.po


Разница между файлами не показана из-за своего большого размера
+ 493 - 493
po/ru.po


Разница между файлами не показана из-за своего большого размера
+ 517 - 517
po/sk.po


Разница между файлами не показана из-за своего большого размера
+ 497 - 497
po/sl.po


Разница между файлами не показана из-за своего большого размера
+ 516 - 516
po/sv.po


Разница между файлами не показана из-за своего большого размера
+ 507 - 507
po/th.po


Разница между файлами не показана из-за своего большого размера
+ 480 - 480
po/tl.po


Разница между файлами не показана из-за своего большого размера
+ 500 - 500
po/tr.po


Разница между файлами не показана из-за своего большого размера
+ 498 - 498
po/uk.po


Разница между файлами не показана из-за своего большого размера
+ 491 - 491
po/vi.po


Разница между файлами не показана из-за своего большого размера
+ 507 - 507
po/zh_CN.po


Разница между файлами не показана из-за своего большого размера
+ 511 - 511
po/zh_TW.po


+ 6 - 0
test/integration/test-apt-key

@@ -111,3 +111,9 @@ cleanplate
 cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
 testsuccess --nomsg aptkey --fakeroot del 5A90D141DBAC8DAE
 testempty aptkey list
+
+msgtest 'Test key removal with' 'lowercase key ID' #keylength somewher between 8byte and short
+cleanplate
+cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
+testsuccess --nomsg aptkey --fakeroot del d141dbac8dae
+testempty aptkey list

+ 72 - 0
test/integration/test-bug-782777-single-arch-weirdness

@@ -0,0 +1,72 @@
+#!/bin/sh
+# Ensure that the order in which packages are in the binary cache
+# does not effect if they can be found or not
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'i386'
+
+insertpackage 'unstable' 'abar' 'i386' '1'
+insertpackage 'unstable' 'foobar' 'i386' '1' 'Depends: abar:amd64, zfoo:amd64'
+insertpackage 'unstable' 'zfoo' 'i386' '1'
+
+setupaptarchive
+
+testrun() {
+	rm -f rootdir/var/lib/apt/extended_states
+
+	testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+  abar zfoo
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst abar (1 unstable [i386])
+Inst zfoo (1 unstable [i386])
+Conf abar (1 unstable [i386])
+Conf zfoo (1 unstable [i386])' aptget install abar zfoo -s
+
+	testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+  abar zfoo
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst abar (1 unstable [i386])
+Inst zfoo (1 unstable [i386])
+Conf abar (1 unstable [i386])
+Conf zfoo (1 unstable [i386])' aptget install abar:i386 zfoo:i386 -s
+
+	testequal "Reading package lists...
+Building dependency tree...
+Package abar:amd64 is not available, but is referred to by another package.
+This may mean that the package is missing, has been obsoleted, or
+is only available from another source
+
+Package zfoo:amd64 is not available, but is referred to by another package.
+This may mean that the package is missing, has been obsoleted, or
+is only available from another source
+
+E: Package 'abar:amd64' has no installation candidate
+E: Package 'zfoo:amd64' has no installation candidate" aptget install abar:amd64 zfoo:amd64 -s
+
+	cp -f rootdir/var/lib/dpkg/status status.backup
+	insertinstalledpackage 'abar' 'i386' '1'
+	insertinstalledpackage 'zfoo' 'i386' '1'
+
+	testequal 'abar
+zfoo' aptmark showmanual abar zfoo
+	testequal 'abar set to automatically installed.
+zfoo set to automatically installed.' aptmark auto abar zfoo
+	testempty aptmark showmanual abar zfoo
+	testequal 'abar
+zfoo' aptmark showauto abar zfoo
+
+	mv -f status.backup rootdir/var/lib/dpkg/status
+}
+
+msgmsg 'Single-Arch testrun'
+testrun
+msgmsg 'Multi-Arch testrun'
+configarchitecture 'i386' 'amd64'
+testrun

+ 109 - 50
test/integration/test-multiarch-foreign

@@ -7,9 +7,13 @@ setupenvironment
 configarchitecture 'amd64' 'i386' 'armel'
 
 insertpackage 'unstable' 'cool-foo' 'amd64,i386' '1.0' 'Depends: foo'
+insertpackage 'unstable' 'cool-foo-x64' 'amd64' '1.0' 'Depends: foo:amd64'
+insertpackage 'unstable' 'cool-foo-x32' 'amd64' '1.0' 'Depends: foo:i386'
 insertpackage 'unstable' 'foo' 'amd64,i386,armel' '1.0' 'Multi-Arch: foreign'
 
 insertpackage 'unstable' 'cool-bar' 'amd64,i386' '1.0' 'Depends: bar-provider'
+insertpackage 'unstable' 'cool-bar-x64' 'amd64' '1.0' 'Depends: bar-provider:amd64'
+insertpackage 'unstable' 'cool-bar-x32' 'amd64' '1.0' 'Depends: bar-provider:i386'
 insertpackage 'unstable' 'bar' 'amd64,i386,armel' '1.0' 'Provides: bar-provider
 Multi-Arch: foreign'
 
@@ -27,28 +31,6 @@ Inst cool-foo:i386 (1.0 unstable [i386])
 Conf foo (1.0 unstable [amd64])
 Conf cool-foo:i386 (1.0 unstable [i386])' aptget install cool-foo:i386 -s
 
-testequal 'Reading package lists...
-Building dependency tree...
-The following extra packages will be installed:
-  foo
-The following NEW packages will be installed:
-  cool-foo foo
-0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
-Inst foo (1.0 unstable [amd64])
-Inst cool-foo (1.0 unstable [amd64])
-Conf foo (1.0 unstable [amd64])
-Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 -s
-
-testequal 'Reading package lists...
-Building dependency tree...
-The following NEW packages will be installed:
-  cool-foo foo
-0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
-Inst foo (1.0 unstable [amd64])
-Inst cool-foo (1.0 unstable [amd64])
-Conf foo (1.0 unstable [amd64])
-Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 foo:amd64 -s
-
 testequal 'Reading package lists...
 Building dependency tree...
 The following NEW packages will be installed:
@@ -69,10 +51,6 @@ Inst cool-foo (1.0 unstable [amd64])
 Conf foo:armel (1.0 unstable [armel])
 Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 foo:armel -s
 
-
-
-
-
 testequal 'Reading package lists...
 Building dependency tree...
 The following extra packages will be installed:
@@ -87,6 +65,60 @@ Conf cool-bar:i386 (1.0 unstable [i386])' aptget install cool-bar:i386 -s
 
 testequal 'Reading package lists...
 Building dependency tree...
+The following NEW packages will be installed:
+  bar:i386 cool-bar
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst bar:i386 (1.0 unstable [i386])
+Inst cool-bar (1.0 unstable [amd64])
+Conf bar:i386 (1.0 unstable [i386])
+Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 bar:i386 -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+  bar:armel cool-bar
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst bar:armel (1.0 unstable [armel])
+Inst cool-bar (1.0 unstable [amd64])
+Conf bar:armel (1.0 unstable [armel])
+Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 bar:armel -s
+
+testequal "Reading package lists...
+Building dependency tree...
+Note, selecting 'bar:i386' instead of 'bar-provider:i386'
+The following NEW packages will be installed:
+  bar:i386 cool-bar
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst bar:i386 (1.0 unstable [i386])
+Inst cool-bar (1.0 unstable [amd64])
+Conf bar:i386 (1.0 unstable [i386])
+Conf cool-bar (1.0 unstable [amd64])" aptget install cool-bar bar-provider:i386 -s -q=0
+
+satisfiable_in_singlearch() {
+	testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+  foo
+The following NEW packages will be installed:
+  cool-foo foo
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst foo (1.0 unstable [amd64])
+Inst cool-foo (1.0 unstable [amd64])
+Conf foo (1.0 unstable [amd64])
+Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 -s
+
+	testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+  cool-foo foo
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst foo (1.0 unstable [amd64])
+Inst cool-foo (1.0 unstable [amd64])
+Conf foo (1.0 unstable [amd64])
+Conf cool-foo (1.0 unstable [amd64])' aptget install cool-foo:amd64 foo:amd64 -s
+
+	testequal 'Reading package lists...
+Building dependency tree...
 The following extra packages will be installed:
   bar
 The following NEW packages will be installed:
@@ -97,7 +129,7 @@ Inst cool-bar (1.0 unstable [amd64])
 Conf bar (1.0 unstable [amd64])
 Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 -s
 
-testequal 'Reading package lists...
+	testequal 'Reading package lists...
 Building dependency tree...
 The following NEW packages will be installed:
   bar cool-bar
@@ -107,44 +139,71 @@ Inst cool-bar (1.0 unstable [amd64])
 Conf bar (1.0 unstable [amd64])
 Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 bar:amd64 -s
 
-testequal 'Reading package lists...
+	testequal "Reading package lists...
 Building dependency tree...
+Note, selecting 'bar' instead of 'bar-provider'
 The following NEW packages will be installed:
-  bar:i386 cool-bar
+  bar cool-bar
 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
-Inst bar:i386 (1.0 unstable [i386])
+Inst bar (1.0 unstable [amd64])
 Inst cool-bar (1.0 unstable [amd64])
-Conf bar:i386 (1.0 unstable [i386])
-Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 bar:i386 -s
+Conf bar (1.0 unstable [amd64])
+Conf cool-bar (1.0 unstable [amd64])" aptget install cool-bar bar-provider -s -q=0
 
-testequal 'Reading package lists...
+	testequal 'Reading package lists...
 Building dependency tree...
+The following extra packages will be installed:
+  foo
 The following NEW packages will be installed:
-  bar:armel cool-bar
+  cool-foo-x64 foo
 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
-Inst bar:armel (1.0 unstable [armel])
-Inst cool-bar (1.0 unstable [amd64])
-Conf bar:armel (1.0 unstable [armel])
-Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 bar:armel -s
+Inst foo (1.0 unstable [amd64])
+Inst cool-foo-x64 (1.0 unstable [amd64])
+Conf foo (1.0 unstable [amd64])
+Conf cool-foo-x64 (1.0 unstable [amd64])' aptget install cool-foo-x64 -s
+}
 
-testequal "Reading package lists...
+#FIXME: do not work in single-arch as i386 isn't known at cache generation time
+	testequal 'Reading package lists...
 Building dependency tree...
-Note, selecting 'bar' instead of 'bar-provider'
+The following extra packages will be installed:
+  foo
 The following NEW packages will be installed:
-  bar cool-bar
+  cool-foo-x32 foo
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst foo (1.0 unstable [amd64])
+Inst cool-foo-x32 (1.0 unstable [amd64])
+Conf foo (1.0 unstable [amd64])
+Conf cool-foo-x32 (1.0 unstable [amd64])' aptget install cool-foo-x32 -s
+
+	testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+  bar
+The following NEW packages will be installed:
+  bar cool-bar-x32
 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
 Inst bar (1.0 unstable [amd64])
-Inst cool-bar (1.0 unstable [amd64])
+Inst cool-bar-x32 (1.0 unstable [amd64])
 Conf bar (1.0 unstable [amd64])
-Conf cool-bar (1.0 unstable [amd64])" aptget install cool-bar bar-provider -s -q=0
+Conf cool-bar-x32 (1.0 unstable [amd64])' aptget install cool-bar-x32 -s -q=0
 
-testequal "Reading package lists...
+	testequal 'Reading package lists...
 Building dependency tree...
-Note, selecting 'bar:i386' instead of 'bar-provider:i386'
+The following extra packages will be installed:
+  bar
 The following NEW packages will be installed:
-  bar:i386 cool-bar
+  bar cool-bar-x64
 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
-Inst bar:i386 (1.0 unstable [i386])
-Inst cool-bar (1.0 unstable [amd64])
-Conf bar:i386 (1.0 unstable [i386])
-Conf cool-bar (1.0 unstable [amd64])" aptget install cool-bar bar-provider:i386 -s -q=0
+Inst bar (1.0 unstable [amd64])
+Inst cool-bar-x64 (1.0 unstable [amd64])
+Conf bar (1.0 unstable [amd64])
+Conf cool-bar-x64 (1.0 unstable [amd64])' aptget install cool-bar-x64 -s -q=0
+
+
+satisfiable_in_singlearch
+
+msgmsg 'switch to single architecture'
+configarchitecture 'amd64'
+
+satisfiable_in_singlearch

+ 144 - 4
test/integration/test-specific-architecture-dependencies

@@ -12,16 +12,19 @@ insertinstalledpackage 'provider' 'amd64' '1' 'Provides: foo'
 
 insertpackage 'unstable' 'pre-depender' 'all' '1' 'Pre-Depends: libc6:i386'
 insertpackage 'unstable' 'depender' 'all' '1' 'Depends: libc6:i386'
+insertpackage 'unstable' 'depender-x32' 'i386,amd64' '1' 'Depends: libc6:i386'
+insertpackage 'unstable' 'depender-x64' 'i386,amd64' '1' 'Depends: libc6:amd64'
 
 insertpackage 'unstable' 'breaker' 'all' '1' 'Breaks: libold (<< 2)'
-insertpackage 'unstable' 'breaker-x32' 'amd64' '1' 'Breaks: libold:i386 (<< 2)'
-insertpackage 'unstable' 'breaker-x64' 'i386' '1' 'Breaks: libold:amd64 (<< 2)'
+insertpackage 'unstable' 'breaker-x32' 'i386,amd64' '1' 'Breaks: libold:i386 (<< 2)'
+insertpackage 'unstable' 'breaker-x64' 'i386,amd64' '1' 'Breaks: libold:amd64 (<< 2)'
 # conflicts with no effect
 insertpackage 'unstable' 'oldconflictor' 'all' '1' 'Conflicts: libold (<< 0)'
 insertpackage 'unstable' 'oldconflictor-x32' 'amd64' '1' 'Conflicts: libold:i386 (<< 0)'
 insertpackage 'unstable' 'oldconflictor-x64' 'i386' '1' 'Conflicts: libold:amd64 (<< 0)'
 
 insertpackage 'unstable' 'foo-depender' 'i386,amd64' '1' 'Depends: foo'
+insertpackage 'unstable' 'foo-native-depender' 'amd64' '1' 'Depends: foo:amd64'
 insertpackage 'unstable' 'foo-foreign-depender' 'i386' '1' 'Depends: foo:amd64'
 
 insertpackage 'unstable' 'foo-conflictor' 'i386,amd64' '1' 'Conflicts: foo'
@@ -54,6 +57,54 @@ Inst depender (1 unstable [all])
 Conf libc6:i386 (1 unstable [i386])
 Conf depender (1 unstable [all])' aptget install depender -s
 
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+  libc6:i386
+The following NEW packages will be installed:
+  depender-x32:i386 libc6:i386
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst libc6:i386 (1 unstable [i386])
+Inst depender-x32:i386 (1 unstable [i386])
+Conf libc6:i386 (1 unstable [i386])
+Conf depender-x32:i386 (1 unstable [i386])' aptget install depender-x32:i386 -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+  libc6:i386
+The following NEW packages will be installed:
+  depender-x32 libc6:i386
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst libc6:i386 (1 unstable [i386])
+Inst depender-x32 (1 unstable [amd64])
+Conf libc6:i386 (1 unstable [i386])
+Conf depender-x32 (1 unstable [amd64])' aptget install depender-x32:amd64 -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+  libc6
+The following NEW packages will be installed:
+  depender-x64 libc6
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst libc6 (1 unstable [amd64])
+Inst depender-x64 (1 unstable [amd64])
+Conf libc6 (1 unstable [amd64])
+Conf depender-x64 (1 unstable [amd64])' aptget install depender-x64:amd64 -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+  libc6
+The following NEW packages will be installed:
+  depender-x64:i386 libc6
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst libc6 (1 unstable [amd64])
+Inst depender-x64:i386 (1 unstable [i386])
+Conf libc6 (1 unstable [amd64])
+Conf depender-x64:i386 (1 unstable [i386])' aptget install depender-x64:i386 -s
+
 testequal 'Reading package lists...
 Building dependency tree...
 The following packages will be REMOVED:
@@ -75,7 +126,29 @@ The following NEW packages will be installed:
 0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
 Remv libold:i386 [1]
 Inst breaker-x32 (1 unstable [amd64])
-Conf breaker-x32 (1 unstable [amd64])' aptget install breaker-x32 -s
+Conf breaker-x32 (1 unstable [amd64])' aptget install breaker-x32:amd64 -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following packages will be REMOVED:
+  libold:i386
+The following NEW packages will be installed:
+  breaker-x32:i386
+0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
+Remv libold:i386 [1]
+Inst breaker-x32:i386 (1 unstable [i386])
+Conf breaker-x32:i386 (1 unstable [i386])' aptget install breaker-x32:i386 -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following packages will be REMOVED:
+  libold
+The following NEW packages will be installed:
+  breaker-x64
+0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
+Remv libold [1]
+Inst breaker-x64 (1 unstable [amd64])
+Conf breaker-x64 (1 unstable [amd64])' aptget install breaker-x64:amd64 -s
 
 testequal 'Reading package lists...
 Building dependency tree...
@@ -86,7 +159,7 @@ The following NEW packages will be installed:
 0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
 Remv libold [1]
 Inst breaker-x64:i386 (1 unstable [i386])
-Conf breaker-x64:i386 (1 unstable [i386])' aptget install breaker-x64 -s
+Conf breaker-x64:i386 (1 unstable [i386])' aptget install breaker-x64:i386 -s
 
 testequal 'Reading package lists...
 Building dependency tree...
@@ -132,6 +205,14 @@ The following packages have unmet dependencies:
  foo-depender:i386 : Depends: foo:i386 but it is not installable
 E: Unable to correct problems, you have held broken packages.' aptget install foo-depender:i386 -s
 
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+  foo-native-depender
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst foo-native-depender (1 unstable [amd64])
+Conf foo-native-depender (1 unstable [amd64])' aptget install foo-native-depender -s
+
 testequal 'Reading package lists...
 Building dependency tree...
 The following NEW packages will be installed:
@@ -180,3 +261,62 @@ The following NEW packages will be installed:
 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
 Inst foo-no-conflictor:i386 (1 unstable [i386])
 Conf foo-no-conflictor:i386 (1 unstable [i386])' aptget install foo-no-conflictor:i386 -s
+
+msgmsg 'switch to single architecture'
+configarchitecture 'amd64'
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following extra packages will be installed:
+  libc6
+The following NEW packages will be installed:
+  depender-x64 libc6
+0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+Inst libc6 (1 unstable [amd64])
+Inst depender-x64 (1 unstable [amd64])
+Conf libc6 (1 unstable [amd64])
+Conf depender-x64 (1 unstable [amd64])' aptget install depender-x64 -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+E: Unable to locate package depender-x64' aptget install depender-x64:i386 -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+  foo-native-depender
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst foo-native-depender (1 unstable [amd64])
+Conf foo-native-depender (1 unstable [amd64])' aptget install foo-native-depender -s
+
+# libold:i386 is installed, but we don't see it as i386 isn't configured
+testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+  breaker-x32
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst breaker-x32 (1 unstable [amd64])
+Conf breaker-x32 (1 unstable [amd64])' aptget install breaker-x32:amd64 -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+The following packages will be REMOVED:
+  libold
+The following NEW packages will be installed:
+  breaker-x64
+0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
+Remv libold [1]
+Inst breaker-x64 (1 unstable [amd64])
+Conf breaker-x64 (1 unstable [amd64])' aptget install breaker-x64:amd64 -s
+
+testequal 'Reading package lists...
+Building dependency tree...
+Some packages could not be installed. This may mean that you have
+requested an impossible situation or if you are using the unstable
+distribution that some required packages have not yet been created
+or been moved out of Incoming.
+The following information may help to resolve the situation:
+
+The following packages have unmet dependencies:
+ depender-x32 : Depends: libc6:i386 but it is not installable
+E: Unable to correct problems, you have held broken packages.' aptget install depender-x32 -s