Explorar o código

merged from debian-sid

Michael Vogt %!s(int64=15) %!d(string=hai) anos
pai
achega
67da93c38e
Modificáronse 100 ficheiros con 23069 adicións e 19700 borrados
  1. 3 53
      README.MultiArch
  2. 29 13
      apt-inst/deb/debfile.cc
  3. 0 43
      apt-pkg/algorithms.cc
  4. 84 3
      apt-pkg/aptconfiguration.cc
  5. 29 0
      apt-pkg/aptconfiguration.h
  6. 2 6
      apt-pkg/cacheiterators.h
  7. 2 2
      apt-pkg/cacheset.h
  8. 8 1
      apt-pkg/cdrom.cc
  9. 2 0
      apt-pkg/cdrom.h
  10. 1 1
      apt-pkg/contrib/configuration.h
  11. 84 80
      apt-pkg/contrib/error.cc
  12. 3 2
      apt-pkg/contrib/error.h
  13. 13 1
      apt-pkg/contrib/fileutl.cc
  14. 3 1
      apt-pkg/contrib/mmap.cc
  15. 2 0
      apt-pkg/contrib/mmap.h
  16. 29 55
      apt-pkg/deb/deblistparser.cc
  17. 6 2
      apt-pkg/deb/debsrcrecords.cc
  18. 17 2
      apt-pkg/deb/dpkgpm.cc
  19. 6 307
      apt-pkg/depcache.cc
  20. 5 3
      apt-pkg/depcache.h
  21. 0 4
      apt-pkg/orderlist.cc
  22. 6 29
      apt-pkg/packagemanager.cc
  23. 2 16
      apt-pkg/pkgcache.cc
  24. 2 2
      apt-pkg/pkgcache.h
  25. 11 30
      apt-pkg/pkgcachegen.cc
  26. 0 7
      apt-pkg/policy.cc
  27. 3 66
      cmdline/apt-cache.cc
  28. 111 42
      cmdline/apt-get.cc
  29. 1 1
      cmdline/apt-key
  30. 1 1
      debian/NEWS
  31. 7 5
      debian/apt-utils.symbols
  32. 64 24
      debian/apt.symbols
  33. 146 9
      debian/changelog
  34. 1 1
      debian/control
  35. 2 8
      doc/apt-cache.8.xml
  36. 7 4
      doc/apt-ftparchive.1.xml
  37. 5 0
      doc/apt-get.8.xml
  38. 4 2
      doc/apt.conf.5.xml
  39. 4 2
      doc/apt_preferences.5.xml
  40. 763 744
      doc/po/apt-doc.pot
  41. 974 789
      doc/po/de.po
  42. 972 785
      doc/po/es.po
  43. 945 830
      doc/po/fr.po
  44. 789 767
      doc/po/it.po
  45. 963 791
      doc/po/ja.po
  46. 895 779
      doc/po/pl.po
  47. 972 786
      doc/po/pt.po
  48. 789 767
      doc/po/pt_BR.po
  49. 3 1
      doc/sources.list.5.xml
  50. 2 0
      ftparchive/apt-ftparchive.cc
  51. 3 24
      ftparchive/contents.cc
  52. 28 30
      ftparchive/multicompress.cc
  53. 5 16
      ftparchive/multicompress.h
  54. 95 56
      ftparchive/writer.cc
  55. 3 3
      ftparchive/writer.h
  56. 8 2
      methods/makefile
  57. 12 5
      methods/rred.cc
  58. 329 277
      po/ar.po
  59. 334 279
      po/ast.po
  60. 333 278
      po/bg.po
  61. 329 277
      po/bs.po
  62. 335 280
      po/ca.po
  63. 335 280
      po/cs.po
  64. 331 277
      po/cy.po
  65. 334 279
      po/da.po
  66. 337 282
      po/de.po
  67. 330 277
      po/dz.po
  68. 334 281
      po/el.po
  69. 491 343
      po/es.po
  70. 334 281
      po/eu.po
  71. 334 281
      po/fi.po
  72. 352 287
      po/fr.po
  73. 334 281
      po/gl.po
  74. 328 275
      po/hu.po
  75. 335 203
      po/it.po
  76. 336 281
      po/ja.po
  77. 330 277
      po/km.po
  78. 329 274
      po/ko.po
  79. 329 277
      po/ku.po
  80. 330 277
      po/lt.po
  81. 330 277
      po/mr.po
  82. 333 278
      po/nb.po
  83. 330 277
      po/ne.po
  84. 334 281
      po/nl.po
  85. 330 277
      po/nn.po
  86. 334 281
      po/pl.po
  87. 335 280
      po/pt.po
  88. 334 281
      po/pt_BR.po
  89. 335 282
      po/ro.po
  90. 335 280
      po/ru.po
  91. 336 281
      po/sk.po
  92. 339 281
      po/sl.po
  93. 336 280
      po/sv.po
  94. 330 277
      po/th.po
  95. 330 277
      po/tl.po
  96. 330 277
      po/uk.po
  97. 330 275
      po/vi.po
  98. 329 274
      po/zh_CN.po
  99. 330 277
      po/zh_TW.po
  100. 0 0
      test/integration/create-test-data

+ 3 - 53
README.MultiArch

@@ -47,67 +47,17 @@ and also to MultiArch as a Group consists of possible many packages which
 all have the same name and are therefore out of interest for pkgnames.
 
 
-Caused by the paragraph "Dependencies involving Architecture: all packages"
-in the MultiArch spec we have a second major conceptional change
-which could even break existing applications, but we hope for the best…
-An Architecture: all package is internally split into pseudo packages
-for all MultiArch Architectures and additional a package with the
-architecture "all" with no dependencies which is a dependency of all
-these architecture depending packages. While the architecture depending
-packages are mainly used for dependency resolution (a package of arch A which
-depends on an arch all package assumes that the dependencies of this package
-are also from arch A. Packages also sometimes change from any to all or v.v.)
-the arch "all" package is used for scheduling download/installation of the
-underlying "real" package. Note that the architecture depending packages can
-be detected with Pseudo() while the "all" package reports exactly this arch
-as package architecture and as pseudo architecture of the versions of this pkg.
-Beware: All versions of a "real" architecture all package will be report "all"
-as their architecture if asked with Arch() regardless if they are the "all" or
-the architecture depending packages. If you want to know the architecture this
-pseudo package was created for call Arch(true). Also, while the spec say that
-arch:all packages are not allowed to have a MultiArch flag APT assigns a
-special value to them: MultiArch: all.
-
-
-As you might guess this arch:all handling has a few problems (but we think so
-far that the problems are minor compared to the problems we would have with
-other implementations.)
-APT doesn't know which pseudo packages of such an arch all package are
-"installed" (to satisfy dependencies), so APT will generate a Cache in which
-all these pseudo packages are installed (e.g. apt-cache policy will display
-them all as installed). Later in the DepCache step it will "remove"
-all pseudo packages whose dependencies are not satisfied.
-The expense is that if the package state is broken APT could come to the
-conclusion to "remove" too many pseudo packages, but in a stable environment
-APT should never end up in a broken system state…
-
-
 Given all these internal changes it is quite interesting that the actual
 implementation of MultiArch is trivial: Some implicit dependencies and a few
 more provides are all changes needed to get it working. Especially noteworthy
 is that it wasn't needed to change the resolver in any way and other parts only
-need to be told about ignoring pseudo packages or using GrpIterator instead of
-PkgIterator, so chances are good that libapt-applications will proceed to work
-without or at least only require minor changes, but your mileage may vary…
+need to be told about using GrpIterator instead of PkgIterator, so chances are
+good that libapt-applications will proceed to work without or at least only
+require minor changes, but your mileage may vary…
 
 
 Known Issues and/or noteworthy stuff:
 * The implementation is mostly untested, so it is very likely that APT will
   eat your kids if you aren't as lucky as the author of these patches.
-* the (install)size of a pseudo package is always NULL - if you want to know
-  the (install)size you need to get the info from the arch "all" package.
-* It is maybe confusing, but the arch "all" package does have the same versions
-  and in general roughly the same information with one subtil difference:
-  It doesn't have any dependency, regardless of the type. The pseudo packages
-  depend on this package.
-* apt-cache policy foobar on installed architecture all package foobar will
-  report all architecture depending packages as installed. Displaying here the
-  correct information would require to build the complete DepCache…
-* [BUG] An installed package which changes the architecture from any to all
-  (and v.v.) shows up in the NEW packages section instead of UPGRADE.
-* [TODO] Investigate the DepCache pseudo-package killer heuristic:
-  e.g. add more safety guards…
-* [FIXME] a few corner cases/missing features marked as FIXME in the code
-
 
 [0] https://wiki.ubuntu.com/MultiarchSpec

+ 29 - 13
apt-inst/deb/debfile.cc

@@ -20,6 +20,7 @@
 #include <apt-pkg/extracttar.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/deblistparser.h>
+#include <apt-pkg/aptconfiguration.h>
 
 #include <sys/stat.h>
 #include <unistd.h>
@@ -46,7 +47,9 @@ debDebFile::debDebFile(FileFd &File) : File(File), AR(File)
 
    if (!CheckMember("data.tar.gz") &&
        !CheckMember("data.tar.bz2") &&
-       !CheckMember("data.tar.lzma")) {
+       !CheckMember("data.tar.lzma") &&
+       !CheckMember("data.tar.xz")) {
+      // FIXME: add data.tar.xz here - adding it now would require a Translation round for a very small gain
       _error->Error(_("This is not a valid DEB archive, it has no '%s', '%s' or '%s' member"), "data.tar.gz", "data.tar.bz2", "data.tar.lzma");
       return;
    }
