#include <apti18n.h>
/*}}}*/
-
// CacheFile::CacheFile - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
Policy = new pkgPolicy(Cache);
if (_error->PendingError() == true)
return false;
- if (ReadPinFile(*Policy) == false)
+ if (ReadPinFile(*Policy) == false || ReadPinDir(*Policy) == false)
return false;
// Create the dependency cache
return true;
}
/*}}}*/
-
-
// CacheFile::Close - close the cache files /*{{{*/
// ---------------------------------------------------------------------
/* */
#include <apti18n.h>
+ #include <dirent.h>
+ #include <sys/stat.h>
+ #include <algorithm>
#include <iostream>
#include <sstream>
/*}}}*/
signed Max = GetPriority(Pkg);
pkgCache::VerIterator Pref = GetMatch(Pkg);
+ // no package = no candidate version
+ if (Pkg.end() == true)
+ return Pref;
+
+ // packages with a pin lower than 0 have no newer candidate than the current version
+ if (Max < 0)
+ return Pkg.CurrentVer();
+
/* Falling through to the default version.. Setting Max to zero
effectively excludes everything <= 0 which are the non-automatic
priorities.. The status file is given a prio of 100 which will exclude
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<string> 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<string>::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
{
string Name = Tags.FindS("Package");
if (Name.empty() == true)
- return _error->Error(_("Invalid record in the preferences file, no Package header"));
+ return _error->Error(_("Invalid record in the preferences file %s, no Package header"), File.c_str());
if (Name == "*")
Name = string();
pkgCache &Cache = *GCache;
pkgPolicy Plcy(&Cache);
- if (ReadPinFile(Plcy) == false)
+ if (ReadPinFile(Plcy) == false || ReadPinDir(Plcy) == false)
return false;
unsigned long Count = Cache.HeaderP->PackageCount+1;
return true;
}
-
+ /*}}}*/
// RDepends - Print out a reverse dependency tree - mbc /*{{{*/
// ---------------------------------------------------------------------
/* */
return true;
}
-
/*}}}*/
-
-
// xvcg - Generate a graph for xvcg /*{{{*/
// ---------------------------------------------------------------------
// Code contributed from Junichi Uekawa <dancer@debian.org> on 20 June 2002.
return true;
}
/*}}}*/
-
-
// Dotty - Generate a graph for Dotty /*{{{*/
// ---------------------------------------------------------------------
/* Dotty is the graphvis program for generating graphs. It is a fairly
return true;
}
/*}}}*/
-// Search - Perform a search /*{{{*/
-// ---------------------------------------------------------------------
-/* This searches the package names and package descriptions for a pattern */
+
struct ExDescFile
{
pkgCache::DescFile *Df;
bool NameMatch;
};
+// Search - Perform a search /*{{{*/
+// ---------------------------------------------------------------------
+/* This searches the package names and package descriptions for a pattern */
bool Search(CommandLine &CmdL)
{
pkgCache &Cache = *GCache;
pkgCache &Cache = *GCache;
pkgPolicy Plcy(&Cache);
- if (ReadPinFile(Plcy) == false)
+ if (ReadPinFile(Plcy) == false || ReadPinDir(Plcy) == false)
return false;
// Print out all of the package files
return true;
}
-
/*}}}*/
// GenCaches - Call the main cache generator /*{{{*/
// ---------------------------------------------------------------------
_config->Set("help",false);
}
/*}}}*/
-
-int main(int argc,const char *argv[])
+int main(int argc,const char *argv[]) /*{{{*/
{
CommandLine::Args Args[] = {
{'h',"help","help",0},
return 0;
}
+ /*}}}*/
- fr.po
- it.po. Closes: #531758
- ca.po. Closes: #531921
+ - de.po. Closes: #536430
* Added translations
- ast.po (Asturian by Marcos Alvareez Costales).
- Closes: #529007, #529730
+ Closes: #529007, #529730, #535328
[ David Kalnischkies ]
* [ABI break] support '#' in apt.conf and /etc/apt/preferences
* 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.
* Introduce support for the Enhances field. (Closes: #137583)
+ * Support /etc/apt/preferences.d, by adding ReadPinDir() (Closes: #535512)
+ * configure-index: document Dir::Etc::SourceParts and some other options
+ (Closes: #459605)
+ * Remove Eugene V. Lyubimkin from uploaders as requested.
- -- Christian Perrier <bubulle@debian.org> Wed, 22 Apr 2009 10:13:54 +0200
+ -- Julian Andres Klode <jak@debian.org> Fri, 03 Jul 2009 08:27:35 +0200
apt (0.7.21) unstable; urgency=low
Diff-Only "false";
Tar-Only "false";
Build-Dep-Automatic "true";
+ Show-User-Simulation-Note "true";
};
Cache
// Config files
Etc "etc/apt/" {
- SourceList "sources.list";
Main "apt.conf";
- Preferences "preferences";
Parts "apt.conf.d/";
+ Preferences "preferences";
+ PreferencesParts "preferences.d";
+ SourceList "sources.list";
+ SourceParts "sources.list.d";
+ VendorList "vendors.list";
+ VendorParts "vendors.list.d";
};
// Locations of binaries