summaryrefslogtreecommitdiff
path: root/ftparchive/override.cc
diff options
context:
space:
mode:
authorMatt Zimmerman <matt.zimmerman@canonical.com>2005-06-26 21:30:27 +0000
committerMatt Zimmerman <matt.zimmerman@canonical.com>2005-06-26 21:30:27 +0000
commit29ba053e05b1a496500036dbd667002d1b8b5ec2 (patch)
treef4d8ac6a4e0bd4daf8de19d1aea56c5e6ab0fc3e /ftparchive/override.cc
parent99f9dc4c97a7eef6b2819c933be0fc947f747912 (diff)
Merge with mvo
Patches applied: * michael.vogt@ubuntu.com--2005/apt--bts225947--0--base-0 tag of apt@packages.debian.org/apt--main--0--patch-79 * michael.vogt@ubuntu.com--2005/apt--bts225947--0--patch-1 * merged with mainline and apt--fixes--0 * michael.vogt@ubuntu.com--2005/apt--bts225947--0--patch-2 * patch from aj (slighly modified to use auto_ptr<>) applied * michael.vogt@ubuntu.com--2005/apt--bts225947--0--patch-3 * changelog updated * michael.vogt@ubuntu.com--2005/apt--bts225947--0--patch-4 * work for arch=all packages too now * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-5 * merged with apt--main--0 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-7 * fixed incorrect man-page example * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-8 * changelog udpate * michael.vogt@ubuntu.com--2005/apt--sane-handle-timeout--0--base-0 tag of apt@packages.debian.org/apt--main--0--patch-87 * michael.vogt@ubuntu.com--2005/apt--sane-handle-timeout--0--patch-1 * report timeouts (from Connect) and fail if they happen in pkgAcqMetaSig * michael.vogt@ubuntu.com--2005/apt--sane-handle-timeout--0--patch-2 * merged with the fixes branch to make it build again * michael.vogt@ubuntu.com--2005/apt--ubuntu--0--patch-1 tag of apt@packages.debian.org/apt--main--0--patch-88 * michael.vogt@ubuntu.com--2005/apt--ubuntu--0--patch-2 * merged apt--mvo (to make pining on components work again) * michael.vogt@ubuntu.com--2005/apt--ubuntu--0--patch-3 * merged with apt--fixes--0 (to make the building of the french manpages work and to fix a incorrect man-page example * michael.vogt@ubuntu.com--2005/apt--ubuntu--0--patch-4 * merged with the bts225947 code * michael.vogt@ubuntu.com--2005/apt--ubuntu--0--patch-5 * merged the imporoved timoeut handling patch * michael.vogt@ubuntu.com--2005/apt--ubuntu--0--patch-6 * merged with matt * michael.vogt@ubuntu.com--2005/apt--ubuntu--0--patch-7 * removed another conflict with apt--main
Diffstat (limited to 'ftparchive/override.cc')
-rw-r--r--ftparchive/override.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/ftparchive/override.cc b/ftparchive/override.cc
index 669ce25bf..b8b94843f 100644
--- a/ftparchive/override.cc
+++ b/ftparchive/override.cc
@@ -207,6 +207,44 @@ bool Override::ReadExtraOverride(string File,bool Source)
return true;
}
/*}}}*/
+
+// Override::GetItem - Get a architecture specific item /*{{{*/
+// ---------------------------------------------------------------------
+/* Returns a override item for the given package and the given architecture.
+ * Treats "all" special
+ */
+Override::Item* Override::GetItem(string Package, string Architecture)
+{
+ map<string,Item>::iterator I = Mapping.find(Package);
+ map<string,Item>::iterator J = Mapping.find(Package + "/" + Architecture);
+
+ if (I == Mapping.end() && J == Mapping.end())
+ {
+ return 0;
+ }
+
+ Item *result = new Item;
+ if (I == Mapping.end()) *result = J->second;
+ else
+ {
+ *result = I->second;
+ if (J != Mapping.end())
+ {
+ Item *R = &J->second;
+ if (R->Priority != "") result->Priority = R->Priority;
+ if (R->OldMaint != "") result->OldMaint = R->OldMaint;
+ if (R->NewMaint != "") result->NewMaint = R->NewMaint;
+ for (map<string,string>::iterator foI = R->FieldOverride.begin();
+ foI != R->FieldOverride.end(); foI++)
+ {
+ result->FieldOverride[foI->first] = foI->second;
+ }
+ }
+ }
+ return result;
+};
+
+
// Override::Item::SwapMaint - Swap the maintainer field if necessary /*{{{*/
// ---------------------------------------------------------------------
/* Returns the new maintainer string after evaluating the rewriting rule. If