Explorar el Código

* apt-pkg/acquire-item.cc:
- Added fallback to uncompressed 'Packages' if neither 'bz2' nor 'gz'
available. (Closes: #409284)
* apt-pkg/algorithm.cc:
- Strip username and password from source URL in error message.
(Closes: #425150)

Michael Vogt hace 17 años
padre
commit
70b3d26355
Se han modificado 4 ficheros con 101 adiciones y 73 borrados
  1. 21 8
      apt-pkg/acquire-item.cc
  2. 5 1
      apt-pkg/algorithms.cc
  3. 12 0
      debian/changelog
  4. 63 64
      po/apt-all.pot

+ 21 - 8
apt-pkg/acquire-item.cc

@@ -568,9 +568,9 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner,
       else 
       else 
 	 CompressionExtension = ".gz";
 	 CompressionExtension = ".gz";
    } else {
    } else {
-      CompressionExtension = comprExt;
+      CompressionExtension = (comprExt == "plain" ? "" : comprExt);
    }
    }
-   Desc.URI = URI + CompressionExtension; 
+   Desc.URI = URI + CompressionExtension;
 
 
    Desc.Description = URIDesc;
    Desc.Description = URIDesc;
    Desc.Owner = this;
    Desc.Owner = this;
@@ -597,19 +597,30 @@ string pkgAcqIndex::Custom600Headers()
 
 
 void pkgAcqIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
 void pkgAcqIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
 {
 {
+   bool descChanged = false;
    // no .bz2 found, retry with .gz
    // no .bz2 found, retry with .gz
    if(Desc.URI.substr(Desc.URI.size()-3) == "bz2") {
    if(Desc.URI.substr(Desc.URI.size()-3) == "bz2") {
-      Desc.URI = Desc.URI.substr(0,Desc.URI.size()-3) + "gz"; 
+      Desc.URI = Desc.URI.substr(0,Desc.URI.size()-3) + "gz";
 
 
-      // retry with a gzip one 
-      new pkgAcqIndex(Owner, RealURI, Desc.Description,Desc.ShortDesc, 
+      new pkgAcqIndex(Owner, RealURI, Desc.Description,Desc.ShortDesc,
 		      ExpectedHash, string(".gz"));
 		      ExpectedHash, string(".gz"));
+	  descChanged = true;
+   }
+   // no .gz found, retry with uncompressed
+   else if(Desc.URI.substr(Desc.URI.size()-2) == "gz") {
+      Desc.URI = Desc.URI.substr(0,Desc.URI.size()-2);
+
+      new pkgAcqIndex(Owner, RealURI, Desc.Description,Desc.ShortDesc,
+		      ExpectedHash, string("plain"));
+	  descChanged = true;
+   }
+   if (descChanged) {
       Status = StatDone;
       Status = StatDone;
       Complete = false;
       Complete = false;
       Dequeue();
       Dequeue();
       return;
       return;
-   } 
-   
+   }
+
    // on decompression failure, remove bad versions in partial/
    // on decompression failure, remove bad versions in partial/
    if(Decompression && Erase) {
    if(Decompression && Erase) {
       string s = _config->FindDir("Dir::State::lists") + "partial/";
       string s = _config->FindDir("Dir::State::lists") + "partial/";
@@ -700,12 +711,14 @@ void pkgAcqIndex::Done(string Message,unsigned long Size,string Hash,
    else
    else
       Local = true;
       Local = true;
    
    
-   string compExt = Desc.URI.substr(Desc.URI.size()-3);
+   string compExt = flExtension(URI(Desc.URI).Path);
    const char *decompProg;
    const char *decompProg;
    if(compExt == "bz2") 
    if(compExt == "bz2") 
       decompProg = "bzip2";
       decompProg = "bzip2";
    else if(compExt == ".gz") 
    else if(compExt == ".gz") 
       decompProg = "gzip";
       decompProg = "gzip";
+   else if(compExt == "")
+      decompProg = "copy";
    else {
    else {
       _error->Error("Unsupported extension: %s", compExt.c_str());
       _error->Error("Unsupported extension: %s", compExt.c_str());
       return;
       return;

+ 5 - 1
apt-pkg/algorithms.cc

@@ -1342,7 +1342,11 @@ bool ListUpdate(pkgAcquireStatus &Stat,
 
 
       (*I)->Finished();
       (*I)->Finished();
 
 
-      _error->Warning(_("Failed to fetch %s  %s\n"),(*I)->DescURI().c_str(),
+      ::URI uri((*I)->DescURI());
+      uri.User.clear();
+      uri.Password.clear();
+      string descUri = string(uri);
+      _error->Warning(_("Failed to fetch %s  %s\n"), descUri.c_str(),
 	      (*I)->ErrorText.c_str());
 	      (*I)->ErrorText.c_str());
 
 
       if ((*I)->Status == pkgAcquire::Item::StatTransientNetworkError) 
       if ((*I)->Status == pkgAcquire::Item::StatTransientNetworkError) 

+ 12 - 0
debian/changelog

@@ -1,3 +1,15 @@
+apt (0.7.17) unstable; urgency=low
+
+  [ Eugene V. Lyubimkin ]
+  * apt-pkg/acquire-item.cc:
+    - Added fallback to uncompressed 'Packages' if neither 'bz2' nor 'gz'
+      available. (Closes: #409284)
+  * apt-pkg/algorithm.cc:
+    - Strip username and password from source URL in error message.
+      (Closes: #425150)
+
+ -- Eugene V. Lyubimkin <jackyf.devel@gmail.com>  Fri, 24 Oct 2008 23:45:17 +0300
+
 apt (0.7.16) unstable; urgency=low
 apt (0.7.16) unstable; urgency=low
 
 
   [ Luca Bruno ]
   [ Luca Bruno ]

+ 63 - 64
po/apt-all.pot

@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-05-28 14:25+0200\n"
+"POT-Creation-Date: 2008-10-28 16:44+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -251,7 +251,7 @@ msgid ""
 "  -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp\n"
 "  -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp\n"
 msgstr ""
 msgstr ""
 
 
-#: cmdline/apt-extracttemplates.cc:267 apt-pkg/pkgcachegen.cc:815
+#: cmdline/apt-extracttemplates.cc:267 apt-pkg/pkgcachegen.cc:827
 #, c-format
 #, c-format
 msgid "Unable to write to %s"
 msgid "Unable to write to %s"
 msgstr ""
 msgstr ""
@@ -780,7 +780,7 @@ msgstr ""
 msgid "Do you want to continue [Y/n]? "
 msgid "Do you want to continue [Y/n]? "
 msgstr ""
 msgstr ""
 
 
-#: cmdline/apt-get.cc:984 cmdline/apt-get.cc:2214 apt-pkg/algorithms.cc:1344
+#: cmdline/apt-get.cc:984 cmdline/apt-get.cc:2214 apt-pkg/algorithms.cc:1349
 #, c-format
 #, c-format
 msgid "Failed to fetch %s  %s\n"
 msgid "Failed to fetch %s  %s\n"
 msgstr ""
 msgstr ""
@@ -1402,9 +1402,9 @@ msgid "The info and temp directories need to be on the same filesystem"
 msgstr ""
 msgstr ""
 
 
 #. Build the status cache
 #. Build the status cache
-#: apt-inst/deb/dpkgdb.cc:135 apt-pkg/pkgcachegen.cc:748
-#: apt-pkg/pkgcachegen.cc:817 apt-pkg/pkgcachegen.cc:822
-#: apt-pkg/pkgcachegen.cc:945
+#: apt-inst/deb/dpkgdb.cc:135 apt-pkg/pkgcachegen.cc:760
+#: apt-pkg/pkgcachegen.cc:829 apt-pkg/pkgcachegen.cc:834
+#: apt-pkg/pkgcachegen.cc:957
 msgid "Reading package lists"
 msgid "Reading package lists"
 msgstr ""
 msgstr ""
 
 
@@ -2240,23 +2240,23 @@ msgstr ""
 msgid "Index file type '%s' is not supported"
 msgid "Index file type '%s' is not supported"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/algorithms.cc:247
+#: apt-pkg/algorithms.cc:248
 #, c-format
 #, c-format
 msgid ""
 msgid ""
 "The package %s needs to be reinstalled, but I can't find an archive for it."
 "The package %s needs to be reinstalled, but I can't find an archive for it."
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/algorithms.cc:1106
+#: apt-pkg/algorithms.cc:1107
 msgid ""
 msgid ""
 "Error, pkgProblemResolver::Resolve generated breaks, this may be caused by "
 "Error, pkgProblemResolver::Resolve generated breaks, this may be caused by "
 "held packages."
 "held packages."
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/algorithms.cc:1108
+#: apt-pkg/algorithms.cc:1109
 msgid "Unable to correct problems, you have held broken packages."
 msgid "Unable to correct problems, you have held broken packages."
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/algorithms.cc:1370 apt-pkg/algorithms.cc:1372
+#: apt-pkg/algorithms.cc:1375 apt-pkg/algorithms.cc:1377
 msgid ""
 msgid ""
 "Some index files failed to download, they have been ignored, or old ones "
 "Some index files failed to download, they have been ignored, or old ones "
 "used instead."
 "used instead."
@@ -2352,82 +2352,82 @@ msgstr ""
 msgid "Error occurred while processing %s (UsePackage1)"
 msgid "Error occurred while processing %s (UsePackage1)"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/pkgcachegen.cc:153
+#: apt-pkg/pkgcachegen.cc:164
 #, c-format
 #, c-format
 msgid "Error occurred while processing %s (NewFileDesc1)"
 msgid "Error occurred while processing %s (NewFileDesc1)"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/pkgcachegen.cc:178
+#: apt-pkg/pkgcachegen.cc:189
 #, c-format
 #, c-format
 msgid "Error occurred while processing %s (UsePackage2)"
 msgid "Error occurred while processing %s (UsePackage2)"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/pkgcachegen.cc:182
+#: apt-pkg/pkgcachegen.cc:193
 #, c-format
 #, c-format
 msgid "Error occurred while processing %s (NewFileVer1)"
 msgid "Error occurred while processing %s (NewFileVer1)"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/pkgcachegen.cc:213
+#: apt-pkg/pkgcachegen.cc:224
 #, c-format
 #, c-format
 msgid "Error occurred while processing %s (NewVersion1)"
 msgid "Error occurred while processing %s (NewVersion1)"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/pkgcachegen.cc:217
+#: apt-pkg/pkgcachegen.cc:228
 #, c-format
 #, c-format
 msgid "Error occurred while processing %s (UsePackage3)"
 msgid "Error occurred while processing %s (UsePackage3)"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/pkgcachegen.cc:221
+#: apt-pkg/pkgcachegen.cc:232
 #, c-format
 #, c-format
 msgid "Error occurred while processing %s (NewVersion2)"
 msgid "Error occurred while processing %s (NewVersion2)"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/pkgcachegen.cc:245
+#: apt-pkg/pkgcachegen.cc:256
 #, c-format
 #, c-format
 msgid "Error occurred while processing %s (NewFileDesc2)"
 msgid "Error occurred while processing %s (NewFileDesc2)"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/pkgcachegen.cc:251
+#: apt-pkg/pkgcachegen.cc:262
 msgid "Wow, you exceeded the number of package names this APT is capable of."
 msgid "Wow, you exceeded the number of package names this APT is capable of."
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/pkgcachegen.cc:254
+#: apt-pkg/pkgcachegen.cc:265
 msgid "Wow, you exceeded the number of versions this APT is capable of."
 msgid "Wow, you exceeded the number of versions this APT is capable of."
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/pkgcachegen.cc:257
+#: apt-pkg/pkgcachegen.cc:268
 msgid "Wow, you exceeded the number of descriptions this APT is capable of."
 msgid "Wow, you exceeded the number of descriptions this APT is capable of."
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/pkgcachegen.cc:260
+#: apt-pkg/pkgcachegen.cc:271
 msgid "Wow, you exceeded the number of dependencies this APT is capable of."
 msgid "Wow, you exceeded the number of dependencies this APT is capable of."
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/pkgcachegen.cc:288
+#: apt-pkg/pkgcachegen.cc:299
 #, c-format
 #, c-format
 msgid "Error occurred while processing %s (FindPkg)"
 msgid "Error occurred while processing %s (FindPkg)"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/pkgcachegen.cc:301
+#: apt-pkg/pkgcachegen.cc:312
 #, c-format
 #, c-format
 msgid "Error occurred while processing %s (CollectFileProvides)"
 msgid "Error occurred while processing %s (CollectFileProvides)"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/pkgcachegen.cc:307
+#: apt-pkg/pkgcachegen.cc:318
 #, c-format
 #, c-format
 msgid "Package %s %s was not found while processing file dependencies"
 msgid "Package %s %s was not found while processing file dependencies"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/pkgcachegen.cc:678
+#: apt-pkg/pkgcachegen.cc:690
 #, c-format
 #, c-format
 msgid "Couldn't stat source package list %s"
 msgid "Couldn't stat source package list %s"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/pkgcachegen.cc:763
+#: apt-pkg/pkgcachegen.cc:775
 msgid "Collecting File Provides"
 msgid "Collecting File Provides"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/pkgcachegen.cc:890 apt-pkg/pkgcachegen.cc:897
+#: apt-pkg/pkgcachegen.cc:902 apt-pkg/pkgcachegen.cc:909
 msgid "IO Error saving source cache"
 msgid "IO Error saving source cache"
 msgstr ""
 msgstr ""
 
 
@@ -2440,35 +2440,35 @@ msgstr ""
 msgid "MD5Sum mismatch"
 msgid "MD5Sum mismatch"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/acquire-item.cc:647 apt-pkg/acquire-item.cc:1408
+#: apt-pkg/acquire-item.cc:658 apt-pkg/acquire-item.cc:1421
 msgid "Hash Sum mismatch"
 msgid "Hash Sum mismatch"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/acquire-item.cc:1100
+#: apt-pkg/acquire-item.cc:1113
 msgid "There is no public key available for the following key IDs:\n"
 msgid "There is no public key available for the following key IDs:\n"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/acquire-item.cc:1213
+#: apt-pkg/acquire-item.cc:1226
 #, c-format
 #, c-format
 msgid ""
 msgid ""
 "I wasn't able to locate a file for the %s package. This might mean you need "
 "I wasn't able to locate a file for the %s package. This might mean you need "
 "to manually fix this package. (due to missing arch)"
 "to manually fix this package. (due to missing arch)"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/acquire-item.cc:1272
+#: apt-pkg/acquire-item.cc:1285
 #, c-format
 #, c-format
 msgid ""
 msgid ""
 "I wasn't able to locate file for the %s package. This might mean you need to "
 "I wasn't able to locate file for the %s package. This might mean you need to "
 "manually fix this package."
 "manually fix this package."
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/acquire-item.cc:1313
+#: apt-pkg/acquire-item.cc:1326
 #, c-format
 #, c-format
 msgid ""
 msgid ""
 "The package index files are corrupted. No Filename: field for package %s."
 "The package index files are corrupted. No Filename: field for package %s."
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/acquire-item.cc:1400
+#: apt-pkg/acquire-item.cc:1413
 msgid "Size mismatch"
 msgid "Size mismatch"
 msgstr ""
 msgstr ""
 
 
@@ -2574,79 +2574,78 @@ msgstr ""
 msgid "Wrote %i records with %i missing files and %i mismatched files\n"
 msgid "Wrote %i records with %i missing files and %i mismatched files\n"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/deb/dpkgpm.cc:486
+#: apt-pkg/deb/dpkgpm.cc:49
 #, c-format
 #, c-format
-msgid "Directory '%s' missing"
+msgid "Installing %s"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/deb/dpkgpm.cc:569
+#: apt-pkg/deb/dpkgpm.cc:50 apt-pkg/deb/dpkgpm.cc:612
 #, c-format
 #, c-format
-msgid "Preparing %s"
+msgid "Configuring %s"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/deb/dpkgpm.cc:570
+#: apt-pkg/deb/dpkgpm.cc:51 apt-pkg/deb/dpkgpm.cc:627
 #, c-format
 #, c-format
-msgid "Unpacking %s"
+msgid "Removing %s"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/deb/dpkgpm.cc:575
+#: apt-pkg/deb/dpkgpm.cc:52
 #, c-format
 #, c-format
-msgid "Preparing to configure %s"
+msgid "Running post-installation trigger %s"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/deb/dpkgpm.cc:576 apt-pkg/deb/dpkgpm.cc:605
+#: apt-pkg/deb/dpkgpm.cc:521
 #, c-format
 #, c-format
-msgid "Configuring %s"
+msgid "Directory '%s' missing"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/deb/dpkgpm.cc:578 apt-pkg/deb/dpkgpm.cc:579
+#: apt-pkg/deb/dpkgpm.cc:605
 #, c-format
 #, c-format
-msgid "Processing triggers for %s"
+msgid "Preparing %s"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/deb/dpkgpm.cc:581
+#: apt-pkg/deb/dpkgpm.cc:606
 #, c-format
 #, c-format
-msgid "Installed %s"
+msgid "Unpacking %s"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/deb/dpkgpm.cc:586 apt-pkg/deb/dpkgpm.cc:588
-#: apt-pkg/deb/dpkgpm.cc:589
+#: apt-pkg/deb/dpkgpm.cc:611
 #, c-format
 #, c-format
-msgid "Preparing for removal of %s"
+msgid "Preparing to configure %s"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/deb/dpkgpm.cc:591 apt-pkg/deb/dpkgpm.cc:606
+#: apt-pkg/deb/dpkgpm.cc:614 apt-pkg/deb/dpkgpm.cc:615
 #, c-format
 #, c-format
-msgid "Removing %s"
+msgid "Processing triggers for %s"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/deb/dpkgpm.cc:592
+#: apt-pkg/deb/dpkgpm.cc:617
 #, c-format
 #, c-format
-msgid "Removed %s"
+msgid "Installed %s"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/deb/dpkgpm.cc:597
+#: apt-pkg/deb/dpkgpm.cc:622 apt-pkg/deb/dpkgpm.cc:624
+#: apt-pkg/deb/dpkgpm.cc:625
 #, c-format
 #, c-format
-msgid "Preparing to completely remove %s"
+msgid "Preparing for removal of %s"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/deb/dpkgpm.cc:598
+#: apt-pkg/deb/dpkgpm.cc:628
 #, c-format
 #, c-format
-msgid "Completely removed %s"
+msgid "Removed %s"
 msgstr ""
 msgstr ""
 
 
-#. populate the "processing" map
-#: apt-pkg/deb/dpkgpm.cc:604
+#: apt-pkg/deb/dpkgpm.cc:633
 #, c-format
 #, c-format
-msgid "Installing %s"
+msgid "Preparing to completely remove %s"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/deb/dpkgpm.cc:607
+#: apt-pkg/deb/dpkgpm.cc:634
 #, c-format
 #, c-format
-msgid "Running post-installation trigger %s"
+msgid "Completely removed %s"
 msgstr ""
 msgstr ""
 
 
-#: apt-pkg/deb/dpkgpm.cc:756
+#: apt-pkg/deb/dpkgpm.cc:788
 msgid "Can not write log, openpty() failed (/dev/pts not mounted?)\n"
 msgid "Can not write log, openpty() failed (/dev/pts not mounted?)\n"
 msgstr ""
 msgstr ""