From 92437804ab54fc95da65a3a35e690f9023db2f57 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 2 Feb 2011 22:43:14 +0100 Subject: * debian/control: - make Vcs-Bzr point to http://bzr.debian.org/apt/debian-squeeze branch --- debian/changelog | 8 ++++++++ debian/control | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d4ac384e2..76f137ea1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +apt (0.8.10.4) UNRELEASED; urgency=low + + * debian/control: + - make Vcs-Bzr point to http://bzr.debian.org/apt/debian-squeeze + branch + + -- Michael Vogt Wed, 02 Feb 2011 22:42:36 +0100 + apt (0.8.10.3) unstable; urgency=low [ Programs translations ] diff --git a/debian/control b/debian/control index 87e885f6a..59bf7a7a7 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Uploaders: Michael Vogt , Otavio Salvador , Standards-Version: 3.9.0 Build-Depends: debhelper (>= 5.0), 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 -Vcs-Bzr: http://bzr.debian.org/apt/debian-sid/ +Vcs-Bzr: http://bzr.debian.org/apt/debian-squeeze Package: apt Architecture: any -- cgit v1.2.3 From c7ce5038c9caa0730d037fff0b448d9e32ae5552 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 22 Feb 2011 11:16:47 +0100 Subject: fix the pointer to the VCS-Bzr --- debian/changelog | 7 ++++--- debian/control | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 76f137ea1..695b362ed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,11 @@ -apt (0.8.10.4) UNRELEASED; urgency=low +apt (0.8.10.3+squeeze1) UNRELEASED; urgency=low + [ Michael Vogt ] * debian/control: - - make Vcs-Bzr point to http://bzr.debian.org/apt/debian-squeeze + - make Vcs-Bzr point to http://bzr.debian.org/apt/apt/debian-squeeze branch - -- Michael Vogt Wed, 02 Feb 2011 22:42:36 +0100 + -- David Kalnischkies Tue, 22 Feb 2011 11:15:06 +0100 apt (0.8.10.3) unstable; urgency=low diff --git a/debian/control b/debian/control index 59bf7a7a7..0eea1a800 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Uploaders: Michael Vogt , Otavio Salvador , Standards-Version: 3.9.0 Build-Depends: debhelper (>= 5.0), 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 -Vcs-Bzr: http://bzr.debian.org/apt/debian-squeeze +Vcs-Bzr: http://bzr.debian.org/apt/apt/debian-squeeze/ Package: apt Architecture: any -- cgit v1.2.3 From a7476cb43894d6d019d6ecde31ff418fc472c2b6 Mon Sep 17 00:00:00 2001 From: Christian Perrier Date: Tue, 22 Feb 2011 11:21:18 +0100 Subject: =?UTF-8?q?Fix=20error=20in=20French=20translation=20of=20manpages?= =?UTF-8?q?=20(apt=5Fpreferences(5)).=20Merci,=20R=C3=A9mi=20Vanicat.=20Cl?= =?UTF-8?q?oses:=20#613689?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 7 ++++++- doc/po/fr.po | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 695b362ed..364203044 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,7 +5,12 @@ apt (0.8.10.3+squeeze1) UNRELEASED; urgency=low - make Vcs-Bzr point to http://bzr.debian.org/apt/apt/debian-squeeze branch - -- David Kalnischkies Tue, 22 Feb 2011 11:15:06 +0100 + [ Christian Perrier ] + * Fix error in French translation of manpages (apt_preferences(5)). + Merci, Rémi Vanicat. Closes: #613689 + + + -- David Kalnischkies Tue, 22 Feb 2011 11:19:50 +0100 apt (0.8.10.3) unstable; urgency=low diff --git a/doc/po/fr.po b/doc/po/fr.po index cd95d1727..ddfc525ff 100644 --- a/doc/po/fr.po +++ b/doc/po/fr.po @@ -8809,7 +8809,7 @@ msgstr "" "\n" "Explanation: Debian unstable porte toujours le nom sid\n" "Package: *\n" -"Pin: release a=sid\n" +"Pin: release n=sid\n" "Pin-Priority: 800\n" "\n" "Package: *\n" -- cgit v1.2.3 From 0ff1a4556c0a0fb76ce48e88031eff2b4d613c5e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 22 Feb 2011 11:26:47 +0100 Subject: =?UTF-8?q?*=20apt-pkg/contrib/fileutl.cc:=20=20=20-=20reorder=20t?= =?UTF-8?q?he=20loaded=20filesize=20bytes=20for=20big=20endian=20(Closes:?= =?UTF-8?q?=20#612986)=20=20=20=20=20Thanks=20to=20J=C3=B6rg=20Sommer=20fo?= =?UTF-8?q?r=20the=20detailed=20analyse!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apt-pkg/contrib/fileutl.cc | 14 +++++++++++++- debian/changelog | 6 +++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index f4ab066d7..266d480a4 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -42,6 +42,11 @@ #include #include #include + +#include +#ifdef WORDS_BIGENDIAN +#include +#endif /*}}}*/ using namespace std; @@ -940,9 +945,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"); diff --git a/debian/changelog b/debian/changelog index 364203044..b3907ac0f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,8 +9,12 @@ apt (0.8.10.3+squeeze1) UNRELEASED; urgency=low * Fix error in French translation of manpages (apt_preferences(5)). Merci, Rémi Vanicat. Closes: #613689 + [ David Kalnischkies ] + * apt-pkg/contrib/fileutl.cc: + - reorder the loaded filesize bytes for big endian (Closes: #612986) + Thanks to Jörg Sommer for the detailed analyse! - -- David Kalnischkies Tue, 22 Feb 2011 11:19:50 +0100 + -- David Kalnischkies Tue, 22 Feb 2011 11:25:58 +0100 apt (0.8.10.3) unstable; urgency=low -- cgit v1.2.3 From bc33e0f0b6b1fdb010dcd4a49a78b827530052aa Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 22 Feb 2011 12:50:47 +0100 Subject: * 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 --- apt-inst/deb/debfile.cc | 8 +++++++- debian/changelog | 5 ++++- ftparchive/contents.cc | 6 +++++- ftparchive/multicompress.cc | 1 + test/integration/framework | 8 +++++--- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/apt-inst/deb/debfile.cc b/apt-inst/deb/debfile.cc index cd7a88808..edd78adbb 100644 --- a/apt-inst/deb/debfile.cc +++ b/apt-inst/deb/debfile.cc @@ -46,7 +46,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; } @@ -136,6 +138,10 @@ bool debDebFile::ExtractArchive(pkgDirStream &Stream) Member = AR.FindMember("data.tar.lzma"); Compressor = "lzma"; } + if (Member == 0) { + Member = AR.FindMember("data.tar.xz"); + Compressor = "xz"; + } if (Member == 0) return _error->Error(_("Internal error, could not locate member")); if (File.Seek(Member->Start) == false) diff --git a/debian/changelog b/debian/changelog index b3907ac0f..bf72e350d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,8 +13,11 @@ apt (0.8.10.3+squeeze1) UNRELEASED; urgency=low * apt-pkg/contrib/fileutl.cc: - reorder the loaded filesize bytes for big endian (Closes: #612986) Thanks to Jörg Sommer for the detailed analyse! + * 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 - -- David Kalnischkies Tue, 22 Feb 2011 11:25:58 +0100 + -- David Kalnischkies Tue, 22 Feb 2011 12:47:31 +0100 apt (0.8.10.3) unstable; urgency=low diff --git a/ftparchive/contents.cc b/ftparchive/contents.cc index b761d9204..9e283cf33 100644 --- a/ftparchive/contents.cc +++ b/ftparchive/contents.cc @@ -317,9 +317,13 @@ bool ContentsExtract::Read(debDebFile &Deb) Member = Deb.GotoMember("data.tar.lzma"); Compressor = "lzma"; } + if (Member == 0) { + Member = Deb.GotoMember("data.tar.xz"); + Compressor = "xz"; + } if (Member == 0) { _error->Error(_("Internal error, could not locate member %s"), - "data.tar.{gz,bz2,lzma}"); + "data.tar.{gz,bz2,lzma,xz}"); return false; } diff --git a/ftparchive/multicompress.cc b/ftparchive/multicompress.cc index bb4beedf9..c33414a11 100644 --- a/ftparchive/multicompress.cc +++ b/ftparchive/multicompress.cc @@ -35,6 +35,7 @@ const MultiCompress::CompType MultiCompress::Compressors[] = {"gzip",".gz","gzip","-9n","-d",2}, {"bzip2",".bz2","bzip2","-9","-d",3}, {"lzma",".lzma","lzma","-9","-d",4}, + {"xz",".xz","xz","-6","-d",5}, {}}; // MultiCompress::MultiCompress - Constructor /*{{{*/ diff --git a/test/integration/framework b/test/integration/framework index 2422f0886..6545cf3ce 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -251,9 +251,9 @@ createaptftparchiveconfig() { echo -n '"; }; Default { - Packages::Compress ". gzip bzip2 lzma"; - Sources::Compress ". gzip bzip2 lzma"; - Contents::Compress ". gzip bzip2 lzma"; + Packages::Compress ". gzip bzip2 lzma xz"; + Sources::Compress ". gzip bzip2 lzma xz"; + Contents::Compress ". gzip bzip2 lzma xz"; }; TreeDefault { Directory "pool/"; @@ -332,6 +332,7 @@ buildaptarchivefromfiles() { cat Packages | gzip > Packages.gz cat Packages | bzip2 > Packages.bz2 cat Packages | lzma > Packages.lzma + cat Packages | xz > Packages.xz msgdone "info" fi if [ -f Sources ]; then @@ -339,6 +340,7 @@ buildaptarchivefromfiles() { cat Sources | gzip > Sources.gz cat Sources | bzip2 > Sources.bz2 cat Sources | lzma > Sources.lzma + cat Sources | xz > Sources.xz msgdone "info" fi msgninfo "\tRelease file… " -- cgit v1.2.3 From cb12d0a677b63b6faeaefeda475c466d66fed212 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 22 Feb 2011 13:24:40 +0100 Subject: * ftparchive/writer.cc: - ensure that Date and Valid-Until time strings are not localised --- debian/changelog | 8 +++++++- ftparchive/writer.cc | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index bb0b11147..4712e80c4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,16 @@ + apt (0.8.11.6) UNRELEASED; urgency=low + [ Christian Perrier ] * Fix error in French translation of manpages (apt_preferences(5)). Merci, Rémi Vanicat. Closes: #613689 * Complete French manpage translation - -- Christian Perrier Fri, 18 Feb 2011 05:53:49 +0100 + [ David Kalnischkies ] + * ftparchive/writer.cc: + - ensure that Date and Valid-Until time strings are not localised + + -- David Kalnischkies Tue, 22 Feb 2011 13:22:58 +0100 apt (0.8.11.5) unstable; urgency=low diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc index 9cdca8d3e..80ec61ab9 100644 --- a/ftparchive/writer.cc +++ b/ftparchive/writer.cc @@ -925,6 +925,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 +944,8 @@ ReleaseWriter::ReleaseWriter(string const &DB) validstr[0] = '\0'; } + setlocale(LC_TIME, ""); + map Fields; Fields["Origin"] = ""; Fields["Label"] = ""; -- cgit v1.2.3 From 3c54407f8783d5e27363eabf41dbc3d031526ffe Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 22 Feb 2011 14:49:16 +0100 Subject: add options to disable specific checksums for Indexes --- debian/changelog | 4 +- doc/apt-ftparchive.1.xml | 11 ++-- ftparchive/apt-ftparchive.cc | 2 + ftparchive/writer.cc | 143 ++++++++++++++++++++++++++----------------- ftparchive/writer.h | 6 +- 5 files changed, 101 insertions(+), 65 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4712e80c4..bbb973b8f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,3 @@ - apt (0.8.11.6) UNRELEASED; urgency=low [ Christian Perrier ] @@ -9,8 +8,9 @@ apt (0.8.11.6) UNRELEASED; urgency=low [ David Kalnischkies ] * ftparchive/writer.cc: - ensure that Date and Valid-Until time strings are not localised + - add options to disable specific checksums for Indexes - -- David Kalnischkies Tue, 22 Feb 2011 13:22:58 +0100 + -- David Kalnischkies Tue, 22 Feb 2011 14:48:21 +0100 apt (0.8.11.5) unstable; urgency=low diff --git a/doc/apt-ftparchive.1.xml b/doc/apt-ftparchive.1.xml index 0090d21d9..8e5df1f36 100644 --- a/doc/apt-ftparchive.1.xml +++ b/doc/apt-ftparchive.1.xml @@ -526,11 +526,14 @@ for i in Sections do &apt-cmdblurb; - + , , - Generate MD5 sums. This defaults to on, when turned off the generated - index files will not have MD5Sum fields where possible. - Configuration Item: APT::FTPArchive::MD5 + 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: APT::FTPArchive::Checksum and + APT::FTPArchive::Index::Checksum where + Index can be Packages, Sources or Release and + Checksum can be MD5, SHA1 or SHA256. diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc index 0c29002e6..0762a2b28 100644 --- a/ftparchive/apt-ftparchive.cc +++ b/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}, diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc index 80ec61ab9..d3a19ca28 100644 --- a/ftparchive/writer.cc +++ b/ftparchive/writer.cc @@ -59,6 +59,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 +312,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 +439,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 +566,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 +618,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 +722,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 +788,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()); @@ -969,6 +986,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 /*{{{*/ @@ -1001,19 +1022,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(); @@ -1025,37 +1053,40 @@ bool ReleaseWriter::DoPackage(string FileName) // --------------------------------------------------------------------- void ReleaseWriter::Finish() { - fprintf(Output, "MD5Sum:\n"); - for(map::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::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::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::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::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::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()); + } } } - diff --git a/ftparchive/writer.h b/ftparchive/writer.h index 3796f79f6..ce0eab7af 100644 --- a/ftparchive/writer.h +++ b/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; -- cgit v1.2.3 From cd5b597cc855a535b35e88324191931c54c6fba0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 22 Feb 2011 14:52:10 +0100 Subject: * ftparchive/writer.cc: - include xz-compressed Packages and Sources files in Release file --- debian/changelog | 4 +++- ftparchive/writer.cc | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index bf72e350d..ebea1dac8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,8 +16,10 @@ apt (0.8.10.3+squeeze1) UNRELEASED; urgency=low * 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 + * ftparchive/writer.cc: + - include xz-compressed Packages and Sources files in Release file - -- David Kalnischkies Tue, 22 Feb 2011 12:47:31 +0100 + -- David Kalnischkies Tue, 22 Feb 2011 14:51:32 +0100 apt (0.8.10.3) unstable; urgency=low diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc index d7d699ddc..086c44390 100644 --- a/ftparchive/writer.cc +++ b/ftparchive/writer.cc @@ -911,10 +911,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("md5sum.txt"); -- cgit v1.2.3 From b2430e6d1713e26d461f08873ac872918eb28283 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 22 Feb 2011 18:11:10 +0100 Subject: * apt-pkg/aptconfiguration.cc: - support download of xz-compressed indexes files --- apt-pkg/aptconfiguration.cc | 2 ++ debian/changelog | 4 +++- methods/makefile | 10 ++++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index 3cf4d2429..9ded431e8 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -38,11 +38,13 @@ 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::xz", "/usr/bin/xz"); _config->CndSet("Dir::Bin::bzip2", "/bin/bzip2"); // accept non-list order as override setting for config settings on commandline diff --git a/debian/changelog b/debian/changelog index 92ae058c5..f0f0d342a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,8 +13,10 @@ apt (0.8.11.6) UNRELEASED; urgency=low - 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 - -- David Kalnischkies Tue, 22 Feb 2011 14:59:51 +0100 + -- David Kalnischkies Tue, 22 Feb 2011 18:10:30 +0100 apt (0.8.11.5) unstable; urgency=low diff --git a/methods/makefile b/methods/makefile index 4ee356cec..6ba51058e 100644 --- a/methods/makefile +++ b/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 -- cgit v1.2.3 From 255bfa26bb3f4ffcf372e4b2b9c95113083c7cd6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 22 Feb 2011 18:13:20 +0100 Subject: * apt-pkg/deb/debsrcrecords.cc: - support xz-compressed source v3 debian.tar files --- apt-pkg/deb/debsrcrecords.cc | 3 ++- debian/changelog | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc index 21336e1af..3809ee74f 100644 --- a/apt-pkg/deb/debsrcrecords.cc +++ b/apt-pkg/deb/debsrcrecords.cc @@ -144,7 +144,8 @@ bool debSrcRecordParser::Files(vector &List) } F.Type = string(F.Path,Tmp+1,Pos-Tmp); - if (F.Type == "gz" || F.Type == "bz2" || F.Type == "lzma" || F.Type == "tar") + if (F.Type == "gz" || F.Type == "bz2" || F.Type == "lzma" || + F.Type == "xz" || F.Type == "tar") { Pos = Tmp-1; continue; diff --git a/debian/changelog b/debian/changelog index ebea1dac8..d42246f7b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,8 +18,10 @@ apt (0.8.10.3+squeeze1) UNRELEASED; urgency=low to open data.tar.xz files * ftparchive/writer.cc: - include xz-compressed Packages and Sources files in Release file + * apt-pkg/deb/debsrcrecords.cc: + - support xz-compressed source v3 debian.tar files - -- David Kalnischkies Tue, 22 Feb 2011 14:51:32 +0100 + -- David Kalnischkies Tue, 22 Feb 2011 18:12:21 +0100 apt (0.8.10.3) unstable; urgency=low -- cgit v1.2.3 From 79d5bab6801dd2efd2758da800d20a0758b45aae Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 22 Feb 2011 18:31:59 +0100 Subject: test the xz compressor, too --- test/integration/test-bug-595691-empty-and-broken-archive-files | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/integration/test-bug-595691-empty-and-broken-archive-files b/test/integration/test-bug-595691-empty-and-broken-archive-files index 2179ba03b..11dee0628 100755 --- a/test/integration/test-bug-595691-empty-and-broken-archive-files +++ b/test/integration/test-bug-595691-empty-and-broken-archive-files @@ -54,12 +54,14 @@ setupcompressor() { gzip) COMPRESS="gz";; bzip2) COMPRESS="bz2";; lzma) COMPRESS="lzma";; + xz) COMPRESS="xz";; esac echo "Acquire::CompressionTypes::Order { \"${COMPRESS}\"; }; Dir::Bin::uncompressed \"/does/not/exist\"; Dir::Bin::gzip \"/does/not/exist\"; Dir::Bin::bzip2 \"/does/not/exist\"; -Dir::Bin::lzma \"/does/not/exist\";" > rootdir/etc/apt/apt.conf.d/00compressor +Dir::Bin::lzma \"/does/not/exist\"; +Dir::Bin::xz \"/does/not/exist\";" > rootdir/etc/apt/apt.conf.d/00compressor if [ -e "/bin/${COMPRESSOR}" ]; then echo "Dir::Bin::${COMPRESSOR} \"/bin/${COMPRESSOR}\";" >> rootdir/etc/apt/apt.conf.d/00compressor elif [ -e "/usr/bin/${COMPRESSOR}" ]; then @@ -134,9 +136,9 @@ W: Failed to fetch ${COMPRESSOR}:$(readlink -f rootdir/var/lib/apt/lists/partial E: Some index files failed to download. They have been ignored, or old ones used instead." "empty file Packages.$COMPRESS over http" } -for COMPRESSOR in 'gzip' 'bzip2' 'lzma'; do testoverfile $COMPRESSOR; done +for COMPRESSOR in 'gzip' 'bzip2' 'lzma' 'xz'; do testoverfile $COMPRESSOR; done # do the same again with http instead of file changetowebserver -for COMPRESSOR in 'gzip' 'bzip2' 'lzma'; do testoverhttp $COMPRESSOR; done +for COMPRESSOR in 'gzip' 'bzip2' 'lzma' 'xz'; do testoverhttp $COMPRESSOR; done -- cgit v1.2.3 From dc7eb288ff95230f9a0f81c6b3485b6b06802480 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 24 Feb 2011 12:24:51 +0100 Subject: * ftparchive/contents.cc: - remove ExtractArchive codecopy from apt-inst/deb/debfile.cc --- apt-inst/deb/debfile.cc | 2 +- debian/changelog | 4 +++- ftparchive/contents.cc | 31 +++---------------------------- 3 files changed, 7 insertions(+), 30 deletions(-) diff --git a/apt-inst/deb/debfile.cc b/apt-inst/deb/debfile.cc index edd78adbb..2b1fdedc8 100644 --- a/apt-inst/deb/debfile.cc +++ b/apt-inst/deb/debfile.cc @@ -143,7 +143,7 @@ bool debDebFile::ExtractArchive(pkgDirStream &Stream) Compressor = "xz"; } if (Member == 0) - return _error->Error(_("Internal error, could not locate member")); + return _error->Error(_("Internal error, could not locate member %s"), "data.tar.{gz,bz2,lzma,xz}"); if (File.Seek(Member->Start) == false) return false; diff --git a/debian/changelog b/debian/changelog index 64da21779..6b2c35baf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,8 +17,10 @@ apt (0.8.11.6) UNRELEASED; urgency=low - support download of xz-compressed indexes files * apt-pkg/deb/debsrcrecords.cc: - support xz-compressed source v3 debian.tar files + * ftparchive/contents.cc: + - remove ExtractArchive codecopy from apt-inst/deb/debfile.cc - -- David Kalnischkies Tue, 22 Feb 2011 18:14:17 +0100 + -- David Kalnischkies Wed, 23 Feb 2011 09:00:51 +0100 apt (0.8.11.5) unstable; urgency=low diff --git a/ftparchive/contents.cc b/ftparchive/contents.cc index 9e283cf33..eadced626 100644 --- a/ftparchive/contents.cc +++ b/ftparchive/contents.cc @@ -36,12 +36,13 @@ #include "contents.h" #include +#include #include #include #include #include #include -#include +#include /*}}}*/ // GenContents::~GenContents - Free allocated memory /*{{{*/ @@ -305,33 +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) { - Member = Deb.GotoMember("data.tar.xz"); - Compressor = "xz"; - } - if (Member == 0) { - _error->Error(_("Internal error, could not locate member %s"), - "data.tar.{gz,bz2,lzma,xz}"); - 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 /*{{{*/ -- cgit v1.2.3 From 31273d9ff4fa1a6e073168e9cbaa91d1f53be853 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 27 Feb 2011 14:30:50 +0100 Subject: d'uh! implement and not only declare the string wrapper for FindVector --- apt-pkg/contrib/configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apt-pkg/contrib/configuration.h b/apt-pkg/contrib/configuration.h index 175c1bef3..71e5a0e47 100644 --- a/apt-pkg/contrib/configuration.h +++ b/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 FindVector(string const &Name) const; std::vector FindVector(const char *Name) const; + std::vector 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; -- cgit v1.2.3 From 03bef78461c6f443187b60799402624326843396 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 27 Feb 2011 23:01:40 +0100 Subject: - load the supported compressors from configuration - support adding new compressors by configuration --- apt-pkg/aptconfiguration.cc | 74 ++++++++++++++++++++++++++++++++++++++++++--- apt-pkg/aptconfiguration.h | 26 ++++++++++++++++ debian/changelog | 4 ++- ftparchive/multicompress.cc | 59 +++++++++++++++++------------------- ftparchive/multicompress.h | 21 +++---------- ftparchive/writer.cc | 1 + 6 files changed, 133 insertions(+), 52 deletions(-) diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index 9ded431e8..2a441fce7 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -42,10 +42,7 @@ const Configuration::getCompressionTypes(bool const &Cached) { _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::xz", "/usr/bin/xz"); - _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",""); @@ -346,4 +343,73 @@ 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 +const Configuration::getCompressors(bool const Cached) { + static std::vector 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 const comp = _config->FindVector("APT::Compressor"); + for (std::vector::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; +} + /*}}}*/ +// 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); +} + /*}}}*/ } diff --git a/apt-pkg/aptconfiguration.h b/apt-pkg/aptconfiguration.h index dd339d841..e4bc5e683 100644 --- a/apt-pkg/aptconfiguration.h +++ b/apt-pkg/aptconfiguration.h @@ -82,6 +82,32 @@ 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 CompressArgs; + std::vector 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 static const getCompressors(bool const Cached = true); + /*}}}*/ + private: /*{{{*/ + void static setDefaultConfigurationForCompressors(); /*}}}*/ }; /*}}}*/ diff --git a/debian/changelog b/debian/changelog index 6b2c35baf..499150d52 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,18 +9,20 @@ apt (0.8.11.6) UNRELEASED; urgency=low * 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 * ftparchive/contents.cc: - remove ExtractArchive codecopy from apt-inst/deb/debfile.cc - -- David Kalnischkies Wed, 23 Feb 2011 09:00:51 +0100 + -- David Kalnischkies Sun, 27 Feb 2011 23:00:07 +0100 apt (0.8.11.5) unstable; urgency=low diff --git a/ftparchive/multicompress.cc b/ftparchive/multicompress.cc index c33414a11..f82879015 100644 --- a/ftparchive/multicompress.cc +++ b/ftparchive/multicompress.cc @@ -30,13 +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}, - {"xz",".xz","xz","-6","-d",5}, - {}}; // MultiCompress::MultiCompress - Constructor /*{{{*/ // --------------------------------------------------------------------- @@ -49,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(); @@ -62,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 Compressors = APT::Configuration::getCompressors(); + std::vector::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; @@ -78,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; @@ -142,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 Compressors = APT::Configuration::getCompressors(); + std::vector::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; @@ -269,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; @@ -310,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 Args; + Args.push_back(Prog.Binary.c_str()); + std::vector const * const addArgs = + (Comp == true) ? &(Prog.CompressArgs) : &(Prog.UncompressArgs); + for (std::vector::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); }; @@ -336,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 @@ -415,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) diff --git a/ftparchive/multicompress.h b/ftparchive/multicompress.h index 3ac3b8fb2..19dede174 100644 --- a/ftparchive/multicompress.h +++ b/ftparchive/multicompress.h @@ -20,28 +20,18 @@ #include #include +#include #include #include 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(); diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc index 9462ebe27..9f12cbf3d 100644 --- a/ftparchive/writer.cc +++ b/ftparchive/writer.cc @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3 From b0e1a43f95a3a6817dff6aed303a9823827ea0cf Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 27 Feb 2011 23:31:25 +0100 Subject: support every compression we have a compressor configured --- apt-pkg/aptconfiguration.cc | 13 +++++++++++++ apt-pkg/aptconfiguration.h | 3 +++ apt-pkg/deb/debsrcrecords.cc | 9 ++++++--- debian/changelog | 3 ++- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index 2a441fce7..b23e12acb 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -388,6 +388,19 @@ const Configuration::getCompressors(bool const Cached) { return compressors; } /*}}}*/ +// getCompressorExtensions - supported data.tar extensions /*{{{*/ +// --------------------------------------------------------------------- +/* */ +std::vector const Configuration::getCompressorExtensions() { + std::vector const compressors = getCompressors(); + std::vector ext; + for (std::vector::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 /*{{{*/ // --------------------------------------------------------------------- /* */ diff --git a/apt-pkg/aptconfiguration.h b/apt-pkg/aptconfiguration.h index e4bc5e683..815db6cae 100644 --- a/apt-pkg/aptconfiguration.h +++ b/apt-pkg/aptconfiguration.h @@ -105,6 +105,9 @@ public: /*{{{*/ * \return a vector of Compressors */ std::vector static const getCompressors(bool const Cached = true); + + /** \brief Return a vector of extensions supported for data.tar's */ + std::vector static const getCompressorExtensions(); /*}}}*/ private: /*{{{*/ void static setDefaultConfigurationForCompressors(); diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc index 3809ee74f..749305005 100644 --- a/apt-pkg/deb/debsrcrecords.cc +++ b/apt-pkg/deb/debsrcrecords.cc @@ -14,6 +14,7 @@ #include #include #include +#include using std::max; /*}}}*/ @@ -111,7 +112,9 @@ bool debSrcRecordParser::Files(vector &List) string Base = Sect.FindS("Directory"); if (Base.empty() == false && Base[Base.length()-1] != '/') Base += '/'; - + + std::vector const compExts = APT::Configuration::getCompressorExtensions(); + // Iterate over the entire list grabbing each triplet const char *C = Files.c_str(); while (*C != 0) @@ -144,8 +147,8 @@ bool debSrcRecordParser::Files(vector &List) } F.Type = string(F.Path,Tmp+1,Pos-Tmp); - if (F.Type == "gz" || F.Type == "bz2" || F.Type == "lzma" || - F.Type == "xz" || F.Type == "tar") + if (std::find(compExts.begin(), compExts.end(), std::string(".").append(F.Type)) != compExts.end() || + F.Type == "tar") { Pos = Tmp-1; continue; diff --git a/debian/changelog b/debian/changelog index 499150d52..58a1a365f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,10 +19,11 @@ apt (0.8.11.6) UNRELEASED; urgency=low - 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 - -- David Kalnischkies Sun, 27 Feb 2011 23:00:07 +0100 + -- David Kalnischkies Sun, 27 Feb 2011 23:30:36 +0100 apt (0.8.11.5) unstable; urgency=low -- cgit v1.2.3 From 7296f1e6e65ae1926e4bbee3acb52a285e376a3a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 28 Feb 2011 00:20:35 +0100 Subject: * apt-inst/deb/debfile.cc: - support data.tar's compressed with any configured compressor --- apt-inst/deb/debfile.cc | 42 ++++++++++++++++++++++++++---------------- debian/changelog | 4 +++- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/apt-inst/deb/debfile.cc b/apt-inst/deb/debfile.cc index 2b1fdedc8..a40cd1ae8 100644 --- a/apt-inst/deb/debfile.cc +++ b/apt-inst/deb/debfile.cc @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -127,26 +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"; - } - if (Member == 0) { - Member = AR.FindMember("data.tar.lzma"); - Compressor = "lzma"; + // Get the archive member + const ARArchive::Member *Member = NULL; + std::string Compressor; + + std::string const data = "data.tar"; + std::vector compressor = APT::Configuration::getCompressors(); + for (std::vector::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.xz"); - Compressor = "xz"; + + if (Member == NULL) + { + std::string ext = "data.tar.{"; + for (std::vector::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 %s"), "data.tar.{gz,bz2,lzma,xz}"); + if (File.Seek(Member->Start) == false) return false; - + // Prepare Tar ExtractTar Tar(File,Member->Size,Compressor); if (_error->PendingError() == true) diff --git a/debian/changelog b/debian/changelog index 58a1a365f..c012023ff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,8 +22,10 @@ apt (0.8.11.6) UNRELEASED; urgency=low - 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 - -- David Kalnischkies Sun, 27 Feb 2011 23:30:36 +0100 + -- David Kalnischkies Mon, 28 Feb 2011 00:19:55 +0100 apt (0.8.11.5) unstable; urgency=low -- cgit v1.2.3 From bd15e63f52786ed2332976f16d67de3ef59dfbed Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 7 Mar 2011 22:19:19 +0100 Subject: * cmdline/apt-get.cc: - reinstall dependencies of reinstalled "garbage" (Closes: #617257) --- cmdline/apt-get.cc | 2 +- debian/changelog | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index bc2f71c18..c0983b06d 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1718,7 +1718,7 @@ bool DoAutomaticRemove(CacheFile &Cache) R->Type != pkgCache::Dep::PreDepends) continue; pkgCache::PkgIterator N = R.ParentPkg(); - if (N.end() == true || N->CurrentVer == 0) + 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; diff --git a/debian/changelog b/debian/changelog index c012023ff..da4e04c4b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,8 +24,10 @@ apt (0.8.11.6) UNRELEASED; urgency=low - 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) - -- David Kalnischkies Mon, 28 Feb 2011 00:19:55 +0100 + -- David Kalnischkies Mon, 07 Mar 2011 22:16:54 +0100 apt (0.8.11.5) unstable; urgency=low -- cgit v1.2.3 From 8e11253db6070bede2ecba01dbd3fde6019c8260 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Mon, 7 Mar 2011 22:57:52 +0100 Subject: * 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) --- apt-pkg/deb/dpkgpm.cc | 21 +++++++++++++++++++-- debian/changelog | 7 ++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 7d0d34a46..84443447f 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -881,7 +881,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 @@ -989,13 +992,22 @@ 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 + { + string const PkgDesc = I->Pkg.Name() + string(":") + string(I->Pkg.Arch()); + Packages[pkgcount] = new char[PkgDesc.size()+1]; + strncpy(Packages[pkgcount++],PkgDesc.c_str(),PkgDesc.size()+1); + Args[n++] = Packages[pkgcount-1]; + } Size += strlen(Args[n-1]); } } @@ -1145,6 +1157,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++) + delete [] Packages[i]; + // the result of the waitpid call int res; int select_ret; diff --git a/debian/changelog b/debian/changelog index 971e967a4..bcafbd71b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -28,7 +28,12 @@ apt (0.8.11.6) UNRELEASED; urgency=low * cmdline/apt-get.cc: - reinstall dependencies of reinstalled "garbage" (Closes: #617257) - -- David Kalnischkies Mon, 07 Mar 2011 22:43:15 +0100 + [ 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) + + -- David Kalnischkies Mon, 07 Mar 2011 22:46:24 +0100 apt (0.8.11.5) unstable; urgency=low -- cgit v1.2.3 From 69f76a34330bfcbc746f1aa25509907490514a1d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 7 Mar 2011 23:06:36 +0100 Subject: use FullName and strdup instead of handmade and new[] --- apt-pkg/deb/dpkgpm.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 84443447f..7b0955b96 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1003,10 +1003,8 @@ bool pkgDPkgPM::Go(int OutStatusFd) Args[n++] = I->Pkg.Name(); else { - string const PkgDesc = I->Pkg.Name() + string(":") + string(I->Pkg.Arch()); - Packages[pkgcount] = new char[PkgDesc.size()+1]; - strncpy(Packages[pkgcount++],PkgDesc.c_str(),PkgDesc.size()+1); - Args[n++] = Packages[pkgcount-1]; + Packages[pkgcount] = strdup(I->Pkg.FullName(false).c_str()); + Args[n++] = Packages[pkgcount++]; } Size += strlen(Args[n-1]); } @@ -1160,7 +1158,7 @@ bool pkgDPkgPM::Go(int OutStatusFd) /* 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++) - delete [] Packages[i]; + free(Packages[i]); // the result of the waitpid call int res; -- cgit v1.2.3 From 28166356f30ad13729f7f952e6f1fc6131036591 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 8 Mar 2011 19:32:35 +0100 Subject: 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) This has the sideeffect that arch:all packages internally show up as coming from the native arch - so packages with the architecture "all" doesn't exist any longer in the pkgcache --- README.MultiArch | 56 +--- apt-pkg/algorithms.cc | 64 ----- apt-pkg/cacheiterators.h | 8 +- apt-pkg/cacheset.h | 4 +- apt-pkg/deb/deblistparser.cc | 84 ++---- apt-pkg/depcache.cc | 304 +-------------------- apt-pkg/depcache.h | 8 +- apt-pkg/orderlist.cc | 4 - apt-pkg/packagemanager.cc | 35 +-- apt-pkg/pkgcache.cc | 18 +- apt-pkg/pkgcache.h | 4 +- apt-pkg/pkgcachegen.cc | 49 +--- apt-pkg/policy.cc | 7 - cmdline/apt-cache.cc | 10 +- cmdline/apt-get.cc | 13 - debian/apt.symbols | 2 +- debian/changelog | 6 +- ...est-bug-549968-install-depends-of-not-installed | 4 +- ...g-590438-broken-provides-thanks-to-remove-order | 8 +- .../integration/test-bug-593360-modifiers-in-names | 16 +- .../test-bug-612099-multiarch-conflicts | 77 +++--- test/integration/test-release-candidate-switching | 30 +- 22 files changed, 141 insertions(+), 670 deletions(-) diff --git a/README.MultiArch b/README.MultiArch index b2964ac38..588419b8d 100644 --- a/README.MultiArch +++ b/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 diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 66c182b23..0b4366e5e 100644 --- a/apt-pkg/algorithms.cc +++ b/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,40 +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; - } - } - - if (Sim[Pkg].InstBroken() == true) - { - /* We don't call Configure for Pseudo packages and if the 'all' is already installed - the simulation will think the pseudo package is not installed, so if something is - broken we walk over the dependencies and search for not installed pseudo packages */ - for (pkgCache::DepIterator D = Sim[Pkg].InstVerIter(Sim).DependsList(); D.end() == false; D++) - { - if (Sim.IsImportantDep(D) == false || - (Sim[D] & pkgDepCache::DepInstall) != 0) - continue; - pkgCache::PkgIterator T = D.TargetPkg(); - if (T.end() == true || T->CurrentVer != 0 || Flags[T->ID] != 0) - continue; - pkgCache::PkgIterator A = T.Group().FindPkg("all"); - if (A.end() == true || A->VersionList == 0 || A->CurrentVer == 0 || - Cache.VS().CheckDep(A.CurVersion(), pkgCache::Dep::Equals, T.CandVersion()) == false) - continue; - Sim.MarkInstall(T, false); - Flags[T->ID] = 2; - } - } - if (Sim[Pkg].InstBroken() == true) { cout << "Conf " << Pkg.FullName(false) << " broken" << endl; @@ -235,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 diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index 449d4b441..31b3aced3 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -206,13 +206,9 @@ class pkgCache::VerIterator : public Iterator { 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 { string RelStr() const; bool Automatic() const; - bool Pseudo() const; + __deprecated bool Pseudo() const; VerFileIterator NewestFile() const; inline VerIterator(pkgCache &Owner,Version *Trg = 0) : Iterator(Owner, Trg) { diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index 3f4f0066b..e690d660c 100644 --- a/apt-pkg/cacheset.h +++ b/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(); }; }; /*}}}*/ diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 9201e6a54..edc001abb 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/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; } diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index ddbd37699..fba6ad054 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -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 &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 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::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::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 &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::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 &recheck) -{ - std::vector static const Archs = APT::Configuration::getArchitectures(); - pkgCache::GrpIterator Grp(*Cache, Cache->GrpP + G); - if (unlikely(Grp.end() == true)) - return false; - for (std::vector::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 /*{{{*/ @@ -1276,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; @@ -1499,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); @@ -1510,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]; @@ -1531,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 /*{{{*/ @@ -1967,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 || diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index dba3e22dc..b95681118 100644 --- a/apt-pkg/depcache.h +++ b/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 &recheck); - bool ReInstallPseudoForGroup(unsigned long const &Grp, std::set &recheck); - bool ReInstallPseudoForGroup(pkgCache::PkgIterator const &P, std::set &recheck); + // FIXME: they are private so shouldn't affect abi, but just in case… + __deprecated bool RemovePseudoInstalledPkg(PkgIterator &Pkg, std::set &recheck) { return true; }; + __deprecated bool ReInstallPseudoForGroup(unsigned long const &Grp, std::set &recheck) { return true; }; + __deprecated bool ReInstallPseudoForGroup(pkgCache::PkgIterator const &P, std::set &recheck) { return true; }; }; #endif diff --git a/apt-pkg/orderlist.cc b/apt-pkg/orderlist.cc index a53854a26..d5bd19581 100644 --- a/apt-pkg/orderlist.cc +++ b/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; } /*}}}*/ diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index cff34058c..4c655cb7b 100644 --- a/apt-pkg/packagemanager.cc +++ b/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. diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 616d400a2..7014aee22 100644 --- a/apt-pkg/pkgcache.cc +++ b/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 /*{{{*/ // --------------------------------------------------------------------- diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index 82a69b2ca..89a296ce9 100644 --- a/apt-pkg/pkgcache.h +++ b/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 diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 5b943cca1..d44dbf3a9 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/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 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::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 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(); @@ -650,10 +643,7 @@ bool pkgCacheGenerator::FinishCache(OpProgress *Progress) - 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 && strcmp(Arch, "all") != 0) || - 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::const_iterator A = archs.begin(); A != archs.end(); ++A) { if (*A == Arch) @@ -675,24 +665,11 @@ 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 - if (strcmp(Arch, "all") == 0) { - NewDepends(D, V, V.VerStr(), - pkgCache::Dep::NotEquals, pkgCache::Dep::Conflicts, - OldDepLast); - } else { - NewDepends(D, V, "", - pkgCache::Dep::NoOp, pkgCache::Dep::Conflicts, - OldDepLast); - } + NewDepends(D, V, "", + pkgCache::Dep::NoOp, pkgCache::Dep::Conflicts, + OldDepLast); } } } @@ -810,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 diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 5427271b6..94c7fd4af 100644 --- a/apt-pkg/policy.cc +++ b/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++) { diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 34070ba9b..01e0d22e0 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1519,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 = @@ -1532,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 @@ -1588,7 +1581,6 @@ bool Policy(CommandLine &CmdL) Indx->Describe(true).c_str()); } } - } } return true; diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index c0983b06d..6a30c5a50 100644 --- a/cmdline/apt-get.cc +++ b/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 @@ -1916,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; diff --git a/debian/apt.symbols b/debian/apt.symbols index 27925ee0c..1c108fb69 100644 --- a/debian/apt.symbols +++ b/debian/apt.symbols @@ -277,7 +277,7 @@ libapt-pkg.so.4.10 libapt-pkg4.10 (c++)"pkgDepCache::DefaultRootSetFunc::InRootSet(pkgCache::PkgIterator const&)@Base" 0.8.0 (c++)"pkgDepCache::DefaultRootSetFunc::~DefaultRootSetFunc()@Base" 0.8.0 (c++)"pkgDepCache::MarkFollowsSuggests()@Base" 0.8.0 - (c++)"pkgDepCache::SetCandidateVersion(pkgCache::VerIterator, bool const&)@Base" 0.8.0 + (c++)"pkgDepCache::SetCandidateVersion(pkgCache::VerIterator)@Base" 0.8.0 (c++)"pkgDepCache::MarkFollowsRecommends()@Base" 0.8.0 (c++)"pkgDepCache::ReInstallPseudoForGroup(pkgCache::PkgIterator const&, std::set, std::allocator >&)@Base" 0.8.0 (c++)"pkgDepCache::ReInstallPseudoForGroup(unsigned long const&, std::set, std::allocator >&)@Base" 0.8.0 diff --git a/debian/changelog b/debian/changelog index bcafbd71b..238d9d63e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -32,8 +32,12 @@ apt (0.8.11.6) UNRELEASED; urgency=low * 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) - -- David Kalnischkies Mon, 07 Mar 2011 22:46:24 +0100 + -- David Kalnischkies Tue, 08 Mar 2011 19:20:56 +0100 apt (0.8.11.5) unstable; urgency=low diff --git a/test/integration/test-bug-549968-install-depends-of-not-installed b/test/integration/test-bug-549968-install-depends-of-not-installed index 864dd340a..871d236b9 100755 --- a/test/integration/test-bug-549968-install-depends-of-not-installed +++ b/test/integration/test-bug-549968-install-depends-of-not-installed @@ -22,5 +22,5 @@ Package extracoolstuff is not installed, so not removed The following NEW packages will be installed: coolstuff 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. -Inst coolstuff (1.0 unstable [all]) -Conf coolstuff (1.0 unstable [all])' aptget install coolstuff extracoolstuff- -o Debug::pkgDepCache::Marker=1 -s +Inst coolstuff (1.0 unstable [i386]) +Conf coolstuff (1.0 unstable [i386])' aptget install coolstuff extracoolstuff- -o Debug::pkgDepCache::Marker=1 -s diff --git a/test/integration/test-bug-590438-broken-provides-thanks-to-remove-order b/test/integration/test-bug-590438-broken-provides-thanks-to-remove-order index 0f6493948..72de6eacb 100755 --- a/test/integration/test-bug-590438-broken-provides-thanks-to-remove-order +++ b/test/integration/test-bug-590438-broken-provides-thanks-to-remove-order @@ -62,13 +62,13 @@ predependsgawk2() { echo "$pkgbasefile Pre-Depends: $1 " >> rootdir/var/lib/dpkg/status - testequalor2 "Inst coolstuff (1-1 localhost [all]) -Conf coolstuff (1-1 localhost [all]) + testequalor2 "Inst coolstuff (1-1 localhost [i386]) +Conf coolstuff (1-1 localhost [i386]) Inst gawk2 (1:3.1.7.dfsg-5 localhost [i386]) Conf gawk2 (1:3.1.7.dfsg-5 localhost [i386]) -Remv mawk [1.3.3-15]" "Inst coolstuff (1-1 localhost [all]) +Remv mawk [1.3.3-15]" "Inst coolstuff (1-1 localhost [i386]) Inst gawk2 (1:3.1.7.dfsg-5 localhost [i386]) -Conf coolstuff (1-1 localhost [all]) +Conf coolstuff (1-1 localhost [i386]) Conf gawk2 (1:3.1.7.dfsg-5 localhost [i386]) Remv mawk [1.3.3-15]" aptget install gawk2 mawk- -sqq -o PreDepends=$(echo "$1" | sed 's/ //g') } diff --git a/test/integration/test-bug-593360-modifiers-in-names b/test/integration/test-bug-593360-modifiers-in-names index 83a3cfabf..c34b499b0 100755 --- a/test/integration/test-bug-593360-modifiers-in-names +++ b/test/integration/test-bug-593360-modifiers-in-names @@ -36,29 +36,29 @@ Building dependency tree... The following NEW packages will be installed: apt 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. -Inst apt (0.8.8 localhost [all]) -Conf apt (0.8.8 localhost [all])' aptget install apt -s +Inst apt (0.8.8 localhost [i386]) +Conf apt (0.8.8 localhost [i386])' aptget install apt -s testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: apt+ 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. -Inst apt+ (0.8.8 localhost [all]) -Conf apt+ (0.8.8 localhost [all])' aptget install apt+ -s +Inst apt+ (0.8.8 localhost [i386]) +Conf apt+ (0.8.8 localhost [i386])' aptget install apt+ -s testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: apt+ 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. -Inst apt+ (0.8.8 localhost [all]) -Conf apt+ (0.8.8 localhost [all])' aptget install apt++ -s +Inst apt+ (0.8.8 localhost [i386]) +Conf apt+ (0.8.8 localhost [i386])' aptget install apt++ -s testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: apt+ 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. -Inst apt+ (0.8.8 localhost [all]) -Conf apt+ (0.8.8 localhost [all])' aptget purge apt++ -s +Inst apt+ (0.8.8 localhost [i386]) +Conf apt+ (0.8.8 localhost [i386])' aptget purge apt++ -s diff --git a/test/integration/test-bug-612099-multiarch-conflicts b/test/integration/test-bug-612099-multiarch-conflicts index caac75db4..6d09a4fa1 100755 --- a/test/integration/test-bug-612099-multiarch-conflicts +++ b/test/integration/test-bug-612099-multiarch-conflicts @@ -59,29 +59,27 @@ Inst foobar:amd64 (1.0 stable [amd64]) Conf libc6:amd64 (1.0 stable [amd64]) Conf foobar:amd64 (1.0 stable [amd64])' aptget install foobar:amd64 -st stable -# FIXME: libc6:i386 is installed, we are switching to libc6:all testequal 'Reading package lists... Building dependency tree... Reading state information... -The following extra packages will be installed: - libc6 The following NEW packages will be installed: - foobar libc6 -0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. -Inst libc6 (2.0 testing, testing [all]) + foobar +The following packages will be upgraded: + libc6 +1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst libc6 [1.0] (2.0 testing [i386]) Inst foobar (1.0 stable [i386]) -Conf libc6 (2.0 testing, testing [all]) +Conf libc6 (2.0 testing [i386]) Conf foobar (1.0 stable [i386])' aptget install foobar/stable libc6 -st testing -# FIXME: libc6:i386 is installed, we are switching to libc6:all testequal 'Reading package lists... Building dependency tree... Reading state information... -The following NEW packages will be installed: +The following packages will be upgraded: libc6 -0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. -Inst libc6 (2.0 testing, testing [all]) -Conf libc6 (2.0 testing, testing [all])' aptget upgrade -t testing -s +1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +Inst libc6 [1.0] (2.0 testing [i386]) +Conf libc6 (2.0 testing [i386])' aptget upgrade -t testing -s aptget upgrade -y -qq 2>&1 > /dev/null testdpkginstalled libc6 @@ -91,31 +89,34 @@ Reading state information... The following NEW packages will be installed: foobar 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. -Inst foobar (1.0 stable [i386]) [] +Inst foobar (1.0 stable [i386]) Conf foobar (1.0 stable [i386])' aptget install foobar/stable -st testing testequal 'Reading package lists... Building dependency tree... Reading state information... +The following extra packages will be installed: + libc6:amd64 +The following packages will be REMOVED: + libc6 The following NEW packages will be installed: - foobar:amd64 -0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. + foobar:amd64 libc6:amd64 +0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded. +Remv libc6 [2.0] +Inst libc6:amd64 (1.0 stable [amd64]) Inst foobar:amd64 (1.0 stable [amd64]) +Conf libc6:amd64 (1.0 stable [amd64]) Conf foobar:amd64 (1.0 stable [amd64])' aptget install foobar:amd64/stable -st testing -# FIXME: the display is a strange (its a downgrade), but the handling itself correct testequal "Reading package lists... Building dependency tree... Reading state information... Selected version '1.0' (stable [i386]) for 'libc6' -The following packages will be REMOVED: +The following packages will be DOWNGRADED: libc6 -The following NEW packages will be installed: - libc6 -0 upgraded, 1 newly installed, 2 to remove and 0 not upgraded. -Remv libc6 [2.0] -Inst libc6 (1.0 stable [i386]) +0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded. +Inst libc6 [2.0] (1.0 stable [i386]) Conf libc6 (1.0 stable [i386])" aptget install libc6/stable -s -q=0 @@ -164,30 +165,25 @@ Conf libc6-same:amd64 (1.0 stable [amd64])' aptget install libc6-same:amd64 -s - # FIXME: We should test installing libc6-same:amd64 here, but dpkg doesn't allow it currently -# FIXME: upgrade any to all as above testequal 'Reading package lists... Building dependency tree... Reading state information... -The following NEW packages will be installed: +The following packages will be upgraded: libc6-same -0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. -Inst libc6-same (2.0 testing, testing [all]) -Conf libc6-same (2.0 testing, testing [all])' aptget upgrade -t testing -s +1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +Inst libc6-same [1.0] (2.0 testing [i386]) +Conf libc6-same (2.0 testing [i386])' aptget upgrade -t testing -s aptget upgrade -y -qq 2>&1 > /dev/null testdpkginstalled libc6-same -# FIXME: the display is a strange (its a downgrade), but the handling itself correct testequal "Reading package lists... Building dependency tree... Reading state information... Selected version '1.0' (stable [i386]) for 'libc6-same' -The following packages will be REMOVED: +The following packages will be DOWNGRADED: libc6-same -The following NEW packages will be installed: - libc6-same -0 upgraded, 1 newly installed, 2 to remove and 0 not upgraded. -Remv libc6-same [2.0] -Inst libc6-same (1.0 stable [i386]) +0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded. +Inst libc6-same [2.0] (1.0 stable [i386]) Conf libc6-same (1.0 stable [i386])" aptget install libc6-same/stable -s -q=0 testequal 'Reading package lists... @@ -196,14 +192,21 @@ Reading state information... The following NEW packages will be installed: foobar-same 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. -Inst foobar-same (1.0 stable [i386]) [] +Inst foobar-same (1.0 stable [i386]) Conf foobar-same (1.0 stable [i386])' aptget install foobar-same/stable -st testing testequal 'Reading package lists... Building dependency tree... Reading state information... +The following extra packages will be installed: + libc6-same:amd64 +The following packages will be REMOVED: + libc6-same The following NEW packages will be installed: - foobar-same:amd64 -0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. + foobar-same:amd64 libc6-same:amd64 +0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded. +Remv libc6-same [2.0] +Inst libc6-same:amd64 (1.0 stable [amd64]) Inst foobar-same:amd64 (1.0 stable [amd64]) +Conf libc6-same:amd64 (1.0 stable [amd64]) Conf foobar-same:amd64 (1.0 stable [amd64])' aptget install foobar-same:amd64/stable -st testing diff --git a/test/integration/test-release-candidate-switching b/test/integration/test-release-candidate-switching index b6dbe99db..b79828a9e 100755 --- a/test/integration/test-release-candidate-switching +++ b/test/integration/test-release-candidate-switching @@ -95,7 +95,7 @@ E: Trivial Only specified but this is not a trivial operation." aptget install a testequal "Reading package lists... Building dependency tree... Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok' -Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-common' because of 'amarok' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok' The following extra packages will be installed: amarok-common (2.3.2-2+exp) @@ -117,7 +117,7 @@ E: Trivial Only specified but this is not a trivial operation." aptget install a testequal "Reading package lists... Building dependency tree... Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-null' -Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-null' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-common' because of 'amarok-null' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-null' The following extra packages will be installed: amarok-common (2.3.2-2+exp) @@ -140,7 +140,7 @@ E: Trivial Only specified but this is not a trivial operation." aptget install a testequal "Reading package lists... Building dependency tree... Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok' -Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-common' because of 'amarok' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-null' The following extra packages will be installed: @@ -170,7 +170,7 @@ Building dependency tree... Selected version '2.3.2-2+exp' (experimental2 [i386]) for 'amarok-less' Selected version '5:4.6.0+exp' (experimental [i386]) for 'phonon-backend-xine' because of 'amarok-less' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-higher' -Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-higher' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-common' because of 'amarok-higher' Selected version '5:4.6.0+exp' (experimental [i386]) for 'phonon-backend-xine' because of 'amarok-higher' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-higher' The following extra packages will be installed: @@ -195,7 +195,7 @@ E: Trivial Only specified but this is not a trivial operation." aptget install a testequal "Reading package lists... Building dependency tree... Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-null2' -Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-null2' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-common' because of 'amarok-null2' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-null2' The following extra packages will be installed: amarok-common (2.3.2-2+exp) @@ -218,7 +218,7 @@ E: Trivial Only specified but this is not a trivial operation." aptget install a testequal "Reading package lists... Building dependency tree... Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-xine' -Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-xine' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-common' because of 'amarok-xine' Selected version '5:4.6.0+exp' (experimental [i386]) for 'phonon-backend-xine' because of 'amarok-xine' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-xine' The following extra packages will be installed: @@ -242,7 +242,7 @@ E: Trivial Only specified but this is not a trivial operation." aptget install a testequal "Reading package lists... Building dependency tree... Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-xine2' -Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-xine2' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-common' because of 'amarok-xine2' Selected version '5:4.20.0+exp' (experimental [i386]) for 'phonon-backend-null' because of 'amarok-xine2' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-xine2' The following extra packages will be installed: @@ -266,9 +266,9 @@ E: Trivial Only specified but this is not a trivial operation." aptget install a testequal "Reading package lists... Building dependency tree... Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-xine3' -Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-xine3' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-common' because of 'amarok-xine3' Selected version '5:4.6.0+exp' (experimental [i386]) for 'phonon-backend-xine3' because of 'amarok-xine3' -Selected version '2.0' (experimental [all]) for 'intermediatepkg' because of 'phonon-backend-xine3' +Selected version '2.0' (experimental [i386]) for 'intermediatepkg' because of 'phonon-backend-xine3' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-xine3' The following extra packages will be installed: amarok-common (2.3.2-2+exp) @@ -293,7 +293,7 @@ E: Trivial Only specified but this is not a trivial operation." aptget install a testequal "Reading package lists... Building dependency tree... Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-xine4' -Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-xine4' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-common' because of 'amarok-xine4' Selected version '5:4.20.0+exp' (experimental [i386]) for 'phonon-backend-null' because of 'amarok-xine4' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-xine4' The following extra packages will be installed: @@ -317,7 +317,7 @@ E: Trivial Only specified but this is not a trivial operation." aptget install a testequal "Reading package lists... Building dependency tree... Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-broken' -Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-broken' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-common' because of 'amarok-broken' Selected version '5:4.20.0+exp' (experimental [i386]) for 'phonon-backend-null' because of 'amarok-broken' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-broken' The following extra packages will be installed: @@ -341,7 +341,7 @@ E: Trivial Only specified but this is not a trivial operation." aptget install a testequal "Reading package lists... Building dependency tree... Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-recommends' -Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-recommends' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-common' because of 'amarok-recommends' Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-utils' because of 'amarok-recommends' The following extra packages will be installed: amarok-common (2.3.2-2+exp) @@ -364,7 +364,7 @@ E: Trivial Only specified but this is not a trivial operation." aptget install a testequal "Reading package lists... Building dependency tree... Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-recommends' -Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-recommends' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-common' because of 'amarok-recommends' The following extra packages will be installed: amarok-common (2.3.2-2+exp) Recommended packages: @@ -385,7 +385,7 @@ E: Trivial Only specified but this is not a trivial operation." aptget install a testequal "Reading package lists... Building dependency tree... Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-recommends2' -Selected version '2.3.2-2+exp' (experimental [all]) for 'amarok-common' because of 'amarok-recommends2' +Selected version '2.3.2-2+exp' (experimental [i386]) for 'amarok-common' because of 'amarok-recommends2' The following extra packages will be installed: amarok-common (2.3.2-2+exp) libc6 (2.11.2-7+sid) @@ -406,7 +406,7 @@ E: Trivial Only specified but this is not a trivial operation." aptget install a # if one depends doesn't work, we don't need to look deeper… testequal "Reading package lists... Building dependency tree... -Selected version '1.0' (experimental [all]) for 'uninstallablepkg' +Selected version '1.0' (experimental [i386]) for 'uninstallablepkg' Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created -- cgit v1.2.3