From d731f9c574138a9cb31c586a8f1e7d7181a44456 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 8 Jan 2007 11:19:32 +0100 Subject: * apt-pkg/init.cc: - added Dir::State::Mirrors * doc/examples/configure-index: - added Acquire::mirror::RefreshInterval * methods/mirror.{cc,h}: - download the mirror file into Dir::State::Mirrors - added RefreshInterval option to not ask for the mirror file too often --- apt-pkg/init.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'apt-pkg/init.cc') diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index b47378d4a..fe085a75e 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -54,6 +54,7 @@ bool pkgInitConfig(Configuration &Cnf) Cnf.Set("Dir::State::lists","lists/"); Cnf.Set("Dir::State::cdroms","cdroms.list"); + Cnf.Set("Dir::State::mirrors","mirrors/"); // Cache Cnf.Set("Dir::Cache","var/cache/apt/"); -- cgit v1.2.3-70-g09d2 From 90ff41f8a6fdd304ac645f8279464462ca36fccd Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 13 Mar 2007 14:04:55 +0100 Subject: * apt-pkg/indexfile.cc: - fix problem overwriting APT::Acquire::Translation * doc/examples/configure-index: - document APT::Acquire::Translation --- apt-pkg/indexfile.cc | 4 ++-- apt-pkg/init.cc | 3 --- debian/changelog | 4 ++++ doc/examples/configure-index | 3 +++ po/apt-all.pot | 4 ++-- 5 files changed, 11 insertions(+), 7 deletions(-) (limited to 'apt-pkg/init.cc') diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc index bb2210bf6..fad38772b 100644 --- a/apt-pkg/indexfile.cc +++ b/apt-pkg/indexfile.cc @@ -75,7 +75,7 @@ string pkgIndexFile::SourceInfo(pkgSrcRecords::Parser const &Record, /* */ bool pkgIndexFile::TranslationsAvailable() { - const string Translation = _config->Find("APT::Acquire::Translation"); + const string Translation = _config->Find("APT::Acquire::Translation", "environment"); if (Translation.compare("none") != 0) return CheckLanguageCode(LanguageCode().c_str()); @@ -107,7 +107,7 @@ bool pkgIndexFile::CheckLanguageCode(const char *Lang) /* return the language code */ string pkgIndexFile::LanguageCode() { - const string Translation = _config->Find("APT::Acquire::Translation"); + const string Translation = _config->Find("APT::Acquire::Translation", "environment"); if (Translation.compare("environment") == 0) { diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index 0be0aee98..f58855792 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -106,9 +106,6 @@ bool pkgInitConfig(Configuration &Cnf) } #endif - // Translation - Cnf.Set("APT::Acquire::Translation", "environment"); - return true; } /*}}}*/ diff --git a/debian/changelog b/debian/changelog index cbcee2919..aa6a01692 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,10 @@ apt (0.6.46.4ubuntu9) feisty; urgency=low - fix version output in autoremove list (LP#68941) * apt-pkg/packagemanager.cc: - do not spin 100% cpu in FixMissing() (LP#84476) + * apt-pkg/indexfile.cc: + - fix problem overwriting APT::Acquire::Translation + * doc/examples/configure-index: + - document APT::Acquire::Translation -- diff --git a/doc/examples/configure-index b/doc/examples/configure-index index 4262b479f..e5d1f2ab3 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -191,6 +191,9 @@ Acquire // mirror failure reporting url ReportFailures "http://example.com/mirror-failure"; }; + + // translations can be set here to "none", "environment" or "$locale" + Translation "none"; }; // Directory layout diff --git a/po/apt-all.pot b/po/apt-all.pot index 794b346c0..82dfae548 100644 --- a/po/apt-all.pot +++ b/po/apt-all.pot @@ -2294,12 +2294,12 @@ msgstr "" msgid "Please insert the disc labeled: '%s' in the drive '%s' and press enter." msgstr "" -#: apt-pkg/init.cc:126 +#: apt-pkg/init.cc:123 #, c-format msgid "Packaging system '%s' is not supported" msgstr "" -#: apt-pkg/init.cc:142 +#: apt-pkg/init.cc:139 msgid "Unable to determine a suitable packaging system type" msgstr "" -- cgit v1.2.3-70-g09d2 From f58bf3a523236613245736b36ba5eee0fdf2a592 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 7 Dec 2007 22:46:14 +0100 Subject: do not enable install-recommends just yet --- apt-pkg/init.cc | 2 +- configure.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg/init.cc') diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index c0384cd45..dc6b7e976 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -35,7 +35,7 @@ bool pkgInitConfig(Configuration &Cnf) // General APT things Cnf.Set("APT::Architecture", COMMON_ARCH); Cnf.Set("APT::Build-Essential::", "build-essential"); - Cnf.Set("APT::Install-Recommends", true); + Cnf.Set("APT::Install-Recommends", false); Cnf.Set("APT::Install-Suggests", false); Cnf.Set("Dir","/"); diff --git a/configure.in b/configure.in index 52e85fc5b..a2b554a0c 100644 --- a/configure.in +++ b/configure.in @@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib) AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in) dnl -- SET THIS TO THE RELEASE VERSION -- -AC_DEFINE_UNQUOTED(VERSION,"0.7.9ubuntu1~ppa1") +AC_DEFINE_UNQUOTED(VERSION,"0.7.9ubuntu1") PACKAGE="apt" AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE") AC_SUBST(PACKAGE) -- cgit v1.2.3-70-g09d2 From 448eaf8b5999b6866237a069d678337b647968c4 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 6 May 2010 11:55:54 +0200 Subject: convert FileExists to DirectoryExists to check if the path is really a directory (and to have a better method name in the error message if not) --- apt-pkg/init.cc | 4 ++-- apt-pkg/policy.cc | 4 ++-- apt-pkg/sourcelist.cc | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'apt-pkg/init.cc') diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index 6310aff11..60281deb3 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -94,10 +94,10 @@ bool pkgInitConfig(Configuration &Cnf) // Read the configuration parts dir string Parts = Cnf.FindDir("Dir::Etc::parts"); - if (FileExists(Parts) == true) + if (DirectoryExists(Parts) == true) Res &= ReadConfigDir(Cnf,Parts); else - _error->WarningE("FileExists",_("Unable to read %s"),Parts.c_str()); + _error->WarningE("DirectoryExists",_("Unable to read %s"),Parts.c_str()); // Read the main config file string FName = Cnf.FindFile("Dir::Etc::main"); diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index 479cf3935..922efb0dd 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -291,9 +291,9 @@ bool ReadPinDir(pkgPolicy &Plcy,string Dir) if (Dir.empty() == true) Dir = _config->FindDir("Dir::Etc::PreferencesParts"); - if (FileExists(Dir) == false) + if (DirectoryExists(Dir) == false) { - _error->WarningE("FileExists",_("Unable to read %s"),Dir.c_str()); + _error->WarningE("DirectoryExists",_("Unable to read %s"),Dir.c_str()); return true; } diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index e13472fa6..c3ec9865a 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -199,15 +199,15 @@ bool pkgSourceList::ReadMainList() if (FileExists(Main) == true) Res &= ReadAppend(Main); - else if (FileExists(Parts) == false) + else if (DirectoryExists(Parts) == false) // Only warn if there are no sources.list.d. - _error->WarningE("FileExists",_("Unable to read %s"),Main.c_str()); + _error->WarningE("DirectoryExists", _("Unable to read %s"), Parts.c_str()); - if (FileExists(Parts) == true) + if (DirectoryExists(Parts) == true) Res &= ReadSourceDir(Parts); else if (FileExists(Main) == false) // Only warn if there is no sources.list file. - _error->WarningE("FileExists",_("Unable to read %s"),Parts.c_str()); + _error->WarningE("FileExists", _("Unable to read %s"), Main.c_str()); return Res; } -- cgit v1.2.3-70-g09d2 From 1408e219e76e577fb84ef1c48e58337b6569feec Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 26 Jun 2010 18:40:15 +0200 Subject: * apt-pkg/contrib/fileutl.cc: - show notice about ignored file instead of being always silent - add a Dir::Ignore-Files-Silently list option to control the notice * --- apt-pkg/contrib/fileutl.cc | 4 ++++ apt-pkg/init.cc | 5 +++++ debian/changelog | 6 +++++- doc/apt.conf.5.xml | 9 +++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) (limited to 'apt-pkg/init.cc') diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 16f7ce929..e95ddf562 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -281,6 +281,7 @@ std::vector GetListOfFilesInDir(string const &Dir, std::vector c } std::vector List; + Configuration::MatchAgainstConfig SilentIgnore("Dir::Ignore-Files-Silently"); DIR *D = opendir(Dir.c_str()); if (D == 0) { @@ -306,6 +307,7 @@ std::vector GetListOfFilesInDir(string const &Dir, std::vector c { if (Debug == true) std::clog << "Bad file: " << Ent->d_name << " → no extension" << std::endl; + _error->Notice("Ignoring file '%s' in directory '%s' as it has no filename extension", Ent->d_name, Dir.c_str()); continue; } } @@ -313,6 +315,8 @@ std::vector GetListOfFilesInDir(string const &Dir, std::vector c { if (Debug == true) std::clog << "Bad file: " << Ent->d_name << " → bad extension »" << flExtension(Ent->d_name) << "«" << std::endl; + if (SilentIgnore.Match(Ent->d_name) == false) + _error->Notice("Ignoring file '%s' in directory '%s' as it has an invalid filename extension", Ent->d_name, Dir.c_str()); continue; } } diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index 21472eb3b..7a332c86e 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -78,6 +78,11 @@ bool pkgInitConfig(Configuration &Cnf) Cnf.Set("Dir::Log::Terminal","term.log"); Cnf.Set("Dir::Log::History","history.log"); + Cnf.Set("Dir::Ignore-Files-Silently::", "~$"); + Cnf.Set("Dir::Ignore-Files-Silently::", "\\.disabled$"); + Cnf.Set("Dir::Ignore-Files-Silently::", "\\.bak$"); + Cnf.Set("Dir::Ignore-Files-Silently::", "\\.dpkg-[a-z]+$"); + // Translation Cnf.Set("APT::Acquire::Translation", "environment"); diff --git a/debian/changelog b/debian/changelog index 4500614a0..722e7ffc4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,8 +25,12 @@ apt (0.7.26~exp8) UNRELEASED; urgency=low - show a deprecation notice for APT::Acquire::Translation * apt-pkg/contrib/configuration.{cc,h}: - add a wrapper to match strings against configurable regex patterns + * apt-pkg/contrib/fileutl.cc: + - show notice about ignored file instead of being always silent + - add a Dir::Ignore-Files-Silently list option to control the notice + * - -- David Kalnischkies Sat, 26 Jun 2010 13:28:48 +0200 + -- David Kalnischkies Sat, 26 Jun 2010 18:40:01 +0200 apt (0.7.26~exp7) experimental; urgency=low diff --git a/doc/apt.conf.5.xml b/doc/apt.conf.5.xml index 0cf4bb663..39e2c8e6b 100644 --- a/doc/apt.conf.5.xml +++ b/doc/apt.conf.5.xml @@ -507,6 +507,15 @@ DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt";}; will be looked up in /tmp/staging/var/lib/dpkg/status. + + + The Ignore-Files-Silently list can be used to specify + which files APT should silently ignore while parsing the files in the + fragment directories. Per default a file which end with .disabled, + ~, .bak or .dpkg-[a-z]+ + is silently ignored. As seen in the last default value these patterns can use regular + expression syntax. + APT in DSelect -- cgit v1.2.3-70-g09d2