summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2023-12-13 17:55:11 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2023-12-13 17:59:34 +0100
commit7b41275b9da31d6c87bbaa0c9115e224e47b15e1 (patch)
treec74b4a6f6a280a1a0f00a5976284d523342b096f /apt-pkg
parentc555d8f1ae31d1f511bf811640423231b75a8e13 (diff)
Do not silently ignore directories for reserved file names
Files with reserved extensions like .list, .sources, .conf, and .pref should receive notices in their respective directories even if they are directories.
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/contrib/fileutl.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index fad51ded1..99b1df3ff 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -486,12 +486,14 @@ std::vector<string> GetListOfFilesInDir(string const &Dir, std::vector<string> c
{
if (RealFileExists(File) == false)
{
+ string d_ext = flExtension(Ent->d_name);
// do not show ignoration warnings for directories
- if (
+ if ((
#ifdef _DIRENT_HAVE_D_TYPE
- Ent->d_type == DT_DIR ||
+ Ent->d_type == DT_DIR ||
#endif
- DirectoryExists(File) == true)
+ DirectoryExists(File) == true) &&
+ (d_ext.empty() || std::find(Ext.begin(), Ext.end(), d_ext) == Ext.end()))
continue;
if (SilentIgnore.Match(Ent->d_name) == false)
_error->Notice(_("Ignoring '%s' in directory '%s' as it is not a regular file"), Ent->d_name, Dir.c_str());