@@ -125,22 +128,35 @@ bool debDebFile::ExtractControl(pkgDataBase &DB)
 /* Simple wrapper around tar.. */
 bool debDebFile::ExtractArchive(pkgDirStream &Stream)
 {
-   // Get the archive member and positition the file 
-   const ARArchive::Member *Member = AR.FindMember("data.tar.gz");
-   const char *Compressor = "gzip";
-   if (Member == 0) {
-      Member = AR.FindMember("data.tar.bz2");
-      Compressor = "bzip2";
+   // Get the archive member
+   const ARArchive::Member *Member = NULL;
+   std::string Compressor;
+
+   std::string const data = "data.tar";
+   std::vector<APT::Configuration::Compressor> compressor = APT::Configuration::getCompressors();
+   for (std::vector<APT::Configuration::Compressor>::const_iterator c = compressor.begin();
+	c != compressor.end(); ++c)
+   {
+      Member = AR.FindMember(std::string(data).append(c->Extension).c_str());
+      if (Member == NULL)
+	 continue;
+      Compressor = c->Binary;
+      break;
    }
-   if (Member == 0) {
-      Member = AR.FindMember("data.tar.lzma");
-      Compressor = "lzma";
+
+   if (Member == NULL)
+   {
+      std::string ext = "data.tar.{";
+      for (std::vector<APT::Configuration::Compressor>::const_iterator c = compressor.begin();
+	   c != compressor.end(); ++c)
+	 ext.append(c->Extension.substr(1));
+      ext.append("}");
+      return _error->Error(_("Internal error, could not locate member %s"), ext.c_str());
    }
-   if (Member == 0)
-      return _error->Error(_("Internal error, could not locate member"));   
+
    if (File.Seek(Member->Start) == false)
       return false;
-      
+
    // Prepare Tar
    ExtractTar Tar(File,Member->Size,Compressor);
    if (_error->PendingError() == true)

+ 0 - 43
apt-pkg/algorithms.cc

@@ -90,21 +90,6 @@ bool pkgSimulate::Install(PkgIterator iPkg,string /*File*/)
    Describe(Pkg,cout,true,true);
    Sim.MarkInstall(Pkg,false);
 
-   if (strcmp(Pkg.Arch(),"all") == 0)
-   {
-      pkgCache::GrpIterator G = Pkg.Group();
-      pkgCache::GrpIterator iG = iPkg.Group();
-      for (pkgCache::PkgIterator P = G.FindPkg("any"); P.end() != true; P = G.NextPkg(P))
-      {
-	 if (strcmp(P.Arch(), "all") == 0)
-	    continue;
-	 if (iG.FindPkg(P.Arch())->CurrentVer == 0)
-	    continue;
-	 Flags[P->ID] = 1;
-	 Sim.MarkInstall(P, false);
-      }
-   }
-
    // Look for broken conflicts+predepends.
    for (PkgIterator I = Sim.PkgBegin(); I.end() == false; I++)
    {
@@ -150,19 +135,6 @@ bool pkgSimulate::Configure(PkgIterator iPkg)
    
    Flags[Pkg->ID] = 2;
 
-   if (strcmp(Pkg.Arch(),"all") == 0)
-   {
-      pkgCache::GrpIterator G = Pkg.Group();
-      for (pkgCache::PkgIterator P = G.FindPkg("any"); P.end() != true; P = G.NextPkg(P))
-      {
-	 if (strcmp(P.Arch(), "all") == 0)
-	    continue;
-	 if (Flags[P->ID] == 1)
-	    Flags[P->ID] = 2;
-      }
-   }
-
-//   Sim.MarkInstall(Pkg,false);
    if (Sim[Pkg].InstBroken() == true)
    {
       cout << "Conf " << Pkg.FullName(false) << " broken" << endl;
@@ -214,21 +186,6 @@ bool pkgSimulate::Remove(PkgIterator iPkg,bool Purge)
    Flags[Pkg->ID] = 3;
    Sim.MarkDelete(Pkg);
 
-   if (strcmp(Pkg.Arch(),"all") == 0)
-   {
-      pkgCache::GrpIterator G = Pkg.Group();
-      pkgCache::GrpIterator iG = iPkg.Group();
-      for (pkgCache::PkgIterator P = G.FindPkg("any"); P.end() != true; P = G.NextPkg(P))
-      {
-	 if (strcmp(P.Arch(), "all") == 0)
-	    continue;
-	 if (iG.FindPkg(P.Arch())->CurrentVer == 0)
-	    continue;
-	 Flags[P->ID] = 3;
-	 Sim.MarkDelete(P);
-      }
-   }
-
    if (Purge == true)
       cout << "Purg ";
    else

+ 84 - 3
apt-pkg/aptconfiguration.cc

@@ -38,12 +38,11 @@ const Configuration::getCompressionTypes(bool const &Cached) {
 
 	// setup the defaults for the compressiontypes => method mapping
 	_config->CndSet("Acquire::CompressionTypes::bz2","bzip2");
+	_config->CndSet("Acquire::CompressionTypes::xz","xz");
 	_config->CndSet("Acquire::CompressionTypes::lzma","lzma");
 	_config->CndSet("Acquire::CompressionTypes::gz","gzip");
 
-	// Set default application paths to check for optional compression types
-	_config->CndSet("Dir::Bin::lzma", "/usr/bin/lzma");
-	_config->CndSet("Dir::Bin::bzip2", "/bin/bzip2");
+	setDefaultConfigurationForCompressors();
 
 	// accept non-list order as override setting for config settings on commandline
 	std::string const overrideOrder = _config->Find("Acquire::CompressionTypes::Order","");
@@ -344,4 +343,86 @@ bool const Configuration::checkArchitecture(std::string const &Arch) {
 	return (std::find(archs.begin(), archs.end(), Arch) != archs.end());
 }
 									/*}}}*/
+// setDefaultConfigurationForCompressors				/*{{{*/
+void Configuration::setDefaultConfigurationForCompressors() {
+	// Set default application paths to check for optional compression types
+	_config->CndSet("Dir::Bin::lzma", "/usr/bin/lzma");
+	_config->CndSet("Dir::Bin::xz", "/usr/bin/xz");
+	_config->CndSet("Dir::Bin::bzip2", "/bin/bzip2");
+}
+									/*}}}*/
+// getCompressors - Return Vector of usbale compressors			/*{{{*/
+// ---------------------------------------------------------------------
+/* return a vector of compressors used by apt-ftparchive in the
+   multicompress functionality or to detect data.tar files */
+std::vector<APT::Configuration::Compressor>
+const Configuration::getCompressors(bool const Cached) {
+	static std::vector<APT::Configuration::Compressor> compressors;
+	if (compressors.empty() == false) {
+		if (Cached == true)
+			return compressors;
+		else
+			compressors.clear();
+	}
+
+	setDefaultConfigurationForCompressors();
+
+	compressors.push_back(Compressor(".", "", "", "", "", 1));
+	if (_config->Exists("Dir::Bin::gzip") == false || FileExists(_config->FindFile("Dir::Bin::gzip")) == true)
+		compressors.push_back(Compressor("gzip",".gz","gzip","-9n","-d",2));
+	if (_config->Exists("Dir::Bin::bzip2") == false || FileExists(_config->FindFile("Dir::Bin::bzip2")) == true)
+		compressors.push_back(Compressor("bzip2",".bz2","bzip2","-9","-d",3));
+	if (_config->Exists("Dir::Bin::lzma") == false || FileExists(_config->FindFile("Dir::Bin::lzma")) == true)
+		compressors.push_back(Compressor("lzma",".lzma","lzma","-9","-d",4));
+	if (_config->Exists("Dir::Bin::xz") == false || FileExists(_config->FindFile("Dir::Bin::xz")) == true)
+		compressors.push_back(Compressor("xz",".xz","xz","-6","-d",5));
+
+	std::vector<std::string> const comp = _config->FindVector("APT::Compressor");
+	for (std::vector<std::string>::const_iterator c = comp.begin();
+	     c != comp.end(); ++c) {
+		if (*c == "." || *c == "gzip" || *c == "bzip2" || *c == "lzma" || *c == "xz")
+			continue;
+		compressors.push_back(Compressor(c->c_str(), std::string(".").append(*c).c_str(), c->c_str(), "-9", "-d", 100));
+	}
+
+	return compressors;
+}
+									/*}}}*/
+// getCompressorExtensions - supported data.tar extensions		/*{{{*/
+// ---------------------------------------------------------------------
+/* */
+std::vector<std::string> const Configuration::getCompressorExtensions() {
+	std::vector<APT::Configuration::Compressor> const compressors = getCompressors();
+	std::vector<std::string> ext;
+	for (std::vector<APT::Configuration::Compressor>::const_iterator c = compressors.begin();
+	     c != compressors.end(); ++c)
+		if (c->Extension.empty() == false && c->Extension != ".")
+			ext.push_back(c->Extension);
+	return ext;
+}
+									/*}}}*/
+// Compressor constructor						/*{{{*/
+// ---------------------------------------------------------------------
+/* */
+Configuration::Compressor::Compressor(char const *name, char const *extension,
+				      char const *binary,
+				      char const *compressArg, char const *uncompressArg,
+				      unsigned short const cost) {
+	std::string const config = string("APT:Compressor::").append(name).append("::");
+	Name = _config->Find(std::string(config).append("Name"), name);
+	Extension = _config->Find(std::string(config).append("Extension"), extension);
+	Binary = _config->Find(std::string(config).append("Binary"), binary);
+	Cost = _config->FindI(std::string(config).append("Cost"), cost);
+	std::string const compConf = std::string(config).append("CompressArg");
+	if (_config->Exists(compConf) == true)
+		CompressArgs = _config->FindVector(compConf);
+	else if (compressArg != NULL)
+		CompressArgs.push_back(compressArg);
+	std::string const uncompConf = std::string(config).append("UncompressArg");
+	if (_config->Exists(uncompConf) == true)
+		UncompressArgs = _config->FindVector(uncompConf);
+	else if (uncompressArg != NULL)
+		UncompressArgs.push_back(uncompressArg);
+}
+									/*}}}*/
 }

+ 29 - 0
apt-pkg/aptconfiguration.h

@@ -82,6 +82,35 @@ public:									/*{{{*/
 	 */
 	bool static const checkArchitecture(std::string const &Arch);
 
+	/** \brief Representation of supported compressors */
+	struct Compressor {
+		std::string Name;
+		std::string Extension;
+		std::string Binary;
+		std::vector<std::string> CompressArgs;
+		std::vector<std::string> UncompressArgs;
+		unsigned short Cost;
+
+		Compressor(char const *name, char const *extension, char const *binary,
+			   char const *compressArg, char const *uncompressArg,
+			   unsigned short const cost);
+		Compressor() {};
+	};
+
+	/** \brief Return a vector of Compressors supported for data.tar's
+	 *
+	 *  \param Cached saves the result so we need to calculated it only once
+	 *                this parameter should ony be used for testing purposes.
+	 *
+	 *  \return a vector of Compressors
+	 */
+	std::vector<Compressor> static const getCompressors(bool const Cached = true);
+
+	/** \brief Return a vector of extensions supported for data.tar's */
+	std::vector<std::string> static const getCompressorExtensions();
+									/*}}}*/
+	private:							/*{{{*/
+	void static setDefaultConfigurationForCompressors();
 									/*}}}*/
 };
 									/*}}}*/

+ 2 - 6
apt-pkg/cacheiterators.h

@@ -206,13 +206,9 @@ class pkgCache::VerIterator : public Iterator<Version, VerIterator> {
 	inline const char *VerStr() const {return S->VerStr == 0?0:Owner->StrP + S->VerStr;};
 	inline const char *Section() const {return S->Section == 0?0:Owner->StrP + S->Section;};
 	inline const char *Arch() const {
-		if(S->MultiArch == pkgCache::Version::All)
-			return "all";
 		return S->ParentPkg == 0?0:Owner->StrP + ParentPkg()->Arch;
 	};
-	inline const char *Arch(bool const pseudo) const {
-		if(pseudo == false)
-			return Arch();
+	__deprecated inline const char *Arch(bool const pseudo) const {
 		return S->ParentPkg == 0?0:Owner->StrP + ParentPkg()->Arch;
 	};
 	inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->ParentPkg);};
@@ -227,7 +223,7 @@ class pkgCache::VerIterator : public Iterator<Version, VerIterator> {
 	string RelStr() const;
 
 	bool Automatic() const;
-	bool Pseudo() const;
+	__deprecated bool Pseudo() const;
 	VerFileIterator NewestFile() const;
 
 	inline VerIterator(pkgCache &Owner,Version *Trg = 0) : Iterator<Version, VerIterator>(Owner, Trg) {

+ 2 - 2
apt-pkg/cacheset.h

@@ -257,7 +257,7 @@ public:									/*{{{*/
 		inline const char *VerStr() const { return (**this).VerStr(); };
 		inline const char *Section() const { return (**this).Section(); };
 		inline const char *Arch() const { return (**this).Arch(); };
-		inline const char *Arch(bool const pseudo) const { return (**this).Arch(pseudo); };
+		__deprecated inline const char *Arch(bool const pseudo) const { return (**this).Arch(); };
 		inline pkgCache::PkgIterator ParentPkg() const { return (**this).ParentPkg(); };
 		inline pkgCache::DescIterator DescriptionList() const { return (**this).DescriptionList(); };
 		inline pkgCache::DescIterator TranslatedDescription() const { return (**this).TranslatedDescription(); };
@@ -268,7 +268,7 @@ public:									/*{{{*/
 		inline const char *PriorityType() const { return (**this).PriorityType(); };
 		inline string RelStr() const { return (**this).RelStr(); };
 		inline bool Automatic() const { return (**this).Automatic(); };
-		inline bool Pseudo() const { return (**this).Pseudo(); };
+		__deprecated inline bool Pseudo() const { return false; };
 		inline pkgCache::VerFileIterator NewestFile() const { return (**this).NewestFile(); };
 	};
 									/*}}}*/

+ 8 - 1
apt-pkg/cdrom.cc

@@ -854,7 +854,9 @@ pkgUdevCdromDevices::Dlopen()                     		        /*{{{*/
    libudev_handle = h;
    udev_new = (udev* (*)(void)) dlsym(h, "udev_new");
    udev_enumerate_add_match_property = (int (*)(udev_enumerate*, const char*, const char*))dlsym(h, "udev_enumerate_add_match_property");
+#if 0 // FIXME: uncomment on next ABI break
    udev_enumerate_add_match_sysattr = (int (*)(udev_enumerate*, const char*, const char*))dlsym(h, "udev_enumerate_add_match_sysattr");
+#endif
    udev_enumerate_scan_devices = (int (*)(udev_enumerate*))dlsym(h, "udev_enumerate_scan_devices");
    udev_enumerate_get_list_entry = (udev_list_entry* (*)(udev_enumerate*))dlsym(h, "udev_enumerate_get_list_entry");
    udev_device_new_from_syspath = (udev_device* (*)(udev*, const char*))dlsym(h, "udev_device_new_from_syspath");
@@ -895,8 +897,13 @@ pkgUdevCdromDevices::ScanForRemovable(bool CdromOnly)
    enumerate = udev_enumerate_new (udev_ctx);
    if (CdromOnly)
       udev_enumerate_add_match_property(enumerate, "ID_CDROM", "1");
-   else
+   else {
+#if 1 // FIXME: remove the next two lines on the next ABI break
+      int (*udev_enumerate_add_match_sysattr)(struct udev_enumerate *udev_enumerate, const char *property, const char *value);
+      udev_enumerate_add_match_sysattr = (int (*)(udev_enumerate*, const char*, const char*))dlsym(libudev_handle, "udev_enumerate_add_match_sysattr");
+#endif
       udev_enumerate_add_match_sysattr(enumerate, "removable", "1");
+   }
 
    udev_enumerate_scan_devices (enumerate);
    devices = udev_enumerate_get_list_entry (enumerate);

+ 2 - 0
apt-pkg/cdrom.h

@@ -92,7 +92,9 @@ class pkgUdevCdromDevices						/*{{{*/
    struct udev_enumerate *(*udev_enumerate_new) (struct udev *udev);
    struct udev_list_entry *(*udev_list_entry_get_next)(struct udev_list_entry *list_entry);
    const char* (*udev_device_get_property_value)(struct udev_device *udev_device, const char *key);
+#if 0 // FIXME: uncomment on next ABI break
    int (*udev_enumerate_add_match_sysattr)(struct udev_enumerate *udev_enumerate, const char *property, const char *value);
+#endif 
    // end libudev dlopen
    
  public:

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

@@ -72,8 +72,8 @@ class Configuration
    string Find(string const &Name, string const &Default) const {return Find(Name.c_str(),Default.c_str());};
    string FindFile(const char *Name,const char *Default = 0) const;
    string FindDir(const char *Name,const char *Default = 0) const;
-   std::vector<string> FindVector(string const &Name) const;
    std::vector<string> FindVector(const char *Name) const;
+   std::vector<string> FindVector(string const &Name) const { return FindVector(Name.c_str()); };
    int FindI(const char *Name,int const &Default = 0) const;
    int FindI(string const &Name,int const &Default = 0) const {return FindI(Name.c_str(),Default);};
    bool FindB(const char *Name,bool const &Default = false) const;

+ 84 - 80
apt-pkg/contrib/error.cc

@@ -18,6 +18,7 @@
 #include <iostream>
 #include <errno.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
 
 #include <string>
@@ -57,108 +58,110 @@
 // GlobalError::GlobalError - Constructor				/*{{{*/
 GlobalError::GlobalError() : PendingFlag(false) {}
 									/*}}}*/
-// GlobalError::FatalE - Get part of the error string from errno	/*{{{*/
-bool GlobalError::FatalE(const char *Function,const char *Description,...) {
-	va_list args;
-	va_start(args,Description);
-	return InsertErrno(FATAL, Function, Description, args);
-}
-									/*}}}*/
-// GlobalError::Errno - Get part of the error string from errno		/*{{{*/
-bool GlobalError::Errno(const char *Function,const char *Description,...) {
-	va_list args;
-	va_start(args,Description);
-	return InsertErrno(ERROR, Function, Description, args);
-}
-									/*}}}*/
-// GlobalError::WarningE - Get part of the warning string from errno	/*{{{*/
-bool GlobalError::WarningE(const char *Function,const char *Description,...) {
-	va_list args;
-	va_start(args,Description);
-	return InsertErrno(WARNING, Function, Description, args);
-}
-									/*}}}*/
-// GlobalError::NoticeE - Get part of the notice string from errno	/*{{{*/
-bool GlobalError::NoticeE(const char *Function,const char *Description,...) {
-	va_list args;
-	va_start(args,Description);
-	return InsertErrno(NOTICE, Function, Description, args);
-}
-									/*}}}*/
-// GlobalError::DebugE - Get part of the debug string from errno	/*{{{*/
-bool GlobalError::DebugE(const char *Function,const char *Description,...) {
-	va_list args;
-	va_start(args,Description);
-	return InsertErrno(DEBUG, Function, Description, args);
+// GlobalError::FatalE, Errno, WarningE, NoticeE and DebugE - Add to the list/*{{{*/
+#define GEMessage(NAME, TYPE) \
+bool GlobalError::NAME (const char *Function, const char *Description,...) { \
+	va_list args; \
+	size_t msgSize = 400; \
+	int const errsv = errno; \
+	while (true) { \
+		va_start(args,Description); \
+		if (InsertErrno(TYPE, Function, Description, args, errsv, msgSize) == false) \
+			break; \
+		va_end(args); \
+	} \
+	return false; \
 }
+GEMessage(FatalE, FATAL)
+GEMessage(Errno, ERROR)
+GEMessage(WarningE, WARNING)
+GEMessage(NoticeE, NOTICE)
+GEMessage(DebugE, DEBUG)
+#undef GEMessage
 									/*}}}*/
 // GlobalError::InsertErrno - Get part of the errortype string from errno/*{{{*/
 bool GlobalError::InsertErrno(MsgType const &type, const char *Function,
 				const char *Description,...) {
 	va_list args;
-	va_start(args,Description);
-	return InsertErrno(type, Function, Description, args);
+	size_t msgSize = 400;
+	int const errsv = errno;
+	while (true) {
+		va_start(args,Description);
+		if (InsertErrno(type, Function, Description, args, errsv, msgSize) == false)
+			break;
+		va_end(args);
+	}
+	return false;
 }
 									/*}}}*/
 // GlobalError::InsertErrno - formats an error message with the errno	/*{{{*/
 bool GlobalError::InsertErrno(MsgType type, const char* Function,
-			      const char* Description, va_list &args) {
-	char S[400];
-	snprintf(S, sizeof(S), "%s - %s (%i: %s)", Description,
-		 Function, errno, strerror(errno));
-	return Insert(type, S, args);
-}
-									/*}}}*/
-// GlobalError::Fatal - Add a fatal error to the list			/*{{{*/
-bool GlobalError::Fatal(const char *Description,...) {
-	va_list args;
-	va_start(args,Description);
-	return Insert(FATAL, Description, args);
-}
-									/*}}}*/
-// GlobalError::Error - Add an error to the list			/*{{{*/
-bool GlobalError::Error(const char *Description,...) {
-	va_list args;
-	va_start(args,Description);
-	return Insert(ERROR, Description, args);
-}
-									/*}}}*/
-// GlobalError::Warning - Add a warning to the list			/*{{{*/
-bool GlobalError::Warning(const char *Description,...) {
-	va_list args;
-	va_start(args,Description);
-	return Insert(WARNING, Description, args);
-}
-									/*}}}*/
-// GlobalError::Notice - Add a notice to the list			/*{{{*/
-bool GlobalError::Notice(const char *Description,...)
-{
-	va_list args;
-	va_start(args,Description);
-	return Insert(NOTICE, Description, args);
+			      const char* Description, va_list &args,
+			      int const errsv, size_t &msgSize) {
+	char* S = (char*) malloc(msgSize);
+	int const n = snprintf(S, msgSize, "%s - %s (%i: %s)", Description,
+			       Function, errsv, strerror(errsv));
+	if (n > -1 && ((unsigned int) n) < msgSize);
+	else {
+		if (n > -1)
+			msgSize = n + 1;
+		else
+			msgSize *= 2;
+		return true;
+	}
+
+	bool const geins = Insert(type, S, args, msgSize);
+	free(S);
+	return geins;
 }
 									/*}}}*/
-// GlobalError::Debug - Add a debug to the list				/*{{{*/
-bool GlobalError::Debug(const char *Description,...)
-{
-	va_list args;
-	va_start(args,Description);
-	return Insert(DEBUG, Description, args);
+// GlobalError::Fatal, Error, Warning, Notice and Debug - Add to the list/*{{{*/
+#define GEMessage(NAME, TYPE) \
+bool GlobalError::NAME (const char *Description,...) { \
+	va_list args; \
+	size_t msgSize = 400; \
+	while (true) { \
+		va_start(args,Description); \
+		if (Insert(TYPE, Description, args, msgSize) == false) \
+			break; \
+		va_end(args); \
+	} \
+	return false; \
 }
+GEMessage(Fatal, FATAL)
+GEMessage(Error, ERROR)
+GEMessage(Warning, WARNING)
+GEMessage(Notice, NOTICE)
+GEMessage(Debug, DEBUG)
+#undef GEMessage
 									/*}}}*/
 // GlobalError::Insert - Add a errotype message to the list		/*{{{*/
 bool GlobalError::Insert(MsgType const &type, const char *Description,...)
 {
 	va_list args;
-	va_start(args,Description);
-	return Insert(type, Description, args);
+	size_t msgSize = 400;
+	while (true) {
+		va_start(args,Description);
+		if (Insert(type, Description, args, msgSize) == false)
+			break;
+		va_end(args);
+	}
+	return false;
 }
 									/*}}}*/
 // GlobalError::Insert - Insert a new item at the end			/*{{{*/
 bool GlobalError::Insert(MsgType type, const char* Description,
-			 va_list &args) {
-	char S[400];
-	vsnprintf(S,sizeof(S),Description,args);
+			 va_list &args, size_t &msgSize) {
+	char* S = (char*) malloc(msgSize);
+	int const n = vsnprintf(S, msgSize, Description, args);
+	if (n > -1 && ((unsigned int) n) < msgSize);
+	else {
+		if (n > -1)
+			msgSize = n + 1;
+		else
+			msgSize *= 2;
+		return true;
+	}
 
 	Item const m(S, type);
 	Messages.push_back(m);
@@ -169,6 +172,7 @@ bool GlobalError::Insert(MsgType type, const char* Description,
 	if (type == FATAL || type == DEBUG)
 		std::clog << m << std::endl;
 
+	free(S);
 	return false;
 }
 									/*}}}*/

+ 3 - 2
apt-pkg/contrib/error.h

@@ -307,9 +307,10 @@ private:								/*{{{*/
 	std::list<MsgStack> Stacks;
 
 	bool InsertErrno(MsgType type, const char* Function,
-			 const char* Description, va_list &args);
+			 const char* Description, va_list &args,
+			 int const errsv, size_t &msgSize);
 	bool Insert(MsgType type, const char* Description,
-			 va_list &args);
+			 va_list &args, size_t &msgSize);
 									/*}}}*/
 };
 									/*}}}*/

+ 13 - 1
apt-pkg/contrib/fileutl.cc

@@ -42,6 +42,11 @@
 #include <errno.h>
 #include <set>
 #include <algorithm>
+
+#include <config.h>
+#ifdef WORDS_BIGENDIAN
+#include <inttypes.h>
+#endif
 									/*}}}*/
 
 using namespace std;
@@ -971,9 +976,16 @@ unsigned long FileFd::Size()
        off_t orig_pos = lseek(iFd, 0, SEEK_CUR);
        if (lseek(iFd, -4, SEEK_END) < 0)
 	   return _error->Errno("lseek","Unable to seek to end of gzipped file");
+       size = 0L;
        if (read(iFd, &size, 4) != 4)
 	   return _error->Errno("read","Unable to read original size of gzipped file");
-       size &= 0xFFFFFFFF;
+
+#ifdef WORDS_BIGENDIAN
+       uint32_t tmp_size = size;
+       uint8_t const * const p = (uint8_t const * const) &tmp_size;
+       tmp_size = (p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0];
+       size = tmp_size;
+#endif
 
        if (lseek(iFd, orig_pos, SEEK_SET) < 0)
 	   return _error->Errno("lseek","Unable to seek in gzipped file");

+ 3 - 1
apt-pkg/contrib/mmap.cc

@@ -106,7 +106,7 @@ bool MMap::Map(FileFd &Fd)
 /* */
 bool MMap::Close(bool DoSync)
 {
-   if ((Flags & UnMapped) == UnMapped || Base == 0 || iSize == 0)
+   if ((Flags & UnMapped) == UnMapped || validData() == false || iSize == 0)
       return true;
    
    if (DoSync == true)
@@ -266,6 +266,8 @@ DynamicMMap::~DynamicMMap()
 {
    if (Fd == 0)
    {
+      if (validData() == false)
+	 return;
 #ifdef _POSIX_MAPPED_FILES
       munmap(Base, WorkSpace);
 #else

+ 2 - 0
apt-pkg/contrib/mmap.h

@@ -61,6 +61,8 @@ class MMap
    inline operator void *() {return Base;};
    inline void *Data() {return Base;}; 
    inline unsigned long Size() {return iSize;};
+   inline void AddSize(unsigned long const size) {iSize += size;};
+   inline bool validData() const { return Base != (void *)-1 && Base != 0; };
    
    // File manipulators
    bool Sync();

+ 29 - 55
apt-pkg/deb/deblistparser.cc

@@ -67,23 +67,12 @@ string debListParser::Package() {
 									/*}}}*/
 // ListParser::Architecture - Return the package arch			/*{{{*/
 // ---------------------------------------------------------------------
-/* This will return the Architecture of the package this section describes
-   Note that architecture "all" packages will get the architecture of the
-   Packages file parsed here. */
+/* This will return the Architecture of the package this section describes */
 string debListParser::Architecture() {
-   string const Result = Section.FindS("Architecture");
-   if (Result.empty() == true || Result == "all")
-   {
-      if (Arch.empty() == true)
-	 /* FIXME: this is a problem for installed arch all
-	    packages as we don't know from which arch this
-	    package was installed - and therefore which
-	    dependency this package resolves. */
-	 return _config->Find("APT::Architecture");
-      else
-	 return Arch;
-   }
-   return Result;
+   std::string const Arch = Section.FindS("Architecture");
+   if (Arch.empty() == true)
+      return _config->Find("APT::Architecture");
+   return Arch;
 }
 									/*}}}*/
 // ListParser::ArchitectureAll						/*{{{*/
@@ -112,27 +101,30 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver)
    Ver->Section = UniqFindTagWrite("Section");
 
    // Parse multi-arch
-   if (Section.FindS("Architecture") == "all")
-      /* Arch all packages can't have a Multi-Arch field,
-         but we need a special treatment for them nonetheless */
-      Ver->MultiArch = pkgCache::Version::All;
-   else
-   {
-      string const MultiArch = Section.FindS("Multi-Arch");
-      if (MultiArch.empty() == true)
-	 Ver->MultiArch = pkgCache::Version::None;
-      else if (MultiArch == "same")
-	 Ver->MultiArch = pkgCache::Version::Same;
-      else if (MultiArch == "foreign")
-	 Ver->MultiArch = pkgCache::Version::Foreign;
-      else if (MultiArch == "allowed")
-	 Ver->MultiArch = pkgCache::Version::Allowed;
-      else
+   string const MultiArch = Section.FindS("Multi-Arch");
+   if (MultiArch.empty() == true)
+      Ver->MultiArch = pkgCache::Version::None;
+   else if (MultiArch == "same") {
+      // Parse multi-arch
+      if (Section.FindS("Architecture") == "all")
       {
-	 _error->Warning("Unknown Multi-Arch type »%s« for package »%s«",
-			MultiArch.c_str(), Section.FindS("Package").c_str());
+	 /* Arch all packages can't be Multi-Arch: same */
+	 _error->Warning("Architecture: all package '%s' can't be Multi-Arch: same",
+			Section.FindS("Package").c_str());
 	 Ver->MultiArch = pkgCache::Version::None;
       }
+      else
+	 Ver->MultiArch = pkgCache::Version::Same;
+   }
+   else if (MultiArch == "foreign")
+      Ver->MultiArch = pkgCache::Version::Foreign;
+   else if (MultiArch == "allowed")
+      Ver->MultiArch = pkgCache::Version::Allowed;
+   else
+   {
+      _error->Warning("Unknown Multi-Arch type '%s' for package '%s'",
+			MultiArch.c_str(), Section.FindS("Package").c_str());
+      Ver->MultiArch = pkgCache::Version::None;
    }
 
    // Archive Size
@@ -150,24 +142,6 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver)
 	 Ver->Priority = pkgCache::State::Extra;
    }
 
-   if (Ver->MultiArch == pkgCache::Version::All)
-   {
-      /* We maintain a "pseudo" arch=all package for architecture all versions
-	 on which these versions can depend on. This pseudo package is many used
-	 for downloading/installing: The other pseudo-packages will degenerate
-	 to a NOP in the download/install step - this package will ensure that
-	 it is downloaded only one time and installed only one time -- even if
-	 the architecture bound versions coming in and out on regular basis. */
-      if (strcmp(Ver.Arch(true),"all") == 0)
-	 return true;
-      else if (MultiArchEnabled == true)
-      {
-	 // our pseudo packages have no size to not confuse the fetcher
-	 Ver->Size = 0;
-	 Ver->InstalledSize = 0;
-      }
-   }
-
    if (ParseDepends(Ver,"Depends",pkgCache::Dep::Depends) == false)
       return false;
    if (ParseDepends(Ver,"Pre-Depends",pkgCache::Dep::PreDepends) == false)
@@ -644,7 +618,7 @@ bool debListParser::ParseDepends(pkgCache::VerIterator &Ver,
       return true;
 
    string Package;
-   string const pkgArch = Ver.Arch(true);
+   string const pkgArch = Ver.Arch();
    string Version;
    unsigned int Op;
 
@@ -683,7 +657,7 @@ bool debListParser::ParseProvides(pkgCache::VerIterator &Ver)
    {
       string Package;
       string Version;
-      string const Arch = Ver.Arch(true);
+      string const Arch = Ver.Arch();
       unsigned int Op;
 
       while (1)
@@ -768,7 +742,7 @@ bool debListParser::Step()
 	 if (Architecture == Arch)
 	    return true;
 
-	 if (Architecture == "all")
+	 if (Architecture == "all" && Arch == _config->Find("APT::Architecture"))
 	    return true;
       }
 

+ 6 - 2
apt-pkg/deb/debsrcrecords.cc

@@ -14,6 +14,7 @@
 #include <apt-pkg/error.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/configuration.h>
+#include <apt-pkg/aptconfiguration.h>
 
 using std::max;
 									/*}}}*/
@@ -111,7 +112,9 @@ bool debSrcRecordParser::Files(vector<pkgSrcRecords::File> &List)
    string Base = Sect.FindS("Directory");
    if (Base.empty() == false && Base[Base.length()-1] != '/')
       Base += '/';
-   
+
+   std::vector<std::string> const compExts = APT::Configuration::getCompressorExtensions();
+
    // Iterate over the entire list grabbing each triplet
    const char *C = Files.c_str();
    while (*C != 0)
@@ -144,7 +147,8 @@ bool debSrcRecordParser::Files(vector<pkgSrcRecords::File> &List)
 	 }
 	 F.Type = string(F.Path,Tmp+1,Pos-Tmp);
 	 
-	 if (F.Type == "gz" || F.Type == "bz2" || F.Type == "lzma" || F.Type == "tar")
+	 if (std::find(compExts.begin(), compExts.end(), std::string(".").append(F.Type)) != compExts.end() ||
+	     F.Type == "tar")
 	 {
 	    Pos = Tmp-1;
 	    continue;

+ 17 - 2
apt-pkg/deb/dpkgpm.cc

@@ -890,7 +890,10 @@ bool pkgDPkgPM::Go(int OutStatusFd)
 
       // Generate the argument list
       const char *Args[MaxArgs + 50];
-      
+      // keep track of allocated strings for multiarch package names
+      char *Packages[MaxArgs + 50];
+      unsigned int pkgcount = 0;
+
       // Now check if we are within the MaxArgs limit
       //
       // this code below is problematic, because it may happen that
@@ -998,13 +1001,20 @@ bool pkgDPkgPM::Go(int OutStatusFd)
       }      
       else
       {
+	 string const nativeArch = _config->Find("APT::Architecture");
 	 for (;I != J && Size < MaxArgBytes; I++)
 	 {
 	    if((*I).Pkg.end() == true)
 	       continue;
 	    if (I->Op == Item::Configure && disappearedPkgs.find(I->Pkg.Name()) != disappearedPkgs.end())
 	       continue;
-	    Args[n++] = I->Pkg.Name();
+	    if (I->Pkg.Arch() == nativeArch || !strcmp(I->Pkg.Arch(), "all"))
+	       Args[n++] = I->Pkg.Name();
+	    else
+	    {
+	       Packages[pkgcount] = strdup(I->Pkg.FullName(false).c_str());
+	       Args[n++] = Packages[pkgcount++];
+	    }
 	    Size += strlen(Args[n-1]);
 	 }	 
       }      
@@ -1154,6 +1164,11 @@ bool pkgDPkgPM::Go(int OutStatusFd)
       sigemptyset(&sigmask);
       sigprocmask(SIG_BLOCK,&sigmask,&original_sigmask);
 
+      /* clean up the temporary allocation for multiarch package names in
+         the parent, so we don't leak memory when we return. */
+      for (unsigned int i = 0; i < pkgcount; i++)
+	 free(Packages[i]);
+
       // the result of the waitpid call
       int res;
       int select_ret;

+ 6 - 307
apt-pkg/depcache.cc

@@ -339,7 +339,7 @@ bool pkgDepCache::CheckDep(DepIterator Dep,int Type,PkgIterator &Res)
    /* Check simple depends. A depends -should- never self match but 
       we allow it anyhow because dpkg does. Technically it is a packaging
       bug. Conflicts may never self match */
-   if (Dep.TargetPkg()->Group != Dep.ParentPkg()->Group ||
+   if (Dep.TargetPkg() != Dep.ParentPkg() ||
        (Dep->Type != Dep::Conflicts && Dep->Type != Dep::DpkgBreaks && Dep->Type != Dep::Obsoletes))
    {
       PkgIterator Pkg = Dep.TargetPkg();
@@ -705,107 +705,6 @@ void pkgDepCache::UpdateVerState(PkgIterator Pkg)
    }
 }
 									/*}}}*/
-// DepCache::RemovePseudoInstalledPkg - MultiArch helper for Update()	/*{{{*/
-// ---------------------------------------------------------------------
-/* We "install" arch all packages for all archs if it is installed. Many
-   of these will be broken. This method will look at these broken Pkg and
-   "remove" it. */
-bool pkgDepCache::RemovePseudoInstalledPkg(PkgIterator &Pkg, std::set<unsigned long> &recheck) {
-   if (unlikely(Pkg->CurrentVer == 0))
-      return false;
-
-   VerIterator V = Pkg.CurrentVer();
-   if (V->MultiArch != Version::All)
-      return false;
-
-   // Never ever kill an "all" package - they have no dependency so they can't be broken
-   if (strcmp(Pkg.Arch(),"all") == 0)
-      return false;
-
-   unsigned char const CurDepState = VersionState(V.DependsList(),DepInstall,DepInstMin,DepInstPolicy);
-   if ((CurDepState & DepInstMin) == DepInstMin) {
-      // okay, the package isn't broken, but is the package also required?
-      // If it has no real dependencies, no installed rdepends and doesn't
-      // provide something of value, we will kill it as not required.
-      // These pseudopackages have otherwise interesting effects if they get
-      // a new dependency in a newer version…
-      for (pkgCache::DepIterator D = V.DependsList();
-	   D.end() != true; ++D)
-	 if (D.IsCritical() == true && D.ParentPkg()->Group != Pkg->Group)
-	    return false;
-      for (DepIterator D = Pkg.RevDependsList(); D.end() != true; ++D)
-      {
-	 if (D.IsCritical() == false)
-	    continue;
-	 PkgIterator const P = D.ParentPkg();
-	 if (P->Group == Pkg->Group)
-	    continue;
-	 if (P->CurrentVer != 0)
-	    return false;
-      }
-      for (PrvIterator Prv = V.ProvidesList(); Prv.end() != true; Prv++)
-	 for (DepIterator d = Prv.ParentPkg().RevDependsList();
-	      d.end() != true; ++d)
-	 {
-	    PkgIterator const P = d.ParentPkg();
-	    if (P->CurrentVer != 0 &&
-	        P->Group != Pkg->Group)
-	       return false;
-	 }
-   }
-
-   // Dependencies for this arch all package are not statisfied
-   // so we installed it only for our convenience: get right of it now.
-   RemoveSizes(Pkg);
-   RemoveStates(Pkg);
-
-   Pkg->CurrentVer = 0;
-   PkgState[Pkg->ID].InstallVer = 0;
-
-   AddStates(Pkg);
-   Update(Pkg);
-   AddSizes(Pkg);
-
-   // After the remove previously satisfied pseudo pkg could be now
-   // no longer satisfied, so we need to recheck the reverse dependencies
-   for (DepIterator d = Pkg.RevDependsList(); d.end() != true; ++d)
-   {
-      PkgIterator const P = d.ParentPkg();
-      if (P->CurrentVer != 0)
-	 recheck.insert(P.Index());
-   }
-
-   for (DepIterator d = V.DependsList(); d.end() != true; ++d)
-   {
-      PkgIterator const P = d.TargetPkg();
-      for (PrvIterator Prv = P.ProvidesList(); Prv.end() != true; ++Prv)
-      {
-	 PkgIterator const O = Prv.OwnerPkg();
-	 if (O->CurrentVer != 0)
-	    recheck.insert(O.Index());
-      }
-
-      if (P->CurrentVer != 0)
-	 recheck.insert(P.Index());
-   }
-
-   for (PrvIterator Prv = V.ProvidesList(); Prv.end() != true; Prv++)
-   {
-      for (DepIterator d = Prv.ParentPkg().RevDependsList();
-	   d.end() != true; ++d)
-      {
-	 PkgIterator const P = d.ParentPkg();
-	 if (P->CurrentVer == 0)
-	    continue;
-
-	    recheck.insert(P.Index());
-      }
-   }
-
-
-   return true;
-}
-									/*}}}*/
 // DepCache::Update - Figure out all the state information		/*{{{*/
 // ---------------------------------------------------------------------
 /* This will figure out the state of all the packages and all the 
@@ -820,12 +719,8 @@ void pkgDepCache::Update(OpProgress *Prog)
    iBrokenCount = 0;
    iBadCount = 0;
 
-   std::set<unsigned long> recheck;
-
    // Perform the depends pass
    int Done = 0;
-   bool const checkMultiArch = APT::Configuration::getArchitectures().size() > 1;
-   unsigned long killed = 0;
    for (PkgIterator I = PkgBegin(); I.end() != true; I++,Done++)
    {
       if (Prog != 0 && Done%20 == 0)
@@ -858,69 +753,6 @@ void pkgDepCache::Update(OpProgress *Prog)
       AddSizes(I);
       UpdateVerState(I);
       AddStates(I);
-
-      if (checkMultiArch != true || I->CurrentVer == 0)
-	 continue;
-
-      VerIterator const V = I.CurrentVer();
-      if (V->MultiArch != Version::All)
-	 continue;
-
-      recheck.insert(I.Index());
-      --Done; // no progress if we need to recheck the package
-   }
-
-   if (checkMultiArch == true) {
-      /* FIXME: recheck breaks proper progress reporting as we don't know
-		how many packages we need to recheck. To lower the effect
-		a bit we increase with a kill, but we should do something more clever… */
-      while(recheck.empty() == false)
-	 for (std::set<unsigned long>::const_iterator p = recheck.begin();
-	     p != recheck.end();) {
-	    if (Prog != 0 && Done%20 == 0)
-	       Prog->Progress(Done);
-	    PkgIterator P = PkgIterator(*Cache, Cache->PkgP + *p);
-	    if (RemovePseudoInstalledPkg(P, recheck) == true) {
-	       ++killed;
-	       ++Done;
-	    }
-	    recheck.erase(p++);
-	 }
-
-      /* Okay, we have killed a great amount of pseudopackages -
-	 we have killed so many that we have now arch "all" packages
-	 without an installed pseudo package, but we NEED an installed
-	 pseudo package, so we will search now for a pseudo package
-	 we can install without breaking everything. */
-      for (GrpIterator G = Cache->GrpBegin(); G.end() != true; ++G)
-      {
-	 PkgIterator P = G.FindPkg("all");
-	 if (P.end() == true)
-	    continue;
-	 if (P->CurrentVer == 0)
-	    continue;
-	 bool installed = false;
-	 for (P = G.FindPkg("any"); P.end() != true; P = G.NextPkg(P))
-	 {
-	    if (strcmp(P.Arch(), "all") == 0)
-	       continue;
-	    if (P->CurrentVer == 0)
-	       continue;
-	    installed = true;
-	    break;
-	 }
-	 if (installed == false)
-	    recheck.insert(G.Index());
-      }
-
-      while (recheck.empty() != true)
-      {
-	 std::set<unsigned long>::const_iterator g = recheck.begin();
-	 unsigned long const G = *g;
-	 recheck.erase(g);
-	 if (unlikely(ReInstallPseudoForGroup(G, recheck) == false))
-	    _error->Warning(_("Internal error, group '%s' has no installable pseudo package"), GrpIterator(*Cache, Cache->GrpP + G).Name());
-      }
    }
 
    if (Prog != 0)
@@ -929,80 +761,6 @@ void pkgDepCache::Update(OpProgress *Prog)
    readStateFile(Prog);
 }
 									/*}}}*/
-// DepCache::ReInstallPseudoForGroup - MultiArch helper for Update()	/*{{{*/
-// ---------------------------------------------------------------------
-/* RemovePseudoInstalledPkg() is very successful. It even kills packages
-   to an amount that no pseudo package is left, but we need a pseudo package
-   for upgrading senarios so we need to reinstall one pseudopackage which
-   doesn't break everything. Thankfully we can't have architecture depending
-   negative dependencies so this problem is already eliminated */
-bool pkgDepCache::ReInstallPseudoForGroup(pkgCache::PkgIterator const &P, std::set<unsigned long> &recheck)
-{
-   if (P->CurrentVer != 0)
-      return true;
-   // recursive call for packages which provide this package
-   for (pkgCache::PrvIterator Prv = P.ProvidesList(); Prv.end() != true; ++Prv)
-      ReInstallPseudoForGroup(Prv.OwnerPkg(), recheck);
-   // check if we actually need to look at this group
-   unsigned long const G = P->Group;
-   std::set<unsigned long>::const_iterator Pi = recheck.find(G);
-   if (Pi == recheck.end())
-      return true;
-   recheck.erase(Pi); // remove here, so we can't fall into an endless loop
-   if (unlikely(ReInstallPseudoForGroup(G, recheck) == false))
-   {
-      recheck.insert(G);
-      return false;
-   }
-   return true;
-}
-bool pkgDepCache::ReInstallPseudoForGroup(unsigned long const &G, std::set<unsigned long> &recheck)
-{
-   std::vector<std::string> static const Archs = APT::Configuration::getArchitectures();
-   pkgCache::GrpIterator Grp(*Cache, Cache->GrpP + G);
-   if (unlikely(Grp.end() == true))
-      return false;
-   for (std::vector<std::string>::const_iterator a = Archs.begin();
-        a != Archs.end(); ++a)
-   {
-      pkgCache::PkgIterator P = Grp.FindPkg(*a);
-      if (P.end() == true)
-	 continue;
-      pkgCache::VerIterator allV = Grp.FindPkg("all").CurrentVer();
-      for (VerIterator V = P.VersionList(); V.end() != true; ++V)
-      {
-	 // search for the same version as the all package
-	 if (allV->Hash != V->Hash || strcmp(allV.VerStr(),V.VerStr()) != 0)
-	    continue;
-	 unsigned char const CurDepState = VersionState(V.DependsList(),DepInstall,DepInstMin,DepInstPolicy);
-	 // If it is broken, try to install dependencies first before retry
-	 if ((CurDepState & DepInstMin) != DepInstMin)
-	 {
-	    for (pkgCache::DepIterator D = V.DependsList(); D.end() != true; ++D)
-	    {
-	       if (D->Type != pkgCache::Dep::PreDepends && D->Type != pkgCache::Dep::Depends)
-		  continue;
-	       ReInstallPseudoForGroup(D.TargetPkg(), recheck);
-	    }
-	    unsigned char const CurDepState = VersionState(V.DependsList(),DepInstall,DepInstMin,DepInstPolicy);
-	    // if package ist still broken… try another arch
-	    if ((CurDepState & DepInstMin) != DepInstMin)
-	       break;
-	 }
-	 // dependencies satisfied: reinstall the package
-	 RemoveSizes(P);
-	 RemoveStates(P);
-	 P->CurrentVer = V.Index();
-	 PkgState[P->ID].InstallVer = V;
-	 AddStates(P);
-	 Update(P);
-	 AddSizes(P);
-	 return true;
-      }
-   }
-   return false;
-}
-									/*}}}*/
 // DepCache::Update - Update the deps list of a package	   		/*{{{*/
 // ---------------------------------------------------------------------
 /* This is a helper for update that only does the dep portion of the scan. 
@@ -1165,18 +923,6 @@ void pkgDepCache::MarkDelete(PkgIterator const &Pkg, bool rPurge,
    Update(Pkg);
    AddSizes(Pkg);
 
-   // if we remove the pseudo package, we also need to remove the "real"
-   if (Pkg->CurrentVer != 0 && Pkg.CurrentVer().Pseudo() == true)
-      MarkDelete(Pkg.Group().FindPkg("all"), rPurge, Depth+1, FromUser);
-   else if (rPurge == true && Pkg->CurrentVer == 0 &&
-	    Pkg->CurrentState != pkgCache::State::NotInstalled &&
-	    strcmp(Pkg.Arch(), "all") != 0)
-   {
-      PkgIterator const allPkg = Pkg.Group().FindPkg("all");
-      if (allPkg.end() == false && allPkg->CurrentVer == 0 &&
-	  allPkg->CurrentState != pkgCache::State::NotInstalled)
-	 MarkDelete(allPkg, rPurge, Depth+1, FromUser);
-   }
 }
 									/*}}}*/
 // DepCache::IsDeleteOk - check if it is ok to remove this package	/*{{{*/
@@ -1257,9 +1003,10 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
 
    if(FromUser)
      {
-       // Set it to manual if it's a new install or cancelling the
-       // removal of a garbage package.
-       if(P.Status == 2 || (!Pkg.CurrentVer().end() && !P.Marked))
+       // Set it to manual if it's a new install or already installed,
+       // but only if its not marked by the autoremover (aptitude depend on this behavior)
+       // or if we do automatic installation (aptitude never does it)
+       if(P.Status == 2 || (Pkg->CurrentVer != 0 && (AutoInst == true || P.Marked == false)))
 	 P.Flags &= ~Flag::Auto;
      }
    else
@@ -1275,10 +1022,6 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
    Update(Pkg);
    AddSizes(Pkg);
 
-   // always trigger the install of the all package for a pseudo package
-   if (P.CandidateVerIter(*Cache).Pseudo() == true)
-      MarkInstall(Pkg.Group().FindPkg("all"), AutoInst, Depth, FromUser, ForceImportantDeps);
-
    if (AutoInst == false)
       return;
 
@@ -1498,7 +1241,7 @@ void pkgDepCache::SetReInstall(PkgIterator const &Pkg,bool To)
    AddStates(Pkg);
    AddSizes(Pkg);
 
-   if (unlikely(Pkg.CurrentVer().end() == true) || Pkg.CurrentVer().Pseudo() == false)
+   if (unlikely(Pkg.CurrentVer().end() == true))
       return;
 
    SetReInstall(Pkg.Group().FindPkg("all"), To);
@@ -1509,7 +1252,6 @@ void pkgDepCache::SetReInstall(PkgIterator const &Pkg,bool To)
 /* */
 void pkgDepCache::SetCandidateVersion(VerIterator TargetVer, bool const &Pseudo)
 {
-
    pkgCache::PkgIterator Pkg = TargetVer.ParentPkg();
    StateCache &P = PkgState[Pkg->ID];
 
@@ -1530,27 +1272,6 @@ void pkgDepCache::SetCandidateVersion(VerIterator TargetVer, bool const &Pseudo)
    Update(Pkg);
    AddSizes(Pkg);
 
-   if (TargetVer.Pseudo() == false || Pseudo == false)
-      return;
-
-   // the version was pseudo: set all other pseudos also
-   pkgCache::GrpIterator Grp = Pkg.Group();
-   for (Pkg = Grp.FindPkg("any"); Pkg.end() == false; ++Pkg)
-   {
-      StateCache &P = PkgState[Pkg->ID];
-      if (TargetVer.SimilarVer(P.CandidateVerIter(*this)) == true ||
-	  (P.CandidateVerIter(*this).Pseudo() == false &&
-	   strcmp(Pkg.Arch(), "all") != 0))
-	 continue;
-
-      for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; ++Ver)
-      {
-	 if (TargetVer.SimilarVer(Ver) == false)
-	    continue;
-	 SetCandidateVersion(Ver, false);
-	 break;
-      }
-   }
 }
 									/*}}}*/
 // DepCache::SetCandidateRelease - Change the candidate version		/*{{{*/
@@ -1966,28 +1687,6 @@ void pkgDepCache::MarkPackage(const pkgCache::PkgIterator &pkg,
    if(ver.end() == true)
       return;
 
-   // If the version belongs to a Multi-Arch all package
-   // we will mark all others in this Group with this version also
-   if (ver->MultiArch == pkgCache::Version::All &&
-	strcmp(ver.Arch(true), "all") == 0)
-   {
-      GrpIterator G = pkg.Group();
-      const char* const VerStr = ver.VerStr();
-      for (PkgIterator P = G.FindPkg("any");
-	   P.end() != true; P = G.NextPkg(P))
-      {
-	 for (VerIterator V = P.VersionList();
-	      V.end() != true; ++V)
-	 {
-	    if (ver->Hash != V->Hash ||
-		strcmp(VerStr, V.VerStr()) != 0)
-	       continue;
-	    MarkPackage(P, V, follow_recommends, follow_suggests);
-	    break;
-	 }
-      }
-   }
-
      for(DepIterator d = ver.DependsList(); !d.end(); ++d)
      {
 	if(d->Type == Dep::Depends ||

+ 5 - 3
apt-pkg/depcache.h

@@ -395,6 +395,7 @@ class pkgDepCache : protected pkgCache::Namespace
 		    bool ForceImportantDeps = false);
 
    void SetReInstall(PkgIterator const &Pkg,bool To);
+   // FIXME: Remove the unused boolean parameter on abi break
    void SetCandidateVersion(VerIterator TargetVer, bool const &Pseudo = true);
    bool SetCandidateRelease(pkgCache::VerIterator TargetVer,
 				std::string const &TargetRel);
@@ -481,9 +482,10 @@ class pkgDepCache : protected pkgCache::Namespace
 
    private:
    // Helper for Update(OpProgress) to remove pseudoinstalled arch all packages
-   bool RemovePseudoInstalledPkg(PkgIterator &Pkg, std::set<unsigned long> &recheck);
-   bool ReInstallPseudoForGroup(unsigned long const &Grp, std::set<unsigned long> &recheck);
-   bool ReInstallPseudoForGroup(pkgCache::PkgIterator const &P, std::set<unsigned long> &recheck);
+   // FIXME: they are private so shouldn't affect abi, but just in case…
+   __deprecated bool RemovePseudoInstalledPkg(PkgIterator &Pkg, std::set<unsigned long> &recheck) { return true; };
+   __deprecated bool ReInstallPseudoForGroup(unsigned long const &Grp, std::set<unsigned long> &recheck) { return true; };
+   __deprecated bool ReInstallPseudoForGroup(pkgCache::PkgIterator const &P, std::set<unsigned long> &recheck) { return true; };
 };
 
 #endif

+ 0 - 4
apt-pkg/orderlist.cc

@@ -128,10 +128,6 @@ bool pkgOrderList::IsMissing(PkgIterator Pkg)
    if (FileList[Pkg->ID].empty() == false)
       return false;
 
-   // Missing Pseudo packages are missing if the real package is missing
-   if (pkgCache::VerIterator(Cache, Cache[Pkg].CandidateVer).Pseudo() == true)
-      return IsMissing(Pkg.Group().FindPkg("all"));
-
    return true;
 }
 									/*}}}*/

+ 6 - 29
apt-pkg/packagemanager.cc

@@ -81,9 +81,6 @@ bool pkgPackageManager::GetArchives(pkgAcquire *Owner,pkgSourceList *Sources,
       if (List->IsNow(Pkg) == false)
 	 continue;
 
-      if (pkgCache::VerIterator(Cache, Cache[Pkg].CandidateVer).Pseudo() == true)
-	 continue;
-
       new pkgAcqArchive(Owner,Sources,Recs,Cache[Pkg].InstVerIter(Cache),
 			FileNames[Pkg->ID]);
    }
@@ -281,9 +278,7 @@ bool pkgPackageManager::ConfigureAll()
    {
       PkgIterator Pkg(Cache,*I);
 
-      if (ConfigurePkgs == true &&
-	  pkgCache::VerIterator(Cache, Cache[Pkg].CandidateVer).Pseudo() == false &&
-	  Configure(Pkg) == false)
+      if (ConfigurePkgs == true && Configure(Pkg) == false)
 	 return false;
       
       List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
@@ -318,9 +313,7 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg)
    {
       PkgIterator Pkg(Cache,*I);
       
-      if (ConfigurePkgs == true &&
-	  pkgCache::VerIterator(Cache, Cache[Pkg].CandidateVer).Pseudo() == false &&
-	  Configure(Pkg) == false)
+      if (ConfigurePkgs == true && Configure(Pkg) == false)
 	 return false;
       
       List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
@@ -473,10 +466,7 @@ bool pkgPackageManager::SmartRemove(PkgIterator Pkg)
 
    List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
 
-   if (pkgCache::VerIterator(Cache, Cache[Pkg].CandidateVer).Pseudo() == false)
-      return Remove(Pkg,(Cache[Pkg].iFlags & pkgDepCache::Purge) == pkgDepCache::Purge);
-   else
-      return SmartRemove(Pkg.Group().FindPkg("all"));
+   return Remove(Pkg,(Cache[Pkg].iFlags & pkgDepCache::Purge) == pkgDepCache::Purge);
    return true;
 }
 									/*}}}*/
@@ -592,22 +582,9 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg)
 	P.end() == false; P++)
       CheckRConflicts(Pkg,P.ParentPkg().RevDependsList(),P.ProvideVersion());
 
-   if (pkgCache::VerIterator(Cache, Cache[Pkg].CandidateVer).Pseudo() == false)
-   {
-      if(Install(Pkg,FileNames[Pkg->ID]) == false)
-         return false;
-   } else {
-      // Pseudo packages will not be unpacked - instead we will do this
-      // for the "real" package, but only once and if it is already
-      // configured we don't need to unpack it again…
-      PkgIterator const P = Pkg.Group().FindPkg("all");
-      if (List->IsFlag(P,pkgOrderList::UnPacked) != true &&
-	  List->IsFlag(P,pkgOrderList::Configured) != true &&
-	  P.State() != pkgCache::PkgIterator::NeedsNothing) {
-	 if (SmartUnPack(P) == false)
-	    return false;
-      }
-   }
+   if(Install(Pkg,FileNames[Pkg->ID]) == false)
+      return false;
+
    List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);
    
    // Perform immedate configuration of the package.

+ 2 - 16
apt-pkg/pkgcache.cc

@@ -737,22 +737,8 @@ bool pkgCache::VerIterator::Automatic() const
    return false;
 }
 									/*}}}*/
