summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/acquire-item.cc29
-rw-r--r--apt-pkg/algorithms.cc8
-rw-r--r--apt-pkg/contrib/cmndline.cc2
-rw-r--r--apt-pkg/contrib/cmndline.h2
-rw-r--r--apt-pkg/contrib/strutl.cc6
-rw-r--r--apt-pkg/orderlist.cc2
6 files changed, 33 insertions, 16 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 7cae6c8b7..679f9cee7 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -568,9 +568,9 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner,
else
CompressionExtension = ".gz";
} else {
- CompressionExtension = comprExt;
+ CompressionExtension = (comprExt == "plain" ? "" : comprExt);
}
- Desc.URI = URI + CompressionExtension;
+ Desc.URI = URI + CompressionExtension;
Desc.Description = URIDesc;
Desc.Owner = this;
@@ -597,19 +597,30 @@ string pkgAcqIndex::Custom600Headers()
void pkgAcqIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
{
+ bool descChanged = false;
// no .bz2 found, retry with .gz
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"));
+ 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;
Complete = false;
Dequeue();
return;
- }
-
+ }
+
// on decompression failure, remove bad versions in partial/
if(Decompression && Erase) {
string s = _config->FindDir("Dir::State::lists") + "partial/";
@@ -700,12 +711,14 @@ void pkgAcqIndex::Done(string Message,unsigned long Size,string Hash,
else
Local = true;
- string compExt = Desc.URI.substr(Desc.URI.size()-3);
+ string compExt = flExtension(URI(Desc.URI).Path);
const char *decompProg;
if(compExt == "bz2")
decompProg = "bzip2";
else if(compExt == ".gz")
decompProg = "gzip";
+ else if(compExt == "")
+ decompProg = "copy";
else {
_error->Error("Unsupported extension: %s", compExt.c_str());
return;
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc
index 59f994cd7..bd33d5ef1 100644
--- a/apt-pkg/algorithms.cc
+++ b/apt-pkg/algorithms.cc
@@ -497,7 +497,7 @@ void pkgProblemResolver::MakeScores()
signed short &Score = Scores[I->ID];
- /* This is arbitary, it should be high enough to elevate an
+ /* This is arbitrary, it should be high enough to elevate an
essantial package above most other packages but low enough
to allow an obsolete essential packages to be removed by
a conflicts on a powerfull normal package (ie libc6) */
@@ -1342,7 +1342,11 @@ bool ListUpdate(pkgAcquireStatus &Stat,
(*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());
if ((*I)->Status == pkgAcquire::Item::StatTransientNetworkError)
diff --git a/apt-pkg/contrib/cmndline.cc b/apt-pkg/contrib/cmndline.cc
index 54c91d67d..bfd53695e 100644
--- a/apt-pkg/contrib/cmndline.cc
+++ b/apt-pkg/contrib/cmndline.cc
@@ -189,7 +189,7 @@ bool CommandLine::HandleOpt(int &I,int argc,const char *argv[],
if ((A->Flags & ConfigFile) == ConfigFile)
return ReadConfigFile(*Conf,Argument);
- // Arbitary item specification
+ // Arbitrary item specification
if ((A->Flags & ArbItem) == ArbItem)
{
const char *J;
diff --git a/apt-pkg/contrib/cmndline.h b/apt-pkg/contrib/cmndline.h
index fad6d1da9..e28071e81 100644
--- a/apt-pkg/contrib/cmndline.h
+++ b/apt-pkg/contrib/cmndline.h
@@ -34,7 +34,7 @@
ConfigFile - Means this flag should be interprited as the name of
a config file to read in at this point in option processing.
Implies HasArg.
- ArbItem - Means the item is an arbitary configuration string of
+ ArbItem - Means the item is an arbitrary configuration string of
the form item=value, where item is passed directly
to the configuration class.
The default, if the flags are 0 is to use Boolean
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index eacc7077a..bd374fd1e 100644
--- a/apt-pkg/contrib/strutl.cc
+++ b/apt-pkg/contrib/strutl.cc
@@ -459,9 +459,9 @@ string Base64Encode(const string &S)
return Final;
}
/*}}}*/
-// stringcmp - Arbitary string compare /*{{{*/
+// stringcmp - Arbitrary string compare /*{{{*/
// ---------------------------------------------------------------------
-/* This safely compares two non-null terminated strings of arbitary
+/* This safely compares two non-null terminated strings of arbitrary
length */
int stringcmp(const char *A,const char *AEnd,const char *B,const char *BEnd)
{
@@ -517,7 +517,7 @@ int stringcmp(string::const_iterator A,string::const_iterator AEnd,
}
#endif
/*}}}*/
-// stringcasecmp - Arbitary case insensitive string compare /*{{{*/
+// stringcasecmp - Arbitrary case insensitive string compare /*{{{*/
// ---------------------------------------------------------------------
/* */
int stringcasecmp(const char *A,const char *AEnd,const char *B,const char *BEnd)
diff --git a/apt-pkg/orderlist.cc b/apt-pkg/orderlist.cc
index 616714e29..ca18f1d75 100644
--- a/apt-pkg/orderlist.cc
+++ b/apt-pkg/orderlist.cc
@@ -39,7 +39,7 @@
ordering.
Each of the features can be enabled in the sorting routine at an
- arbitary priority to give quite abit of control over the final unpacking
+ arbitrary priority to give quite abit of control over the final unpacking
order.
The rules listed above may never be violated and are called Critical.