X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/b0f4b486e6850c5f98520ccf19da71d0ed748ae4..7e9b7ea8236a79580c4ca47712558096d66bad53:/apt-pkg/acquire-item.cc diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index da57f8d3b..0bcafdc5c 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -1147,7 +1147,9 @@ void pkgAcqIndex::Done(string Message,unsigned long long Size,string Hash, // The files timestamp matches, for non-local URLs reverify the local // file, for local file, uncompress again to ensure the hashsum is still // matching the Release file - if (!Local && StringToBool(LookupTag(Message,"IMS-Hit"),false) == true) + bool const IsCDROM = RealURI.substr(0,6) == "cdrom:"; + if ((Local == false || IsCDROM == true) && + StringToBool(LookupTag(Message,"IMS-Hit"),false) == true) { // set destfile to the final destfile if(_config->FindB("Acquire::GzipIndexes",false) == false) @@ -1156,7 +1158,10 @@ void pkgAcqIndex::Done(string Message,unsigned long long Size,string Hash, DestFile += URItoFileName(RealURI); } - ReverifyAfterIMS(FileName); + // do not reverify cdrom sources as apt-cdrom may rewrite the Packages + // file when its doing the indexcopy + if (IsCDROM == false) + ReverifyAfterIMS(FileName); return; } string decompProg; @@ -1189,8 +1194,18 @@ void pkgAcqIndex::Done(string Message,unsigned long long Size,string Hash, Desc.URI = decompProg + ":" + FileName; QueueURI(Desc); - // FIXME: this points to a c++ string that goes out of scope - Mode = decompProg.c_str(); + if (decompProg == "copy") + Mode = "copy"; + else if (decompProg == "xz") + Mode = "xz"; + else if (decompProg == "lzma") + Mode = "lzma"; + else if (decompProg == "bzip2") + Mode = "bzip2"; + else if (decompProg == "gzip") + Mode = "gzip"; + else + Mode = "decomp"; } /*}}}*/ // AcqIndexTrans::pkgAcqIndexTrans - Constructor /*{{{*/