-// VerIterator::Pseudo - Check if this version is a pseudo one		/*{{{*/
-// ---------------------------------------------------------------------
-/* Sometimes you have the need to express dependencies with versions
-   which doesn't really exist or exist multiply times for "different"
-   packages. We need these versions for dependency resolution but they
-   are a problem everytime we need to download/install something. */
-bool pkgCache::VerIterator::Pseudo() const
-{
-   if (S->MultiArch == pkgCache::Version::All &&
-	   strcmp(Arch(true),"all") != 0)
-   {
-	   GrpIterator const Grp = ParentPkg().Group();
-	   return (Grp->LastPackage != Grp->FirstPackage);
-   }
-   return false;
-}
+// VerIterator::Pseudo - deprecated no-op method			/*{{{*/
+bool pkgCache::VerIterator::Pseudo() const { return false; }
 									/*}}}*/
 // VerIterator::NewestFile - Return the newest file version relation	/*{{{*/
 // ---------------------------------------------------------------------

+ 2 - 2
apt-pkg/pkgcache.h

@@ -505,8 +505,8 @@ struct pkgCache::Version
        Foreign means that this version can fulfill dependencies even
        if it is built for another architecture as the requester.
        Same indicates that builds for different architectures can
-       be co-installed on the system and All is the marker for a
-       version with the Architecture: all. */
+       be co-installed on the system */
+   // FIXME: remove All on abi break
    enum {None, All, Foreign, Same, Allowed} MultiArch;
 
    /** \brief references all the PackageFile's that this version came from

+ 11 - 30
apt-pkg/pkgcachegen.cc

@@ -178,23 +178,17 @@ bool pkgCacheGenerator::MergeList(ListParser &List,
       if (PackageName.empty() == true)
 	 return false;
 
-      /* As we handle Arch all packages as architecture bounded
-         we add all information to every (simulated) arch package */
-      std::vector<string> genArch;
-      if (List.ArchitectureAll() == true) {
-	 genArch = APT::Configuration::getArchitectures();
-	 if (genArch.size() != 1)
-	    genArch.push_back("all");
-      } else
-	 genArch.push_back(List.Architecture());
-
-      for (std::vector<string>::const_iterator arch = genArch.begin();
-	   arch != genArch.end(); ++arch)
-      {
+      /* Treat Arch all packages as the same as the native arch. */
+      string Arch;
+      if (List.ArchitectureAll() == true)
+	 Arch = _config->Find("APT::Architecture");
+      else
+	 Arch = List.Architecture();
+ 
       // Get a pointer to the package structure
       pkgCache::PkgIterator Pkg;
       Dynamic<pkgCache::PkgIterator> DynPkg(Pkg);
-      if (NewPackage(Pkg, PackageName, *arch) == false)
+      if (NewPackage(Pkg, PackageName, Arch) == false)
 	 return _error->Error(_("Error occurred while processing %s (NewPackage)"),PackageName.c_str());
       Counter++;
       if (Counter % 100 == 0 && Progress != 0)
@@ -351,7 +345,6 @@ bool pkgCacheGenerator::MergeList(ListParser &List,
 
       if ((*LastDesc == 0 && _error->PendingError()) || NewFileDesc(Desc,List) == false)
 	 return _error->Error(_("Error occurred while processing %s (NewFileDesc2)"),PackageName.c_str());
-      }
    }
 
    FoundFileDeps |= List.HasFileDeps();
