summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2010-06-26 18:40:15 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2010-06-26 18:40:15 +0200
commit1408e219e76e577fb84ef1c48e58337b6569feec (patch)
treef665fda23f0bb1df862e8747cf2b40b73ba85edd /apt-pkg
parent1f2933a8de0f3a26f51b4a0a2112cbdfd4461e9b (diff)
* 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 *
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/contrib/fileutl.cc4
-rw-r--r--apt-pkg/init.cc5
2 files changed, 9 insertions, 0 deletions
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<string> GetListOfFilesInDir(string const &Dir, std::vector<string> c
}
std::vector<string> List;
+ Configuration::MatchAgainstConfig SilentIgnore("Dir::Ignore-Files-Silently");
DIR *D = opendir(Dir.c_str());
if (D == 0)
{
@@ -306,6 +307,7 @@ std::vector<string> GetListOfFilesInDir(string const &Dir, std::vector<string> 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<string> GetListOfFilesInDir(string const &Dir, std::vector<string> 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");