summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/acquire-item.cc2
-rw-r--r--apt-pkg/algorithms.cc19
-rw-r--r--apt-pkg/contrib/progress.cc4
-rw-r--r--apt-pkg/deb/deblistparser.cc13
-rw-r--r--apt-pkg/depcache.cc31
-rw-r--r--apt-pkg/edsp.cc1
-rw-r--r--apt-pkg/indexrecords.cc5
7 files changed, 55 insertions, 20 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index a30e98858..a71886a87 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -1730,7 +1730,7 @@ bool pkgAcqArchive::QueueNext()
{
if(stringcasecmp(ForceHash, "sha512") == 0)
ExpectedHash = HashString("SHA512", Parse.SHA512Hash());
- if(stringcasecmp(ForceHash, "sha256") == 0)
+ else if(stringcasecmp(ForceHash, "sha256") == 0)
ExpectedHash = HashString("SHA256", Parse.SHA256Hash());
else if (stringcasecmp(ForceHash, "sha1") == 0)
ExpectedHash = HashString("SHA1", Parse.SHA1Hash());
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc
index 8cd9d4c6e..7fcd9f0db 100644
--- a/apt-pkg/algorithms.cc
+++ b/apt-pkg/algorithms.cc
@@ -550,11 +550,14 @@ void pkgProblemResolver::MakeScores()
unsigned long Size = Cache.Head().PackageCount;
memset(Scores,0,sizeof(*Scores)*Size);
- // Important Required Standard Optional Extra
+ // Maps to pkgCache::State::VerPriority
+ // which is "Important Required Standard Optional Extra"
+ // (yes, that is confusing, the order of pkgCache::State::VerPriority
+ // needs to be adjusted but that requires a ABI break)
int PrioMap[] = {
0,
- _config->FindI("pkgProblemResolver::Scores::Important",3),
- _config->FindI("pkgProblemResolver::Scores::Required",2),
+ _config->FindI("pkgProblemResolver::Scores::Important",2),
+ _config->FindI("pkgProblemResolver::Scores::Required",3),
_config->FindI("pkgProblemResolver::Scores::Standard",1),
_config->FindI("pkgProblemResolver::Scores::Optional",-1),
_config->FindI("pkgProblemResolver::Scores::Extra",-2)
@@ -568,11 +571,11 @@ void pkgProblemResolver::MakeScores()
if (_config->FindB("Debug::pkgProblemResolver::ShowScores",false) == true)
clog << "Settings used to calculate pkgProblemResolver::Scores::" << endl
- << " Important => " << PrioMap[1] << endl
- << " Required => " << PrioMap[2] << endl
- << " Standard => " << PrioMap[3] << endl
- << " Optional => " << PrioMap[4] << endl
- << " Extra => " << PrioMap[5] << endl
+ << " Required => " << PrioMap[pkgCache::State::Required] << endl
+ << " Important => " << PrioMap[pkgCache::State::Important] << endl
+ << " Standard => " << PrioMap[pkgCache::State::Standard] << endl
+ << " Optional => " << PrioMap[pkgCache::State::Optional] << endl
+ << " Extra => " << PrioMap[pkgCache::State::Extra] << endl
<< " Essentials => " << PrioEssentials << endl
<< " InstalledAndNotObsolete => " << PrioInstalledAndNotObsolete << endl
<< " Depends => " << PrioDepends << endl
diff --git a/apt-pkg/contrib/progress.cc b/apt-pkg/contrib/progress.cc
index 317048845..916e1d730 100644
--- a/apt-pkg/contrib/progress.cc
+++ b/apt-pkg/contrib/progress.cc
@@ -176,7 +176,7 @@ void OpTextProgress::Update()
if (OldOp.empty() == false)
cout << endl;
OldOp = "a";
- cout << Op << "..." << flush;
+ cout << Op << _("...") << flush;
}
return;
@@ -192,7 +192,7 @@ void OpTextProgress::Update()
}
// Print the spinner
- snprintf(S,sizeof(S),"\r%s... %u%%",Op.c_str(),(unsigned int)Percent);
+ snprintf(S,sizeof(S),_("%c%s... %u%%"),'\r',Op.c_str(),(unsigned int)Percent);
Write(S);
OldOp = Op;
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index b84bd6fdd..56d5297fc 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -28,12 +28,13 @@
using std::string;
-static debListParser::WordList PrioList[] = {{"important",pkgCache::State::Important},
- {"required",pkgCache::State::Required},
- {"standard",pkgCache::State::Standard},
- {"optional",pkgCache::State::Optional},
- {"extra",pkgCache::State::Extra},
- {}};
+static debListParser::WordList PrioList[] = {
+ {"required",pkgCache::State::Required},
+ {"important",pkgCache::State::Important},
+ {"standard",pkgCache::State::Standard},
+ {"optional",pkgCache::State::Optional},
+ {"extra",pkgCache::State::Extra},
+ {}};
// ListParser::debListParser - Constructor /*{{{*/
// ---------------------------------------------------------------------
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 2ec346f0b..a48cd8b0c 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -951,6 +951,37 @@ struct CompareProviders {
{
pkgCache::PkgIterator const A = AV.ParentPkg();
pkgCache::PkgIterator const B = BV.ParentPkg();
+ // Prefer MA:same packages if other architectures for it are installed
+ if ((AV->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same ||
+ (BV->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same)
+ {
+ bool instA = false;
+ if ((AV->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same)
+ {
+ pkgCache::GrpIterator Grp = A.Group();
+ for (pkgCache::PkgIterator P = Grp.PackageList(); P.end() == false; P = Grp.NextPkg(P))
+ if (P->CurrentVer != 0)
+ {
+ instA = true;
+ break;
+ }
+ }
+ bool instB = false;
+ if ((BV->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same)
+ {
+ pkgCache::GrpIterator Grp = B.Group();
+ for (pkgCache::PkgIterator P = Grp.PackageList(); P.end() == false; P = Grp.NextPkg(P))
+ {
+ if (P->CurrentVer != 0)
+ {
+ instB = true;
+ break;
+ }
+ }
+ }
+ if (instA != instB)
+ return instA == false;
+ }
// Prefer packages in the same group as the target; e.g. foo:i386, foo:amd64
if (A->Group != B->Group)
{
diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc
index 6ce9da784..e90598392 100644
--- a/apt-pkg/edsp.cc
+++ b/apt-pkg/edsp.cc
@@ -475,7 +475,6 @@ bool EDSP::WriteSolution(pkgDepCache &Cache, FILE* output)
fprintf(output, "Autoremove: %d\n", Pkg.CurrentVer()->ID);
if (Debug == true)
fprintf(output, "Package: %s\nVersion: %s\n", Pkg.FullName().c_str(), Pkg.CurrentVer().VerStr());
- fprintf(stderr, "Autoremove: %s\nVersion: %s\n", Pkg.FullName().c_str(), Pkg.CurrentVer().VerStr());
}
else
continue;
diff --git a/apt-pkg/indexrecords.cc b/apt-pkg/indexrecords.cc
index af2639beb..649b6059d 100644
--- a/apt-pkg/indexrecords.cc
+++ b/apt-pkg/indexrecords.cc
@@ -173,7 +173,7 @@ bool indexRecords::parseSumData(const char *&Start, const char *End, /*{{{*/
Hash = "";
Size = 0;
/* Skip over the first blank */
- while ((*Start == '\t' || *Start == ' ' || *Start == '\n')
+ while ((*Start == '\t' || *Start == ' ' || *Start == '\n' || *Start == '\r')
&& Start < End)
Start++;
if (Start >= End)
@@ -215,7 +215,8 @@ bool indexRecords::parseSumData(const char *&Start, const char *End, /*{{{*/
EntryEnd = Start;
/* Find the end of the third entry (the filename) */
- while ((*EntryEnd != '\t' && *EntryEnd != ' ' && *EntryEnd != '\n')
+ while ((*EntryEnd != '\t' && *EntryEnd != ' ' &&
+ *EntryEnd != '\n' && *EntryEnd != '\r')
&& EntryEnd < End)
EntryEnd++;