@@ -638,24 +631,19 @@ bool pkgCacheGenerator::FinishCache(OpProgress *Progress)
 	 Dynamic<pkgCache::PkgIterator> DynP(P);
 	 for (; P.end() != true; P = G.NextPkg(P))
 	 {
-	    if (strcmp(P.Arch(),"all") == 0)
-	       continue;
 	    pkgCache::PkgIterator allPkg;
 	    Dynamic<pkgCache::PkgIterator> DynallPkg(allPkg);
 	    pkgCache::VerIterator V = P.VersionList();
 	    Dynamic<pkgCache::VerIterator> DynV(V);
 	    for (; V.end() != true; V++)
 	    {
-	       string const Arch = V.Arch(true);
+	       char const * const Arch = P.Arch();
 	       map_ptrloc *OldDepLast = NULL;
 	       /* MultiArch handling introduces a lot of implicit Dependencies:
 		- MultiArch: same → Co-Installable if they have the same version
 		- Architecture: all → Need to be Co-Installable for internal reasons
 		- All others conflict with all other group members */
-	       bool const coInstall = (V->MultiArch == pkgCache::Version::All ||
-					V->MultiArch == pkgCache::Version::Same);
-	       if (V->MultiArch == pkgCache::Version::All && allPkg.end() == true)
-		  allPkg = G.FindPkg("all");
+	       bool const coInstall = (V->MultiArch == pkgCache::Version::Same);
 	       for (vector<string>::const_iterator A = archs.begin(); A != archs.end(); ++A)
 	       {
 		  if (*A == Arch)
@@ -677,13 +665,6 @@ bool pkgCacheGenerator::FinishCache(OpProgress *Progress)
 		     NewDepends(D, V, V.VerStr(),
 				pkgCache::Dep::NotEquals, pkgCache::Dep::DpkgBreaks,
 				OldDepLast);
-		     if (V->MultiArch == pkgCache::Version::All)
-		     {
-			// Depend on ${self}:all which does depend on nothing
-			NewDepends(allPkg, V, V.VerStr(),
-				   pkgCache::Dep::Equals, pkgCache::Dep::Depends,
-				   OldDepLast);
-		     }
 		  } else {
 			// Conflicts: ${self}:other
 			NewDepends(D, V, "",
@@ -806,7 +787,7 @@ bool pkgCacheGenerator::ListParser::NewProvides(pkgCache::VerIterator &Ver,
    pkgCache &Cache = Owner->Cache;
 
    // We do not add self referencing provides
-   if (Ver.ParentPkg().Name() == PkgName && PkgArch == Ver.Arch(true))
+   if (Ver.ParentPkg().Name() == PkgName && PkgArch == Ver.Arch())
       return true;
    
    // Get a structure

+ 0 - 7
apt-pkg/policy.cc

@@ -152,13 +152,6 @@ pkgCache::VerIterator pkgPolicy::GetCandidateVer(pkgCache::PkgIterator const &Pk
    {
       /* Lets see if this version is the installed version */
       bool instVer = (Pkg.CurrentVer() == Ver);
-      if (Ver.Pseudo() == true && instVer == false)
-      {
-	 pkgCache::PkgIterator const allPkg = Ver.ParentPkg().Group().FindPkg("all");
-	 if (allPkg->CurrentVer != 0 && allPkg.CurrentVer()->Hash == Ver->Hash &&
-	     strcmp(allPkg.CurVersion(), Ver.VerStr()) == 0)
-	    instVer = true;
-      }
 
       for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; VF++)
       {

+ 3 - 66
cmdline/apt-cache.cc

@@ -1116,58 +1116,6 @@ bool Dotty(CommandLine &CmdL)
    
    printf("}\n");
    return true;
-}
-									/*}}}*/
-// DoAdd - Perform an adding operation					/*{{{*/
-// ---------------------------------------------------------------------
-/* */
-bool DoAdd(CommandLine &CmdL)
-{
-   return _error->Error("Unimplemented");
-#if 0   
-   // Make sure there is at least one argument
-   if (CmdL.FileSize() <= 1)
-      return _error->Error("You must give at least one file name");
-   
-   // Open the cache
-   FileFd CacheF(_config->FindFile("Dir::Cache::pkgcache"),FileFd::WriteAny);
-   if (_error->PendingError() == true)
-      return false;
-   
-   DynamicMMap Map(CacheF,MMap::Public);
-   if (_error->PendingError() == true)
-      return false;
-
-   OpTextProgress Progress(*_config);
-   pkgCacheGenerator Gen(Map,Progress);
-   if (_error->PendingError() == true)
-      return false;
-
-   unsigned long Length = CmdL.FileSize() - 1;
-   for (const char **I = CmdL.FileList + 1; *I != 0; I++)
-   {
-      Progress.OverallProgress(I - CmdL.FileList,Length,1,"Generating cache");
-      Progress.SubProgress(Length);
-
-      // Do the merge
-      FileFd TagF(*I,FileFd::ReadOnly);
-      debListParser Parser(TagF);
-      if (_error->PendingError() == true)
-	 return _error->Error("Problem opening %s",*I);
-      
-      if (Gen.SelectFile(*I,"") == false)
-	 return _error->Error("Problem with SelectFile");
-	 
-      if (Gen.MergeList(Parser) == false)
-	 return _error->Error("Problem with MergeList");
-   }
-
-   Progress.Done();
-   GCache = &Gen.GetCache();
-   Stats(CmdL);
-   
-   return true;
-#endif   
 }
 									/*}}}*/
 // DisplayRecord - Displays the complete record for the package		/*{{{*/
@@ -1571,7 +1519,6 @@ bool Policy(CommandLine &CmdL)
       return true;
    }
 
-   string const myArch = _config->Find("APT::Architecture");
    char const * const msgInstalled = _("  Installed: ");
    char const * const msgCandidate = _("  Candidate: ");
    short const InstalledLessCandidate =
@@ -1584,14 +1531,8 @@ bool Policy(CommandLine &CmdL)
    // Print out detailed information for each package
    APT::CacheSetHelper helper(true, GlobalError::NOTICE);
    APT::PackageSet pkgset = APT::PackageSet::FromCommandLine(CacheFile, CmdL.FileList + 1, helper);
-   for (APT::PackageSet::const_iterator I = pkgset.begin(); I != pkgset.end(); ++I)
+   for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg)
    {
-      pkgCache::PkgIterator Pkg = I.Group().FindPkg("any");
-
-      for (; Pkg.end() != true; Pkg = I.Group().NextPkg(Pkg)) {
-      if (strcmp(Pkg.Arch(),"all") == 0)
-	 continue;
-
       cout << Pkg.FullName(true) << ":" << endl;
 
       // Installed version
@@ -1640,7 +1581,6 @@ bool Policy(CommandLine &CmdL)
 		   Indx->Describe(true).c_str());
 	 }
       }
-      }
    }
    
    return true;
@@ -1743,15 +1683,13 @@ bool ShowHelp(CommandLine &Cmd)
 
    cout << 
     _("Usage: apt-cache [options] command\n"
-      "       apt-cache [options] add file1 [file2 ...]\n"
       "       apt-cache [options] showpkg pkg1 [pkg2 ...]\n"
       "       apt-cache [options] showsrc pkg1 [pkg2 ...]\n"
       "\n"
-      "apt-cache is a low-level tool used to manipulate APT's binary\n"
-      "cache files, and query information from them\n"
+      "apt-cache is a low-level tool used to query information\n"
+      "from APT's binary cache files\n"
       "\n"
       "Commands:\n"
-      "   add - Add a package file to the source cache\n"
       "   gencaches - Build both the package and source cache\n"
       "   showpkg - Show some general information for a single package\n"
       "   showsrc - Show source records\n"
@@ -1811,7 +1749,6 @@ int main(int argc,const char *argv[])					/*{{{*/
       {0,"enhances","APT::Cache::ShowEnhances",0},
       {0,0,0,0}};
    CommandLine::Dispatch CmdsA[] = {{"help",&ShowHelp},
-                                    {"add",&DoAdd},
                                     {"gencaches",&GenCaches},
                                     {"showsrc",&ShowSrcPackage},
                                     {0,0}};

+ 111 - 42
cmdline/apt-get.cc

@@ -382,8 +382,6 @@ void ShowNew(ostream &out,CacheFile &Cache)
    {
       pkgCache::PkgIterator I(Cache,Cache.List[J]);
       if (Cache[I].NewInstall() == true) {
-	 if (Cache[I].CandidateVerIter(Cache).Pseudo() == true)
-	    continue;
          List += I.FullName(true) + " ";
          VersionsList += string(Cache[I].CandVersion) + "\n";
       }
@@ -406,8 +404,6 @@ void ShowDel(ostream &out,CacheFile &Cache)
       pkgCache::PkgIterator I(Cache,Cache.List[J]);
       if (Cache[I].Delete() == true)
       {
-	 if (Cache[I].CandidateVerIter(Cache).Pseudo() == true)
-	    continue;
 	 if ((Cache[I].iFlags & pkgDepCache::Purge) == pkgDepCache::Purge)
 	    List += I.FullName(true) + "* ";
 	 else
@@ -456,8 +452,6 @@ void ShowUpgraded(ostream &out,CacheFile &Cache)
       // Not interesting
       if (Cache[I].Upgrade() == false || Cache[I].NewInstall() == true)
 	 continue;
-      if (Cache[I].CandidateVerIter(Cache).Pseudo() == true)
-	 continue;
 
       List += I.FullName(true) + " ";
       VersionsList += string(Cache[I].CurVersion) + " => " + Cache[I].CandVersion + "\n";
@@ -479,8 +473,6 @@ bool ShowDowngraded(ostream &out,CacheFile &Cache)
       // Not interesting
       if (Cache[I].Downgrade() == false || Cache[I].NewInstall() == true)
 	 continue;
-      if (Cache[I].CandidateVerIter(Cache).Pseudo() == true)
-	 continue;
 
       List += I.FullName(true) + " ";
       VersionsList += string(Cache[I].CurVersion) + " => " + Cache[I].CandVersion + "\n";
@@ -584,9 +576,6 @@ void Stats(ostream &out,pkgDepCache &Dep)
    unsigned long ReInstall = 0;
    for (pkgCache::PkgIterator I = Dep.PkgBegin(); I.end() == false; I++)
    {
-      if (pkgCache::VerIterator(Dep, Dep[I].CandidateVer).Pseudo() == true)
-	 continue;
-
       if (Dep[I].NewInstall() == true)
 	 Install++;
       else
@@ -895,7 +884,11 @@ struct TryToRemove {
 
       if ((Pkg->CurrentVer == 0 && PurgePkgs == false) ||
 	  (PurgePkgs == true && Pkg->CurrentState == pkgCache::State::NotInstalled))
+      {
 	 ioprintf(c1out,_("Package %s is not installed, so not removed\n"),Pkg.FullName(true).c_str());
+	 // MarkInstall refuses to install packages on hold
+	 Pkg->SelectedState = pkgCache::State::Hold;
+      }
       else
 	 Cache->GetDepCache()->MarkDelete(Pkg, PurgePkgs);
    }
@@ -1655,6 +1648,7 @@ bool DoAutomaticRemove(CacheFile &Cache)
 
    string autoremovelist, autoremoveversions;
    unsigned long autoRemoveCount = 0;
+   APT::PackageSet tooMuch;
    // look over the cache to see what can be removed
    for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); ! Pkg.end(); ++Pkg)
    {
@@ -1677,7 +1671,10 @@ bool DoAutomaticRemove(CacheFile &Cache)
 	    // if the package is a new install and already garbage we don't need to
 	    // install it in the first place, so nuke it instead of show it
 	    if (Cache[Pkg].Install() == true && Pkg.CurrentVer() == 0)
+	    {
 	       Cache->MarkDelete(Pkg, false);
+	       tooMuch.insert(Pkg);
+	    }
 	    // only show stuff in the list that is not yet marked for removal
 	    else if(hideAutoRemove == false && Cache[Pkg].Delete() == false) 
 	    {
@@ -1693,6 +1690,45 @@ bool DoAutomaticRemove(CacheFile &Cache)
       }
    }
 
+   // we could have removed a new dependency of a garbage package,
+   // so check if a reverse depends is broken and if so install it again.
+   if (tooMuch.empty() == false && Cache->BrokenCount() != 0)
+   {
+      bool Changed;
+      do {
+	 Changed = false;
+	 for (APT::PackageSet::const_iterator P = tooMuch.begin();
+	      P != tooMuch.end() && Changed == false; ++P)
+	 {
+	    for (pkgCache::DepIterator R = P.RevDependsList();
+		 R.end() == false; ++R)
+	    {
+	       if (R->Type != pkgCache::Dep::Depends &&
+		   R->Type != pkgCache::Dep::PreDepends)
+		  continue;
+	       pkgCache::PkgIterator N = R.ParentPkg();
+	       if (N.end() == true || (N->CurrentVer == 0 && (*Cache)[N].Install() == false))
+		  continue;
+	       if (Debug == true)
+		  std::clog << "Save " << P << " as another installed garbage package depends on it" << std::endl;
+	       Cache->MarkInstall(P, false);
+	       if(hideAutoRemove == false)
+	       {
+		  ++autoRemoveCount;
+		  if (smallList == false)
+		  {
+		     autoremovelist += P.FullName(true) + " ";
+		     autoremoveversions += string(Cache[P].CandVersion) + "\n";
+		  }
+	       }
+	       tooMuch.erase(P);
+	       Changed = true;
+	       break;
+	    }
+	 }
+      } while (Changed == true);
+   }
+
    // Now see if we had destroyed anything (if we had done anything)
    if (Cache->BrokenCount() != 0)
    {
@@ -1790,14 +1826,7 @@ bool DoInstall(CommandLine &CmdL)
       return false;
    }
 
-   unsigned short order[] = { 0, 0, 0 };
-   if (fallback == MOD_INSTALL) {
-      order[0] = MOD_INSTALL;
-      order[1] = MOD_REMOVE;
-   } else {
-      order[0] = MOD_REMOVE;
-      order[1] = MOD_INSTALL;
-   }
+   unsigned short const order[] = { MOD_REMOVE, MOD_INSTALL, 0 };
 
   TryToInstall InstallAction(Cache, Fix, BrokenFix);
   TryToRemove RemoveAction(Cache, Fix);
@@ -1876,8 +1905,6 @@ bool DoInstall(CommandLine &CmdL)
 	 if ((*Cache)[I].Install() == false)
 	    continue;
 	 pkgCache::VerIterator Cand = Cache[I].CandidateVerIter(Cache);
-	 if (Cand.Pseudo() == true)
-	    continue;
 
 	 if (verset[MOD_INSTALL].find(Cand) != verset[MOD_INSTALL].end())
 	    continue;
@@ -2211,13 +2238,15 @@ bool DoDownload(CommandLine &CmdL)
    APT::CacheSetHelper helper(c0out);
    APT::VersionSet verset = APT::VersionSet::FromCommandLine(Cache,
 		CmdL.FileList + 1, APT::VersionSet::CANDIDATE, helper);
-   pkgAcquire Fetcher;
-   AcqTextStatus Stat(ScreenWidth, _config->FindI("quiet",0));
-   Fetcher.Setup(&Stat);
 
    if (verset.empty() == true)
       return false;
 
+   pkgAcquire Fetcher;
+   AcqTextStatus Stat(ScreenWidth, _config->FindI("quiet",0));
+   if (_config->FindB("APT::Get::Print-URIs") == true)
+      Fetcher.Setup(&Stat);
+
    pkgRecords Recs(Cache);
    pkgSourceList *SrcList = Cache.GetSourceList();
    for (APT::VersionSet::const_iterator Ver = verset.begin(); 
@@ -2248,9 +2277,18 @@ bool DoDownload(CommandLine &CmdL)
       // get the file
       new pkgAcqFile(&Fetcher, uri, hash.toStr(), (*Ver)->Size, descr, Pkg.Name(), ".");
    }
-   bool result = (Fetcher.Run() == pkgAcquire::Continue);
 
-   return result;
+   // Just print out the uris and exit if the --print-uris flag was used
+   if (_config->FindB("APT::Get::Print-URIs") == true)
+   {
+      pkgAcquire::UriIterator I = Fetcher.UriBegin();
+      for (; I != Fetcher.UriEnd(); I++)
+	 cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' << 
+	       I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl;
+      return true;
+   }
+
+   return (Fetcher.Run() == pkgAcquire::Continue);
 }
 									/*}}}*/
 // DoCheck - Perform the check operation				/*{{{*/
@@ -2879,6 +2917,7 @@ bool GuessThirdPartyChangelogUri(CacheFile &Cache,
    // now strip away the filename and add srcpkg_srcver.changelog
    return true;
 }
+									/*}}}*/
 // DownloadChangelog - Download the changelog 			        /*{{{*/
 // ---------------------------------------------------------------------
 bool DownloadChangelog(CacheFile &CacheFile, pkgAcquire &Fetcher, 
@@ -2903,13 +2942,19 @@ bool DownloadChangelog(CacheFile &CacheFile, pkgAcquire &Fetcher,
                           "http://packages.debian.org/changelogs");
    path = GetChangelogPath(CacheFile, Pkg, Ver);
    strprintf(changelog_uri, "%s/%s/changelog", server.c_str(), path.c_str());
+   if (_config->FindB("APT::Get::Print-URIs", false) == true)
+   {
+      std::cout << '\'' << changelog_uri << '\'' << std::endl;
+      return true;
+   }
+
    strprintf(descr, _("Changelog for %s (%s)"), Pkg.Name(), changelog_uri.c_str());
    // queue it
    new pkgAcqFile(&Fetcher, changelog_uri, "", 0, descr, Pkg.Name(), "ignored", targetfile);
 
-   // try downloading it, if that fails, they third-party-changelogs location
-   // FIXME: res is "Continue" even if I get a 404?!?
-   int res = Fetcher.Run();
+   // try downloading it, if that fails, try third-party-changelogs location
+   // FIXME: Fetcher.Run() is "Continue" even if I get a 404?!?
+   Fetcher.Run();
    if (!FileExists(targetfile))
    {
       string third_party_uri;
@@ -2917,7 +2962,7 @@ bool DownloadChangelog(CacheFile &CacheFile, pkgAcquire &Fetcher,
       {
          strprintf(descr, _("Changelog for %s (%s)"), Pkg.Name(), third_party_uri.c_str());
          new pkgAcqFile(&Fetcher, third_party_uri, "", 0, descr, Pkg.Name(), "ignored", targetfile);
-         res = Fetcher.Run();
+         Fetcher.Run();
       }
    }
 
@@ -2957,30 +3002,53 @@ bool DoChangelog(CommandLine &CmdL)
    APT::CacheSetHelper helper(c0out);
    APT::VersionSet verset = APT::VersionSet::FromCommandLine(Cache,
 		CmdL.FileList + 1, APT::VersionSet::CANDIDATE, helper);
+   if (verset.empty() == true)
+      return false;
    pkgAcquire Fetcher;
+
+   if (_config->FindB("APT::Get::Print-URIs", false) == true)
+      for (APT::VersionSet::const_iterator Ver = verset.begin();
+	   Ver != verset.end(); ++Ver)
+	 return DownloadChangelog(Cache, Fetcher, Ver, "");
+
    AcqTextStatus Stat(ScreenWidth, _config->FindI("quiet",0));
    Fetcher.Setup(&Stat);
 
-   if (verset.empty() == true)
-      return false;
-   char *tmpdir = mkdtemp(strdup("/tmp/apt-changelog-XXXXXX"));
-   if (tmpdir == NULL) {
-      return _error->Errno("mkdtemp", "mkdtemp failed");
+   bool const downOnly = _config->FindB("APT::Get::Download-Only", false);
+
+   char tmpname[100];
+   char* tmpdir = NULL;
+   if (downOnly == false)
+   {
+      const char* const tmpDir = getenv("TMPDIR");
+      if (tmpDir != NULL && *tmpDir != '\0')
+	 snprintf(tmpname, sizeof(tmpname), "%s/apt-changelog-XXXXXX", tmpDir);
+      else
+	 strncpy(tmpname, "/tmp/apt-changelog-XXXXXX", sizeof(tmpname));
+      tmpdir = mkdtemp(tmpname);
+      if (tmpdir == NULL)
+	 return _error->Errno("mkdtemp", "mkdtemp failed");
    }
-   
+
    for (APT::VersionSet::const_iterator Ver = verset.begin(); 
         Ver != verset.end(); 
         ++Ver) 
    {
-      string changelogfile = string(tmpdir) + "changelog";
-      if (DownloadChangelog(Cache, Fetcher, Ver, changelogfile))
+      string changelogfile;
+      if (downOnly == false)
+	 changelogfile.append(tmpname).append("changelog");
+      else
+	 changelogfile.append(Ver.ParentPkg().Name()).append(".changelog");
+      if (DownloadChangelog(Cache, Fetcher, Ver, changelogfile) && downOnly == false)
+      {
          DisplayFileInPager(changelogfile);
-      // cleanup temp file
-      unlink(changelogfile.c_str());
+         // cleanup temp file
+         unlink(changelogfile.c_str());
+      }
    }
    // clenaup tmp dir
-   rmdir(tmpdir);
-   free(tmpdir);
+   if (tmpdir != NULL)
+      rmdir(tmpdir);
    return true;
 }
 									/*}}}*/
@@ -3157,6 +3225,7 @@ int main(int argc,const char *argv[])					/*{{{*/
       {0,"auto-remove","APT::Get::AutomaticRemove",0},
       {0,"allow-unauthenticated","APT::Get::AllowUnauthenticated",0},
       {0,"install-recommends","APT::Install-Recommends",CommandLine::Boolean},
+      {0,"install-suggests","APT::Install-Suggests",CommandLine::Boolean},
       {0,"fix-policy","APT::Get::Fix-Policy-Broken",0},
       {'c',"config-file",0,CommandLine::ConfigFile},
       {'o',"option",0,CommandLine::ArbItem},

+ 1 - 1
cmdline/apt-key

@@ -7,7 +7,7 @@ unset GREP_OPTIONS
 # implodes if there isn't one available
 GPG_CMD='gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg'
 
-if ! id -u > /dev/null; then
+if [ "$(id -u)" -eq 0 ]; then
 	GPG_CMD="$GPG_CMD --trustdb-name /etc/apt/trustdb.gpg"
 fi
 

+ 1 - 1
debian/NEWS

@@ -1,4 +1,4 @@
-apt (0.8.11) UNRELEASED; urgency=low
+apt (0.8.11) unstable; urgency=low
 
   * apt-get install pkg/experimental will now not only switch the
     candidate of package pkg to the version from the release experimental

+ 7 - 5
debian/apt-utils.symbols

@@ -110,10 +110,12 @@ libapt-inst.so.1.2 libapt-inst1.2
  (c++|optional)"vtable for pkgCache::Iterator<pkgCache::Dependency, pkgCache::DepIterator>@Base" 0.8.0
  (c++|optional)"vtable for pkgCache::Iterator<pkgCache::Package, pkgCache::PkgIterator>@Base" 0.8.0
  (c++|optional)"vtable for pkgCache::Iterator<pkgCache::Version, pkgCache::VerIterator>@Base" 0.8.0
+### gcc-4.4 specific
+ (c++|optional=std)"std::basic_string<char, std::char_traits<char>, std::allocator<char> >& std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace_dispatch<unsigned char*>(__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, unsigned char*, unsigned char*, std::__false_type)@Base" 0.8.0
 ### try to ignore std:: template instances
- (c++|optional)"std::basic_string<char, std::char_traits<char>, std::allocator<char> >& std::basic_string<char, std::char_traits<char>, std::allocator<char> >::append<unsigned char*>(unsigned char*, unsigned char*)@Base" 0.8.0
- (c++|regex|optional)"^std::basic_string<.+ >\(.+\)@Base$" 0.8.0
- (c++|regex|optional)"^char\* std::[^ ]+<.+ >::_.+@Base$" 0.8.0
- (c++|regex|optional)"^typeinfo name for std::iterator<.*>@Base$" 0.8.0
- (c++|regex|optional)"^typeinfo for std::iterator<.*>@Base$" 0.8.0
+ (c++|optional=std)"std::basic_string<char, std::char_traits<char>, std::allocator<char> >& std::basic_string<char, std::char_traits<char>, std::allocator<char> >::append<unsigned char*>(unsigned char*, unsigned char*)@Base" 0.8.0
+ (c++|regex|optional=std)"^std::basic_string<.+ >\(.+\)@Base$" 0.8.0
+ (c++|regex|optional=std)"^char\* std::[^ ]+<.+ >::_.+@Base$" 0.8.0
+ (c++|regex|optional=std)"^typeinfo name for std::iterator<.*>@Base$" 0.8.0
+ (c++|regex|optional=std)"^typeinfo for std::iterator<.*>@Base$" 0.8.0
 ###

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 64 - 24
debian/apt.symbols


+ 146 - 9
debian/changelog

@@ -1,11 +1,6 @@
-apt (0.8.12) UNRELEASED; urgency=low
+apt (0.8.12) unstable; urgency=low
 
   [ Michael Vogt ]
-  * merged lp:~evfool/apt/fix641673:
-    - String-fix in the source and the translations for the grammatical 
-      mistake reported in bug LP: #641673, thanks to Robert Roth
-  * merged lp:~evfool/apt/fix418552:
-    - Grammar fix for bug LP: #418552, thanks to Robert Roth
   * apt-pkg/deb/debindexfile.cc:
     - ignore missing deb-src files in /var/lib/apt/lists, thanks
       to Thorsten Spindler (LP: #85590)
@@ -17,15 +12,138 @@ apt (0.8.12) UNRELEASED; urgency=low
       When this is set to false apt-cdrom will handle any removable
       deivce (like a usb-stick) as a "cdrom/dvd" source
 
- -- Michael Vogt <michael.vogt@ubuntu.com>  Thu, 10 Feb 2011 17:37:56 +0100
+  [ Christian Perrier ]
+  * Fix error in French translation of manpages (apt_preferences(5)).
+    Merci, Rémi Vanicat. Closes: #613689
+  * Complete French manpage translation
+  * Italian translation update (Milo Casagrande). Closes: #614395
+
+  [ David Kalnischkies ]
+  * ftparchive/multicompress.cc, apt-inst/deb/debfile.cc:
+    - support xz compressor to create xz-compressed Indexes and be able
+      to open data.tar.xz files
+    - load the supported compressors from configuration
+  * ftparchive/writer.cc:
+    - ensure that Date and Valid-Until time strings are not localised
+    - add options to disable specific checksums for Indexes
+    - include xz-compressed Packages and Sources files in Release file
+  * apt-pkg/aptconfiguration.cc:
+    - support download of xz-compressed indexes files
+    - support adding new compressors by configuration
+  * apt-pkg/deb/debsrcrecords.cc:
+    - support xz-compressed source v3 debian.tar files
+    - support every compression we have a compressor configured
+  * ftparchive/contents.cc:
+    - remove ExtractArchive codecopy from apt-inst/deb/debfile.cc
+  * apt-inst/deb/debfile.cc:
+    - support data.tar's compressed with any configured compressor
+  * cmdline/apt-get.cc:
+    - reinstall dependencies of reinstalled "garbage" (Closes: #617257)
+
+  [ Steve Langasek ]
+  * apt-pkg/deb/dpkgpm.cc:
+    - make sure that for multiarch packages, we are passing the full
+      qualified package name to dpkg for removals. (Closes: #614298)
+  * Remove the "pseudopackage" handling of Architecture: all packages for
+    Multi-Arch; instead, Arch: all packages only satisfy dependencies for
+    the native arch, except where the Arch: all package is declared
+    Multi-Arch: foreign.  (Closes: #613584)
+
+ -- Michael Vogt <mvo@debian.org>  Thu, 10 Mar 2011 14:46:48 +0100
 
-apt (0.8.11) UNRELEASED; urgency=low
+apt (0.8.11.5) unstable; urgency=low
+
+  [ Christian Perrier ]
+  * Add missing dot in French translation of manpages. Merci, Olivier
+    Humbert.
+  * French translation update
+  * French manpages translation update
+
+  [ David Kalnischkies ]
+  * apt-pkg/depcache.cc:
+    - party revert fix in 0.8.11.2 which marked all packages as manual
+      installed if the FromUser bit is set in the MarkInstall call.
+      The default for this bit is true and aptitude depends on the old
+      behavior so the package is only marked as manual if its not marked
+      ("old" behavior) or if automatic installation is enabled - which
+      aptitude disables always (see also #613775)
+
+ -- David Kalnischkies <kalnischkies@gmail.com>  Thu, 17 Feb 2011 15:16:31 +0100
+
+apt (0.8.11.4) unstable; urgency=low
+
+  [ David Kalnischkies ]
+  * apt-pkg/contrib/error.cc:
+    - ensure that va_list is not invalid in second try
+  * cmdline/apt-get.cc:
+    - don't remove new dependencies of garbage packages (Closes: #613420)
+  
+  [ Michael Vogt ]
+  * test/integration/*
+    - fix dashish in the integration tests
+
+ -- Michael Vogt <mvo@debian.org>  Wed, 16 Feb 2011 14:36:03 +0100
+
+apt (0.8.11.3) unstable; urgency=low
+
+  * apt-pkg/contrib/fileutl.cc:
+    - really detect bigendian machines by including config.h,
+      so we can really (Closes: #612986)
+  * apt-pkg/contrib/mmap.cc:
+    - Base has as 'valid' failure states 0 and -1 so add a simple
+      validData method to check for failure states
+
+ -- David Kalnischkies <kalnischkies@gmail.com>  Mon, 14 Feb 2011 16:58:03 +0100
+
+apt (0.8.11.2) unstable; urgency=low
+
+  [ Michael Vogt ]
+  * merged lp:~evfool/apt/fix641673:
+    - String-fix in the source and the translations for the grammatical 
+      mistake reported in bug LP: #641673, thanks to Robert Roth
+  * merged lp:~evfool/apt/fix418552:
+    - Grammar fix for bug LP: #418552, thanks to Robert Roth
+  
+  [ David Kalnischkies ]
+  * cmdline/apt-get.cc:
+    - add --install-suggests option (Closes: #473089)
+  * apt-pkg/depcache.cc:
+    - mark a package which was requested to be installed on commandline
+      always as manual regardless if it is already marked or not as the
+      marker could be lost later by the removal of rdepends (Closes: #612557)
+  * methods/rred.cc:
+    - read patch into MMap only if we work on uncompressed patches
+    - update size of dynamic MMap as we write in from the outside
+  * apt-pkg/contrib/mmap.cc:
+    - do not try to free the mapping if its is unset
+  * apt-pkg/contrib/fileutl.cc:
+    - reorder the loaded filesize bytes for big endian (Closes: #612986)
+      Thanks to Jörg Sommer for the detailed analyse!
+
+ -- Michael Vogt <mvo@debian.org>  Mon, 14 Feb 2011 12:07:18 +0100
+
+apt (0.8.11.1) unstable; urgency=low
+
+  [ Stefan Lippers-Hollmann ]
+  * cmdline/apt-key:
+    - fix root test which prevented setting of trustdb-name
+      which lets gpg fail if it adds/remove keys from trusted.gpg
+      as it tries to open the (maybe) not existent /root/.gnupg
+
+  [ David Kalnischkies ]
+  * debian/apt.symbols:
+    - add more arch dependent symbols
+
+ -- Michael Vogt <mvo@debian.org>  Wed, 09 Feb 2011 17:49:59 +0100
+
+apt (0.8.11) unstable; urgency=low
 
   [ David Kalnischkies ]
   * apt-pkg/depcache.cc:
     - add SetCandidateRelease() to set a candidate version and
       the candidates of dependencies if needed to a specified
       release (Closes: #572709)
+    - allow conflicts in the same group again (Closes: #612099)
   * cmdline/apt-get.cc:
     - if --print-uris is used don't setup downloader as we don't need
       progress, lock nor the directories it would create otherwise
@@ -37,6 +155,8 @@ apt (0.8.11) UNRELEASED; urgency=low
       so installing packages from experimental or backports is easier
     - really do not show packages in the extra section if they were
       requested on the commandline, e.g. with a modifier (Closes: #184730)
+    - always do removes first and set not installed remove packages
+      on hold to prevent temporary installation later (Closes: #549968)
   * debian/control:
     - add Vcs-Browser now that loggerhead works again (Closes: #511168)
     - depend on debhelper 7 to raise compat level
@@ -63,6 +183,7 @@ apt (0.8.11) UNRELEASED; urgency=low
     - remove duplicated mentioning of --install-recommends
   * doc/sources.list.5.xml:
     - remove obsolete references to non-us (Closes: #594495)
+    - a notice is printed for ignored files (Closes: #597615)
   * debian/rules:
     - use -- instead of deprecated -u for dh_gencontrol
     - remove shlibs.local creation and usage
@@ -91,6 +212,19 @@ apt (0.8.11) UNRELEASED; urgency=low
     - print a good error message if FileSize() is zero
   * apt-pkg/aptconfiguration.cc:
     - remove the inbuilt Translation files whitelist
+  * cmdline/apt-cache.cc:
+    - remove not implemented 'apt-cache add' command
+  * doc/apt-cache.8.xml:
+    - describe reality as apt-cache just queries and doesn't manipulate
+      the caches. Thanks to Enrico Zini for spotting it! (Closes: #612009)
+  * apt-pkg/algorithms.cc:
+    - mark pseudo packages of installed all packages as configured
+      in the simulation as we don't call configure for these packages
+  * apt-pkg/pkgcachegen.cc:
+    - in multiarch, let :all packages conflict with :any packages
+      with a different version to be sure
+  * apt-pkg/contrib/error.cc:
+    - remove 400 char size limit of error messages (LP: #365611)
 
   [ Michael Vogt ]
   * methods/http.cc:
@@ -101,6 +235,9 @@ apt (0.8.11) UNRELEASED; urgency=low
       to Guillem Jover
   * apt-pkg/cdrom.cc, apt-pkg/init.cc, methods/cdrom.cc:
     - use /media/cdrom as default mountoint (closes: #611569)
+  * cmdline/apt-get.cc:
+    - add apt-get changelog (closes: #526990)
+    - add apt-get download (closes: #82738)
 
   [ Martin Pitt ]
   * test/integration/test-compressed-indexes, test/test-indexes.sh:
@@ -108,7 +245,7 @@ apt (0.8.11) UNRELEASED; urgency=low
       will actually test uncompressed indexes regardless of the internal
       default value of Acquire::GzipIndexes.
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Fri, 28 Jan 2011 12:22:25 +0100
+ -- Michael Vogt <mvo@debian.org>  Tue, 08 Feb 2011 12:58:12 +0100
 
 apt (0.8.10.3) unstable; urgency=low
 

+ 1 - 1
debian/control

@@ -4,7 +4,7 @@ Priority: important
 Maintainer: APT Development Team <deity@lists.debian.org>
 Uploaders: Michael Vogt <mvo@debian.org>, Otavio Salvador <otavio@debian.org>,
  Christian Perrier <bubulle@debian.org>, Daniel Burrows <dburrows@debian.org>,
- Luca Bruno <lethalman88@gmail.com>, Julian Andres Klode <jak@debian.org>
+ Julian Andres Klode <jak@debian.org>
 Standards-Version: 3.9.0
 Build-Depends: dpkg-dev (>= 1.15.8), debhelper (>= 7.2.3~), libdb-dev, gettext (>= 0.12), libcurl4-gnutls-dev (>= 7.19.0), zlib1g-dev | libz-dev, debiandoc-sgml, xsltproc, docbook-xsl, docbook-xml, po4a (>= 0.34-2), autotools-dev, autoconf, automake, doxygen
 Build-Conflicts: autoconf2.13, automake1.4

+ 2 - 8
doc/apt-cache.8.xml

@@ -18,7 +18,7 @@
    &apt-email;
    &apt-product;
    <!-- The last update date -->
-   <date>29 February 2004</date>
+   <date>04 February 2011</date>
  </refentryinfo>
  
  <refmeta>
@@ -30,7 +30,7 @@
  <!-- Man page title -->
  <refnamediv>
     <refname>apt-cache</refname>
-    <refpurpose>APT package handling utility -- cache manipulator</refpurpose>
+    <refpurpose>query the APT cache</refpurpose>
  </refnamediv>
 
  <!-- Arguments -->
@@ -41,7 +41,6 @@
       <arg><option>-o=<replaceable>config string</replaceable></option></arg>
       <arg><option>-c=<replaceable>file</replaceable></option></arg>
       <group choice="req">
-         <arg>add <arg choice="plain" rep="repeat"><replaceable>file</replaceable></arg></arg>
          <arg>gencaches</arg>
          <arg>showpkg <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg>
          <arg>showsrc <arg choice="plain" rep="repeat"><replaceable>pkg</replaceable></arg></arg>
@@ -72,11 +71,6 @@
    commands below must be present.</para>
 
    <variablelist>
-     <varlistentry><term>add <replaceable>file(s)</replaceable></term>
-     <listitem><para><literal>add</literal> adds the named package index files to the package cache.
-     This is for debugging only.</para></listitem>
-     </varlistentry>
-     
      <varlistentry><term>gencaches</term>
      <listitem><para><literal>gencaches</literal> performs the same operation as 
      <command>apt-get check</command>. It builds the source and package caches from 

+ 7 - 4
doc/apt-ftparchive.1.xml

@@ -526,11 +526,14 @@ for i in Sections do
    &apt-cmdblurb;
    
    <variablelist>
-     <varlistentry><term><option>--md5</option></term>
+     <varlistentry><term><option>--md5</option>, <option>--sha1</option>, <option>--sha256</option></term>
      <listitem><para>
-     Generate MD5 sums. This defaults to on, when turned off the generated 
-     index files will not have MD5Sum fields where possible.
-     Configuration Item: <literal>APT::FTPArchive::MD5</literal></para></listitem>
+     Generate the given checksum. These options default to on, when turned off the generated
+     index files will not have the checksum fields where possible.
+     Configuration Items: <literal>APT::FTPArchive::<replaceable>Checksum</replaceable></literal> and
+     <literal>APT::FTPArchive::<replaceable>Index</replaceable>::<replaceable>Checksum</replaceable></literal> where
+     <literal>Index</literal> can be <literal>Packages</literal>, <literal>Sources</literal> or <literal>Release</literal> and
+     <literal>Checksum</literal> can be <literal>MD5</literal>, <literal>SHA1</literal> or <literal>SHA256</literal>.</para></listitem>
      </varlistentry>
 
      <varlistentry><term><option>-d</option></term><term><option>--db</option></term>

+ 5 - 0
doc/apt-get.8.xml

@@ -337,6 +337,11 @@
      Configuration Item: <literal>APT::Install-Recommends</literal>.</para></listitem>
      </varlistentry>
 
+     <varlistentry><term><option>--install-suggests</option></term>
+     <listitem><para>Consider suggested packages as a dependency for installing.
+     Configuration Item: <literal>APT::Install-Suggests</literal>.</para></listitem>
+     </varlistentry>
+
      <varlistentry><term><option>-d</option></term><term><option>--download-only</option></term>
      <listitem><para>Download only; package files are only retrieved, not unpacked or installed.
      Configuration Item: <literal>APT::Get::Download-Only</literal>.</para></listitem>

+ 4 - 2
doc/apt.conf.5.xml

@@ -52,8 +52,10 @@
       <listitem><para>all files in <literal>Dir::Etc::Parts</literal> in
 	 alphanumeric ascending order which have no or "<literal>conf</literal>"
 	 as filename extension and which only contain alphanumeric,
-	 hyphen (-), underscore (_) and period (.) characters -
-	 otherwise they will be silently ignored.</para></listitem>
+	 hyphen (-), underscore (_) and period (.) characters.
+	 Otherwise APT will print a notice that it has ignored a file if the file
+	 doesn't match a pattern in the <literal>Dir::Ignore-Files-Silently</literal>
+	 configuration list - in this case it will be silently ignored.</para></listitem>
       <listitem><para>the main configuration file specified by
 	 <literal>Dir::Etc::main</literal></para></listitem>
       <listitem><para>the command line options are applied to override the

+ 4 - 2
doc/apt_preferences.5.xml

@@ -71,8 +71,10 @@ You have been warned.</para>
 directory are parsed in alphanumeric ascending order and need to obey the
 following naming convention: The files have no or "<literal>pref</literal>"
 as filename extension and which only contain alphanumeric,  hyphen (-),
-underscore (_) and period (.) characters - otherwise they will be silently
-ignored.</para>
+underscore (_) and period (.) characters.
+Otherwise APT will print a notice that it has ignored a file if the file
+doesn't match a pattern in the <literal>Dir::Ignore-Files-Silently</literal>
+configuration list - in this case it will be silently ignored.</para>
 
 <refsect2><title>APT's Default Priority Assignments</title>
 

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 763 - 744
doc/po/apt-doc.pot


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 974 - 789
doc/po/de.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 972 - 785
doc/po/es.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 945 - 830
doc/po/fr.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 789 - 767
doc/po/it.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 963 - 791
doc/po/ja.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 895 - 779
doc/po/pl.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 972 - 786
doc/po/pt.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 789 - 767
doc/po/pt_BR.po


+ 3 - 1
doc/sources.list.5.xml

@@ -57,7 +57,9 @@
    File names need to end with
    <filename>.list</filename> and may only contain letters (a-z and A-Z),
    digits (0-9), underscore (_), hyphen (-) and period (.) characters.
-   Otherwise they will be silently ignored.</para>
+   Otherwise APT will print a notice that it has ignored a file if the file
+   doesn't match a pattern in the <literal>Dir::Ignore-Files-Silently</literal>
+   configuration list - in this case it will be silently ignored.</para>
  </refsect1>
 
  <refsect1><title>The deb and deb-src types</title>

+ 2 - 0
ftparchive/apt-ftparchive.cc

@@ -949,6 +949,8 @@ int main(int argc, const char *argv[])
    CommandLine::Args Args[] = {
       {'h',"help","help",0},
       {0,"md5","APT::FTPArchive::MD5",0},
+      {0,"sha1","APT::FTPArchive::SHA1",0},
+      {0,"sha256","APT::FTPArchive::SHA256",0},
       {'v',"version","version",0},
       {'d',"db","APT::FTPArchive::DB",CommandLine::HasArg},
       {'s',"source-override","APT::FTPArchive::SourceOverride",CommandLine::HasArg},

+ 3 - 24
ftparchive/contents.cc

@@ -36,12 +36,13 @@
 #include "contents.h"
 
 #include <apti18n.h>
+#include <apt-pkg/debfile.h>
 #include <apt-pkg/extracttar.h>
 #include <apt-pkg/error.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <malloc.h>    
+#include <malloc.h>
 									/*}}}*/
 
 // GenContents::~GenContents - Free allocated memory			/*{{{*/
@@ -305,29 +306,7 @@ void GenContents::DoPrint(FILE *Out,GenContents::Node *Top, char *Buf)
 bool ContentsExtract::Read(debDebFile &Deb)
 {
    Reset();
-   
-   // Get the archive member and positition the file 
-   const ARArchive::Member *Member = Deb.GotoMember("data.tar.gz");
-   const char *Compressor = "gzip";
-   if (Member == 0) {
-      Member = Deb.GotoMember("data.tar.bz2");
-      Compressor = "bzip2";
-   }
-   if (Member == 0) {
-      Member = Deb.GotoMember("data.tar.lzma");
-      Compressor = "lzma";
-   }
-   if (Member == 0) {
-      _error->Error(_("Internal error, could not locate member %s"),
-		    "data.tar.{gz,bz2,lzma}");
-      return false;
-   }
-      
-   // Extract it.
-   ExtractTar Tar(Deb.GetFile(),Member->Size,Compressor);
-   if (Tar.Go(*this) == false)
-      return false;   
-   return true;   
+   return Deb.ExtractArchive(*this);
 }
 									/*}}}*/
 // ContentsExtract::DoItem - Extract an item				/*{{{*/

+ 28 - 30
ftparchive/multicompress.cc

@@ -30,12 +30,6 @@
 
 using namespace std;
 
-const MultiCompress::CompType MultiCompress::Compressors[] =
-      {{".","",0,0,0,1},
-       {"gzip",".gz","gzip","-9n","-d",2},
-       {"bzip2",".bz2","bzip2","-9","-d",3},
-       {"lzma",".lzma","lzma","-9","-d",4},
-       {}};
 
 // MultiCompress::MultiCompress - Constructor				/*{{{*/
 // ---------------------------------------------------------------------
@@ -48,7 +42,7 @@ MultiCompress::MultiCompress(string const &Output,string const &Compress,
    Outputter = -1;
    Input = 0;
    UpdateMTime = 0;
-   
+
    /* Parse the compression string, a space separated lists of compresison
       types */
    string::const_iterator I = Compress.begin();
@@ -61,13 +55,14 @@ MultiCompress::MultiCompress(string const &Output,string const &Compress,
       for (; I != Compress.end() && !isspace(*I); I++);
 
       // Find the matching compressor
-      const CompType *Comp = Compressors;
-      for (; Comp->Name != 0; Comp++)
-	 if (stringcmp(Start,I,Comp->Name) == 0)
+      std::vector<APT::Configuration::Compressor> Compressors = APT::Configuration::getCompressors();
+      std::vector<APT::Configuration::Compressor>::const_iterator Comp = Compressors.begin();
+      for (; Comp != Compressors.end(); ++Comp)
+	 if (stringcmp(Start,I,Comp->Name.c_str()) == 0)
 	    break;
 
       // Hmm.. unknown.
-      if (Comp->Name == 0)
+      if (Comp == Compressors.end())
       {
 	 _error->Warning(_("Unknown compression algorithm '%s'"),string(Start,I).c_str());
 	 continue;
@@ -77,7 +72,7 @@ MultiCompress::MultiCompress(string const &Output,string const &Compress,
       Files *NewOut = new Files;
       NewOut->Next = Outputs;
       Outputs = NewOut;
-      NewOut->CompressProg = Comp;
+      NewOut->CompressProg = *Comp;
       NewOut->Output = Output+Comp->Extension;
       
       struct stat St;
@@ -141,13 +136,14 @@ bool MultiCompress::GetStat(string const &Output,string const &Compress,struct s
       for (; I != Compress.end() && !isspace(*I); I++);
 
       // Find the matching compressor
-      const CompType *Comp = Compressors;
-      for (; Comp->Name != 0; Comp++)
-	 if (stringcmp(Start,I,Comp->Name) == 0)
+      std::vector<APT::Configuration::Compressor> Compressors = APT::Configuration::getCompressors();
+      std::vector<APT::Configuration::Compressor>::const_iterator Comp = Compressors.begin();
+      for (; Comp != Compressors.end(); ++Comp)
+	 if (stringcmp(Start,I,Comp->Name.c_str()) == 0)
 	    break;
 
       // Hmm.. unknown.
-      if (Comp->Name == 0)
+      if (Comp == Compressors.end())
 	 continue;
 
       string Name = Output+Comp->Extension;
@@ -268,13 +264,13 @@ bool MultiCompress::Finalize(unsigned long &OutSize)
 /* This opens the compressor, either in compress mode or decompress 
    mode. FileFd is always the compressor input/output file, 
    OutFd is the created pipe, Input for Compress, Output for Decompress. */
-bool MultiCompress::OpenCompress(const CompType *Prog,pid_t &Pid,int const &FileFd,
-				 int &OutFd,bool const &Comp)
+bool MultiCompress::OpenCompress(APT::Configuration::Compressor const &Prog,
+				 pid_t &Pid,int const &FileFd,int &OutFd,bool const &Comp)
 {
    Pid = -1;
    
    // No compression
-   if (Prog->Binary == 0)
+   if (Prog.Binary.empty() == true)
    {
       OutFd = dup(FileFd);
       return true;
@@ -309,15 +305,17 @@ bool MultiCompress::OpenCompress(const CompType *Prog,pid_t &Pid,int const &File
       
       SetCloseExec(STDOUT_FILENO,false);
       SetCloseExec(STDIN_FILENO,false);
-      
-      const char *Args[3];
-      Args[0] = Prog->Binary;
-      if (Comp == true)
-	 Args[1] = Prog->CompArgs;
-      else
-	 Args[1] = Prog->UnCompArgs;
-      Args[2] = 0;
-      execvp(Args[0],(char **)Args);
+
+      std::vector<char const*> Args;
+      Args.push_back(Prog.Binary.c_str());
+      std::vector<std::string> const * const addArgs =
+		(Comp == true) ? &(Prog.CompressArgs) : &(Prog.UncompressArgs);
+      for (std::vector<std::string>::const_iterator a = addArgs->begin();
+	   a != addArgs->end(); ++a)
+	 Args.push_back(a->c_str());
+      Args.push_back(NULL);
+
+      execvp(Args[0],(char **)&Args[0]);
       cerr << _("Failed to exec compressor ") << Args[0] << endl;
       _exit(100);
    };      
@@ -335,7 +333,7 @@ bool MultiCompress::OpenOld(int &Fd,pid_t &Proc)
 {
    Files *Best = Outputs;
    for (Files *I = Outputs; I != 0; I = I->Next)
-      if (Best->CompressProg->Cost > I->CompressProg->Cost)
+      if (Best->CompressProg.Cost > I->CompressProg.Cost)
 	 Best = I;
 
    // Open the file
@@ -414,7 +412,7 @@ bool MultiCompress::Child(int const &FD)
    for (Files *I = Outputs; I != 0; I = I->Next)
    {
       if (I->CompressProc != -1)
-	 ExecWait(I->CompressProc,I->CompressProg->Binary,false);
+	 ExecWait(I->CompressProc, I->CompressProg.Binary.c_str(), false);
    }
    
    if (_error->PendingError() == true)

+ 5 - 16
ftparchive/multicompress.h

@@ -20,28 +20,18 @@
 
 #include <string>
 #include <apt-pkg/fileutl.h>
+#include <apt-pkg/aptconfiguration.h>
 #include <stdio.h>
 #include <sys/types.h>
     
 class MultiCompress
 {
-   // Enumeration of all supported compressors
-   struct CompType
-   {
-      const char *Name;
-      const char *Extension;
-      const char *Binary;
-      const char *CompArgs;
-      const char *UnCompArgs;
-      unsigned char Cost;
-   };
-
    // An output file
    struct Files
    {
       string Output;
-      const CompType *CompressProg;
-      Files *Next;      
+      APT::Configuration::Compressor CompressProg;
+      Files *Next;
       FileFd TmpFile;
       pid_t CompressProc;
       time_t OldMTime;
@@ -51,10 +41,9 @@ class MultiCompress
    Files *Outputs;
    pid_t Outputter;
    mode_t Permissions;
-   static const CompType Compressors[];
 
-   bool OpenCompress(const CompType *Prog,pid_t &Pid,int const &FileFd,
-		     int &OutFd,bool const &Comp);
+   bool OpenCompress(APT::Configuration::Compressor const &Prog,
+		     pid_t &Pid,int const &FileFd, int &OutFd,bool const &Comp);
    bool Child(int const &Fd);
    bool Start();
    bool Die();

+ 95 - 56
ftparchive/writer.cc

@@ -17,6 +17,7 @@
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/configuration.h>
+#include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/md5.h>
 #include <apt-pkg/sha1.h>
 #include <apt-pkg/sha256.h>
@@ -59,6 +60,10 @@ FTWScanner::FTWScanner(string const &Arch): Arch(Arch)
 {
    ErrorPrinted = false;
    NoLinkAct = !_config->FindB("APT::FTPArchive::DeLinkAct",true);
+
+   DoMD5 = _config->FindB("APT::FTPArchive::MD5",true);
+   DoSHA1 = _config->FindB("APT::FTPArchive::SHA1",true);
+   DoSHA256 = _config->FindB("APT::FTPArchive::SHA256",true);
 }
 									/*}}}*/
 // FTWScanner::Scanner - FTW Scanner					/*{{{*/
@@ -308,9 +313,9 @@ PackagesWriter::PackagesWriter(string const &DB,string const &Overrides,string c
    DeLinkLimit = 0;
 
    // Process the command line options
-   DoMD5 = _config->FindB("APT::FTPArchive::MD5",true);
-   DoSHA1 = _config->FindB("APT::FTPArchive::SHA1",true);
-   DoSHA256 = _config->FindB("APT::FTPArchive::SHA256",true);
+   DoMD5 = _config->FindB("APT::FTPArchive::Packages::MD5",DoMD5);
+   DoSHA1 = _config->FindB("APT::FTPArchive::Packages::SHA1",DoSHA1);
+   DoSHA256 = _config->FindB("APT::FTPArchive::Packages::SHA256",DoSHA256);
    DoAlwaysStat = _config->FindB("APT::FTPArchive::AlwaysStat", false);
    DoContents = _config->FindB("APT::FTPArchive::Contents",true);
    NoOverride = _config->FindB("APT::FTPArchive::NoOverrideMsg",false);
@@ -435,9 +440,12 @@ bool PackagesWriter::DoPackage(string FileName)
 
    unsigned int End = 0;
    SetTFRewriteData(Changes[End++], "Size", Size);
-   SetTFRewriteData(Changes[End++], "MD5sum", Db.MD5Res.c_str());
-   SetTFRewriteData(Changes[End++], "SHA1", Db.SHA1Res.c_str());
-   SetTFRewriteData(Changes[End++], "SHA256", Db.SHA256Res.c_str());
+   if (DoMD5 == true)
+      SetTFRewriteData(Changes[End++], "MD5sum", Db.MD5Res.c_str());
+   if (DoSHA1 == true)
+      SetTFRewriteData(Changes[End++], "SHA1", Db.SHA1Res.c_str());
+   if (DoSHA256 == true)
+      SetTFRewriteData(Changes[End++], "SHA256", Db.SHA256Res.c_str());
    SetTFRewriteData(Changes[End++], "Filename", NewFileName.c_str());
    SetTFRewriteData(Changes[End++], "Priority", OverItem->Priority.c_str());
    SetTFRewriteData(Changes[End++], "Status", 0);
@@ -559,6 +567,9 @@ SourcesWriter::SourcesWriter(string const &BOverrides,string const &SOverrides,
    BufSize = 0;
    
    // Process the command line options
+   DoMD5 = _config->FindB("APT::FTPArchive::Sources::MD5",DoMD5);
+   DoSHA1 = _config->FindB("APT::FTPArchive::Sources::SHA1",DoSHA1);
+   DoSHA256 = _config->FindB("APT::FTPArchive::Sources::SHA256",DoSHA256);
    NoOverride = _config->FindB("APT::FTPArchive::NoOverrideMsg",false);
 
    // Read the override file
@@ -608,13 +619,17 @@ bool SourcesWriter::DoPackage(string FileName)
    // Hash the file
    char *Start = Buffer;
    char *BlkEnd = Buffer + St.st_size;
-   MD5Summation MD5;
-   MD5.Add((unsigned char *)Start,BlkEnd - Start);
 
+   MD5Summation MD5;
    SHA1Summation SHA1;
    SHA256Summation SHA256;
-   SHA1.Add((unsigned char *)Start,BlkEnd - Start);
-   SHA256.Add((unsigned char *)Start,BlkEnd - Start);
+
+   if (DoMD5 == true)
+      MD5.Add((unsigned char *)Start,BlkEnd - Start);
+   if (DoSHA1 == true)
+      SHA1.Add((unsigned char *)Start,BlkEnd - Start);
+   if (DoSHA256 == true)
+      SHA256.Add((unsigned char *)Start,BlkEnd - Start);
 
    // Add an extra \n to the end, just in case
    *BlkEnd++ = '\n';
@@ -708,19 +723,19 @@ bool SourcesWriter::DoPackage(string FileName)
    // Add the dsc to the files hash list
    string const strippedName = flNotDir(FileName);
    std::ostringstream ostreamFiles;
-   if (Tags.Exists("Files"))
+   if (DoMD5 == true && Tags.Exists("Files"))
       ostreamFiles << "\n " << string(MD5.Result()) << " " << St.st_size << " "
 		   << strippedName << "\n " << Tags.FindS("Files");
    string const Files = ostreamFiles.str();
 
    std::ostringstream ostreamSha1;
-   if (Tags.Exists("Checksums-Sha1"))
+   if (DoSHA1 == true && Tags.Exists("Checksums-Sha1"))
       ostreamSha1 << "\n " << string(SHA1.Result()) << " " << St.st_size << " "
 		   << strippedName << "\n " << Tags.FindS("Checksums-Sha1");
    string const ChecksumsSha1 = ostreamSha1.str();
 
    std::ostringstream ostreamSha256;
-   if (Tags.Exists("Checksums-Sha256"))
+   if (DoSHA256 == true && Tags.Exists("Checksums-Sha256"))
       ostreamSha256 << "\n " << string(SHA256.Result()) << " " << St.st_size << " "
 		   << strippedName << "\n " << Tags.FindS("Checksums-Sha256");
    string const ChecksumsSha256 = ostreamSha256.str();
@@ -774,9 +789,12 @@ bool SourcesWriter::DoPackage(string FileName)
 
    unsigned int End = 0;
    SetTFRewriteData(Changes[End++],"Source",Package.c_str(),"Package");
-   SetTFRewriteData(Changes[End++],"Files",Files.c_str());
-   SetTFRewriteData(Changes[End++],"Checksums-Sha1",ChecksumsSha1.c_str());
-   SetTFRewriteData(Changes[End++],"Checksums-Sha256",ChecksumsSha256.c_str());
+   if (Files.empty() == false)
+      SetTFRewriteData(Changes[End++],"Files",Files.c_str());
+   if (ChecksumsSha1.empty() == false)
+      SetTFRewriteData(Changes[End++],"Checksums-Sha1",ChecksumsSha1.c_str());
+   if (ChecksumsSha256.empty() == false)
+      SetTFRewriteData(Changes[End++],"Checksums-Sha256",ChecksumsSha256.c_str());
    if (Directory != "./")
       SetTFRewriteData(Changes[End++],"Directory",Directory.c_str());
    SetTFRewriteData(Changes[End++],"Priority",BestPrio.c_str());
@@ -913,10 +931,12 @@ ReleaseWriter::ReleaseWriter(string const &DB)
       AddPattern("Packages.gz");
       AddPattern("Packages.bz2");
       AddPattern("Packages.lzma");
+      AddPattern("Packages.xz");
       AddPattern("Sources");
       AddPattern("Sources.gz");
       AddPattern("Sources.bz2");
       AddPattern("Sources.lzma");
+      AddPattern("Sources.xz");
       AddPattern("Release");
       AddPattern("Index");
       AddPattern("md5sum.txt");
@@ -925,6 +945,9 @@ ReleaseWriter::ReleaseWriter(string const &DB)
 
    Output = stdout;
    time_t const now = time(NULL);
+
+   setlocale(LC_TIME, "C");
+
    char datestr[128];
    if (strftime(datestr, sizeof(datestr), "%a, %d %b %Y %H:%M:%S UTC",
                 gmtime(&now)) == 0)
@@ -941,6 +964,8 @@ ReleaseWriter::ReleaseWriter(string const &DB)
       validstr[0] = '\0';
    }
 
+   setlocale(LC_TIME, "");
+
    map<string,string> Fields;
    Fields["Origin"] = "";
    Fields["Label"] = "";
@@ -964,6 +989,10 @@ ReleaseWriter::ReleaseWriter(string const &DB)
 
       fprintf(Output, "%s: %s\n", (*I).first.c_str(), Value.c_str());
    }
+
+   DoMD5 = _config->FindB("APT::FTPArchive::Release::MD5",DoMD5);
+   DoSHA1 = _config->FindB("APT::FTPArchive::Release::SHA1",DoSHA1);
+   DoSHA256 = _config->FindB("APT::FTPArchive::Release::SHA256",DoSHA256);
 }
 									/*}}}*/
 // ReleaseWriter::DoPackage - Process a single package			/*{{{*/
@@ -996,19 +1025,26 @@ bool ReleaseWriter::DoPackage(string FileName)
 
    CheckSums[NewFileName].size = fd.Size();
 
-   MD5Summation MD5;
-   MD5.AddFD(fd.Fd(), fd.Size());
-   CheckSums[NewFileName].MD5 = MD5.Result();
-
-   fd.Seek(0);
-   SHA1Summation SHA1;
-   SHA1.AddFD(fd.Fd(), fd.Size());
-   CheckSums[NewFileName].SHA1 = SHA1.Result();
-
-   fd.Seek(0);
-   SHA256Summation SHA256;
-   SHA256.AddFD(fd.Fd(), fd.Size());
-   CheckSums[NewFileName].SHA256 = SHA256.Result();
+   if (DoMD5 == true)
+   {
+      MD5Summation MD5;
+      MD5.AddFD(fd.Fd(), fd.Size());
+      CheckSums[NewFileName].MD5 = MD5.Result();
+      fd.Seek(0);
+   }
+   if (DoSHA1 == true)
+   {
+      SHA1Summation SHA1;
+      SHA1.AddFD(fd.Fd(), fd.Size());
+      CheckSums[NewFileName].SHA1 = SHA1.Result();
+      fd.Seek(0);
+   }
+   if (DoSHA256 == true)
+   {
+      SHA256Summation SHA256;
+      SHA256.AddFD(fd.Fd(), fd.Size());
+      CheckSums[NewFileName].SHA256 = SHA256.Result();
+   }
 
    fd.Close();
    
@@ -1020,37 +1056,40 @@ bool ReleaseWriter::DoPackage(string FileName)
 // ---------------------------------------------------------------------
 void ReleaseWriter::Finish()
 {
-   fprintf(Output, "MD5Sum:\n");
-   for(map<string,struct CheckSum>::const_iterator I = CheckSums.begin();
-       I != CheckSums.end();
-       ++I)
+   if (DoMD5 == true)
    {
-      fprintf(Output, " %s %16ld %s\n",
-              (*I).second.MD5.c_str(),
-              (*I).second.size,
-              (*I).first.c_str());
+      fprintf(Output, "MD5Sum:\n");
+      for(map<string,struct CheckSum>::const_iterator I = CheckSums.begin();
+	  I != CheckSums.end(); ++I)
+      {
+	 fprintf(Output, " %s %16ld %s\n",
+		 (*I).second.MD5.c_str(),
+		 (*I).second.size,
+		 (*I).first.c_str());
+      }
    }
-
-   fprintf(Output, "SHA1:\n");
-   for(map<string,struct CheckSum>::const_iterator I = CheckSums.begin();
-       I != CheckSums.end();
-       ++I)
+   if (DoSHA1 == true)
    {
-      fprintf(Output, " %s %16ld %s\n",
-              (*I).second.SHA1.c_str(),
-              (*I).second.size,
-              (*I).first.c_str());
+      fprintf(Output, "SHA1:\n");
+      for(map<string,struct CheckSum>::const_iterator I = CheckSums.begin();
+	  I != CheckSums.end(); ++I)
+      {
+	 fprintf(Output, " %s %16ld %s\n",
+		 (*I).second.SHA1.c_str(),
+		 (*I).second.size,
+		 (*I).first.c_str());
+      }
    }
-
-   fprintf(Output, "SHA256:\n");
-   for(map<string,struct CheckSum>::const_iterator I = CheckSums.begin();
-       I != CheckSums.end();
-       ++I)
+   if (DoSHA256 == true)
    {
-      fprintf(Output, " %s %16ld %s\n",
-              (*I).second.SHA256.c_str(),
-              (*I).second.size,
-              (*I).first.c_str());
+      fprintf(Output, "SHA256:\n");
+      for(map<string,struct CheckSum>::const_iterator I = CheckSums.begin();
+	  I != CheckSums.end(); ++I)
+      {
+	 fprintf(Output, " %s %16ld %s\n",
+		 (*I).second.SHA256.c_str(),
+		 (*I).second.size,
+		 (*I).first.c_str());
+      }
    }
 }
-

+ 3 - 3
ftparchive/writer.h

@@ -60,6 +60,9 @@ class FTWScanner
    }
    
    public:
+   bool DoMD5;
+   bool DoSHA1;
+   bool DoSHA256;
 
    unsigned long DeLinkLimit;
    string InternalPrefix;
@@ -103,9 +106,6 @@ class PackagesWriter : public FTWScanner
    public:
 
    // Some flags
-   bool DoMD5;
-   bool DoSHA1;
-   bool DoSHA256;
    bool DoAlwaysStat;
    bool NoOverride;
    bool DoContents;

+ 8 - 2
methods/makefile

@@ -94,8 +94,8 @@ SOURCE = bzip2.cc
 include $(PROGRAM_H)
 
 # SSH and lzma method symlink
-binary: $(BIN)/ssh $(BIN)/lzma
-veryclean: clean-$(BIN)/ssh clean-$(BIN)/lzma
+binary: $(BIN)/ssh $(BIN)/lzma $(BIN)/xz
+veryclean: clean-$(BIN)/ssh clean-$(BIN)/lzma clean-$(BIN)/xz
 
 $(BIN)/ssh:
 	echo "Installing ssh method link"
@@ -108,3 +108,9 @@ $(BIN)/lzma:
 	ln -fs bzip2 $(BIN)/lzma
 clean-$(BIN)/lzma:
 	-rm $(BIN)/lzma
+
+$(BIN)/xz:
+	echo "Installing xz method link"
+	ln -fs bzip2 $(BIN)/xz
+clean-$(BIN)/xz:
+	-rm $(BIN)/xz

+ 12 - 5
methods/rred.cc

@@ -252,13 +252,20 @@ struct EdCommand {								/*{{{*/
 RredMethod::State RredMethod::patchMMap(FileFd &Patch, FileFd &From,		/*{{{*/
 					FileFd &out_file, Hashes *hash) const {
 #ifdef _POSIX_MAPPED_FILES
-	MMap ed_cmds(Patch, MMap::ReadOnly);
+	MMap ed_cmds(MMap::ReadOnly);
 	if (Patch.gzFd() != NULL) {
 		unsigned long mapSize = Patch.Size();
-		DynamicMMap dyn(0, mapSize, 0);
-		gzread(Patch.gzFd(), dyn.Data(), mapSize);
-		ed_cmds = dyn;
-	}
+		DynamicMMap* dyn = new DynamicMMap(0, mapSize, 0);
+		if (dyn->validData() == false) {
+			delete dyn;
+			return MMAP_FAILED;
+		}
+		dyn->AddSize(mapSize);
+		gzread(Patch.gzFd(), dyn->Data(), mapSize);
+		ed_cmds = *dyn;
+	} else
+		ed_cmds = MMap(Patch, MMap::ReadOnly);
+
 	MMap in_file(From, MMap::ReadOnly);
 
 	if (ed_cmds.Size() == 0 || in_file.Size() == 0)

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 329 - 277
po/ar.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 334 - 279
po/ast.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 333 - 278
po/bg.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 329 - 277
po/bs.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 335 - 280
po/ca.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 335 - 280
po/cs.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 331 - 277
po/cy.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 334 - 279
po/da.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 337 - 282
po/de.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 330 - 277
po/dz.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 334 - 281
po/el.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 491 - 343
po/es.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 334 - 281
po/eu.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 334 - 281
po/fi.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 352 - 287
po/fr.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 334 - 281
po/gl.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 328 - 275
po/hu.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 335 - 203
po/it.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 336 - 281
po/ja.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 330 - 277
po/km.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 329 - 274
po/ko.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 329 - 277
po/ku.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 330 - 277
po/lt.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 330 - 277
po/mr.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 333 - 278
po/nb.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 330 - 277
po/ne.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 334 - 281
po/nl.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 330 - 277
po/nn.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 334 - 281
po/pl.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 335 - 280
po/pt.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 334 - 281
po/pt_BR.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 335 - 282
po/ro.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 335 - 280
po/ru.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 336 - 281
po/sk.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 339 - 281
po/sl.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 336 - 280
po/sv.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 330 - 277
po/th.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 330 - 277
po/tl.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 330 - 277
po/uk.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 330 - 275
po/vi.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 329 - 274
po/zh_CN.po


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 330 - 277
po/zh_TW.po


+ 0 - 0
test/integration/create-test-data


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio