From: David Kalnischkies Date: Wed, 15 Jul 2009 14:45:49 +0000 (+0200) Subject: merge with lp:~mvo/apt/debian-sid X-Git-Tag: 0.7.22~13^2~3 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/ef1dff93202fa61e0b8cda761906bbca31e217bc?ds=inline merge with lp:~mvo/apt/debian-sid --- ef1dff93202fa61e0b8cda761906bbca31e217bc diff --cc apt-pkg/policy.cc index e33d563a1,b9a951990..26d1c17bd --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@@ -261,7 -256,52 +264,53 @@@ class PreferenceSection : public pkgTag Stop = (const char*) memchr(Stop,'\n',End-Stop); } }; - - + /*}}}*/ ++// ReadPinDir - Load the pin files from this dir into a Policy /*{{{*/ ++// --------------------------------------------------------------------- ++/* */ + bool ReadPinDir(pkgPolicy &Plcy,string Dir) + { + if (Dir.empty() == true) + Dir = _config->FindDir("Dir::Etc::PreferencesParts"); + + DIR *D = opendir(Dir.c_str()); + if (D == 0) + return _error->Errno("opendir",_("Unable to read %s"),Dir.c_str()); + + vector List; - ++ + for (struct dirent *Ent = readdir(D); Ent != 0; Ent = readdir(D)) + { + if (Ent->d_name[0] == '.') + continue; - ++ + // Skip bad file names ala run-parts + const char *C = Ent->d_name; + for (; *C != 0; C++) + if (isalpha(*C) == 0 && isdigit(*C) == 0 && *C != '_' && *C != '-') + break; + if (*C != 0) + continue; - ++ + // Make sure it is a file and not something else + string File = flCombine(Dir,Ent->d_name); + struct stat St; + if (stat(File.c_str(),&St) != 0 || S_ISREG(St.st_mode) == 0) + continue; - - List.push_back(File); - } ++ ++ List.push_back(File); ++ } + closedir(D); - ++ + sort(List.begin(),List.end()); + + // Read the files + for (vector::const_iterator I = List.begin(); I != List.end(); I++) + if (ReadPinFile(Plcy, *I) == false) + return false; + return true; + } - + /*}}}*/ // ReadPinFile - Load the pin file into a Policy /*{{{*/ // --------------------------------------------------------------------- /* I'd like to see the preferences file store more than just pin information diff --cc debian/changelog index aba5e4cf4,7f14502e7..786b8a86f --- a/debian/changelog +++ b/debian/changelog @@@ -29,19 -30,16 +30,21 @@@ apt (0.7.22) UNRELEASED; urgency=lo * add Debug::pkgProblemResolver::ShowScores and make the scores adjustable * do not write state file in simulate mode (closes: #433007) - * add hook for auto-install (closes: #470035) - * support IsAutoInstallOk in the resolver too + * add hook for MarkInstall and MarkDelete (closes: #470035) * fix typo in apt-pkg/acquire.cc which prevents Dl-Limit to work correctly when downloading from multiple sites (Closes: #534752) + * add the various foldmarkers in apt-pkg & cmdline (no code change) + * versions with a pin of -1 shouldn't be a candidate (Closes: #355237) + * prefer mmap as memory allocator in MMap instead of a static char + array which can (at least in theory) grow dynamic + * add a segfault handler to MMap to show the Cache-Limit message, which + can be deactivated with MMap::SegfaultHandler=false (Closes: 535218) [ Michael Vogt ] - * honor the dpkg hold state in AutoInstOk (closes: #64141) + * honor the dpkg hold state in new Marker hooks (closes: #64141) - + * debian/apt.cron.daily: + - if the timestamp is too far in the future, delete it - ++ [ Julian Andres Klode ] * apt-pkg/contrib/configuration.cc: Fix a small memory leak in ReadConfigFile.