X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/dc738e7ae6a9c14992279dc2c52f71b14ced53aa..fca67219cce0a38176bdd882ab9b69017942cbf2:/ftparchive/override.cc diff --git a/ftparchive/override.cc b/ftparchive/override.cc index 669ce25bf..6f40bc865 100644 --- a/ftparchive/override.cc +++ b/ftparchive/override.cc @@ -10,10 +10,6 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#ifdef __GNUG__ -#pragma implementation "override.h" -#endif - #include "override.h" #include @@ -207,6 +203,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::iterator I = Mapping.find(Package); + map::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::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