#784090 Adding extensions to Dir::Ignore-Files-Silently doesn't work

Package:
apt
Source:
apt
Description:
commandline package manager
Submitter:
Raphaël Halimi
Date:
2015-06-30 12:45:04 UTC
Severity:
minor
#784090#5
Date:
2015-05-02 23:09:52 UTC
From:
To:
Before modifying a config file, I like to make a backup, either with cp
-a or with dpkg-divert --rename.

By default dpkg-divert diverts a file with the ".distrib" extension. So
I tried to make apt silently ignore this extension, but it didn't work.

I created a file called /etc/apt/apt.conf.d/00ignore-files-silently with
the contents:

// I like to rename some files before modifying them
Dir::Ignore-Files-Silently:: "\.distrib$";

The config snippet is indeed accepted by apt :

$ apt-config dump | grep -i silent
Dir::Ignore-Files-Silently "";
Dir::Ignore-Files-Silently:: "~$";
Dir::Ignore-Files-Silently:: "\.disabled$";
Dir::Ignore-Files-Silently:: "\.bak$";
Dir::Ignore-Files-Silently:: "\.dpkg-[a-z]+$";
Dir::Ignore-Files-Silently:: "\.save$";
Dir::Ignore-Files-Silently:: "\.orig$";
Dir::Ignore-Files-Silently:: "\.distUpgrade$";
Dir::Ignore-Files-Silently:: "\.distrib$";

But I still have a warning about
"/etc/apt/apt.conf.d/50unattended-upgrades.distrib" after each apt command.

Additionally, since ".distrib" is the default extension added by
dpkg-divert, maybe it should be added to the built-in list of silently
ignored extensions. I can report a separate bug with severity wishlist
if you think this is necessary.

Regards,

#784090#10
Date:
2015-06-10 13:27:31 UTC
From:
To:
Hi,

The problem is that your setting is read too late to have any effect for
configuration files. It will effect e.g. sources or preferences through.
To have the desired effect you would need to set this option in a config
file specified by an APT_CONFIG environment variable.

apt.conf manpage defines such a file to be read before the 'usual'
configuration files which are read together and do not effect the
execution paths used to parse later files.


Theoretically we could change this (= to let the previous parsed file
effect the next one), but in practice I am not sure all this work would
have much point beside blowing up my head and the complexity meter.

I remember talking about adding a warning if apt notices that an option
is set "too late" in another bugreport, but I can't find it ATM. Someday
I might even implemented it…

Actually, I you aren't objecting I would like to repropose this
bugreport to request this as the rest should be covered by other
bugreports already.

I have to say that I wonder why you divert a config file through.
Changes to the file can be detected by dpkg and even if you remove it
dpkg will not add it again on a package upgrade.


Best regards

David Kalnischkies

#784090#15
Date:
2015-06-30 12:41:56 UTC
From:
To:
Le 10/06/2015 15:27, David Kalnischkies a écrit :

I think this would be a reasonable compromise.

I don't object at all.

Well, you're right, and I don't do it any more for quite some time now,
but when I started this practice some months ago, it seemed like a good
idea.

The goal was to have a backup of the default config file, as provided by
the maintainer, which would be automatically updated during package
upgrades, without interrupting said upgrades. Unfortunately, this also
meant that I wouldn't be notified when the maintainer changed the
default configuration, which, after further thought, turned out to be a
more disturbing downside than having to compare/update the files
manually after each upgrade.

Regards,