Debian Bug report logs - #784090
Adding extensions to Dir::Ignore-Files-Silently doesn't work

version graph

Package: apt; Maintainer for apt is APT Development Team <[email protected]>; Source for apt is src:apt (PTS, buildd, popcon).

Reported by: Raphaël Halimi <[email protected]>

Date: Sat, 2 May 2015 23:15:01 UTC

Severity: minor

Found in version apt/1.0.9.8

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], APT Development Team <[email protected]>:
Bug#784090; Package apt. (Sat, 02 May 2015 23:15:06 GMT) (full text, mbox, link).


Acknowledgement sent to Raphaël Halimi <[email protected]>:
New Bug report received and forwarded. Copy sent to APT Development Team <[email protected]>. (Sat, 02 May 2015 23:15:06 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Raphaël Halimi <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: Adding extensions to Dir::Ignore-Files-Silently doesn't work
Date: Sun, 3 May 2015 01:09:52 +0200
[Message part 1 (text/plain, inline)]
Package: apt
Version: 1.0.9.8
Severity: minor

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,

-- 
Raphaël Halimi

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to [email protected], APT Development Team <[email protected]>:
Bug#784090; Package apt. (Wed, 10 Jun 2015 13:30:05 GMT) (full text, mbox, link).


Acknowledgement sent to David Kalnischkies <[email protected]>:
Extra info received and forwarded to list. Copy sent to APT Development Team <[email protected]>. (Wed, 10 Jun 2015 13:30:05 GMT) (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: David Kalnischkies <[email protected]>
To: Raphaël Halimi <[email protected]>, [email protected]
Subject: Re: Bug#784090: Adding extensions to Dir::Ignore-Files-Silently doesn't work
Date: Wed, 10 Jun 2015 15:27:31 +0200
[Message part 1 (text/plain, inline)]
Hi,

On Sun, May 03, 2015 at 01:09:52AM +0200, Raphaël Halimi wrote:
> 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.

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…


> 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.

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
[signature.asc (application/pgp-signature, inline)]

Information forwarded to [email protected], APT Development Team <[email protected]>:
Bug#784090; Package apt. (Tue, 30 Jun 2015 12:45:04 GMT) (full text, mbox, link).


Acknowledgement sent to Raphaël Halimi <[email protected]>:
Extra info received and forwarded to list. Copy sent to APT Development Team <[email protected]>. (Tue, 30 Jun 2015 12:45:04 GMT) (full text, mbox, link).


Message #15 received at [email protected] (full text, mbox, reply):

From: Raphaël Halimi <[email protected]>
To: David Kalnischkies <[email protected]>, [email protected]
Subject: Re: Bug#784090: Adding extensions to Dir::Ignore-Files-Silently doesn't work
Date: Tue, 30 Jun 2015 14:41:56 +0200
[Message part 1 (text/plain, inline)]
Le 10/06/2015 15:27, David Kalnischkies a écrit :
> 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…

I think this would be a reasonable compromise.

>> 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.
> 
> 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 don't object at all.

> 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.

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,

-- 
Raphaël Halimi

[signature.asc (application/pgp-signature, attachment)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Sun Sep 22 07:38:02 2024; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.