FS#50018 - implement /etc/pacman.d drop-in configuration folder

Attached to Project: Pacman
Opened by Olivier Médoc (oliv) - Monday, 11 July 2016, 12:55 GMT
Last edited by Andrew Gregory (andrewgregory) - Sunday, 16 October 2016, 14:10 GMT
Task Type Feature Request
Category General
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version 5.0.1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:
A folder where one can place drop-in configuration snippets.

Use Case:
Editing config files such as /etc/pacman.conf with scripts / config packages is problematic for various reasons. When modifying it as a sysadmin it may later conflict with settings changed by the user.

Also if pacman is updated and any changes are made to /etc/dnf/dnf.conf by dnf, these cannot be automatically merged. It will result in a /etc/pacman.conf.pacnew file that needs to be manually resolved.

It would be a lot simpler / more convenient if scripts / config packages could just drop configuration snippets into /etc/pacman.d/*.conf.

Debian/* has something similar with /etc/apt/conf.d, and Fedora/* with /etc/yum.conf.d

Current state:
When running pacman, Include directives are only allowed for mirrors:
warning: config file /etc/pacman.conf, line 51: directive 'Include /etc/pacman.d/qubes-updateproxy.conf' in section 'options' not recognized.
warning: config file /etc/pacman.conf, line 52: directive 'Include /etc/pacman.d/qubes-noupdate.conf' in section 'options' not recognized.
warning: config file /etc/pacman.conf, line 53: directive 'Include /etc/pacman.d/qubes-repositories.conf' in section 'options' not recognized.

Ideally the configuration line "Include /etc/pacman.d/*.conf" could be added to /etc/pacman.conf and would allow users to add snippets into /etc/pacman.d without modifying /etc/pacman.conf.

Examples:
Users could drop their NoUpdate configuration lines into /etc/pacman.d/noupdate.conf
Users could drop their custom repositories into /etc/pacman.d/myrepo.conf
This task depends upon

Closed by  Andrew Gregory (andrewgregory)
Sunday, 16 October 2016, 14:10 GMT
Reason for closing:  Works for me
Comment by Andrew Gregory (andrewgregory) - Monday, 11 July 2016, 13:43 GMT
You are missing an equal sign; it should be 'Include = /etc/pacman.d/*.conf' and it is already supported.
Comment by Olivier Médoc (oliv) - Monday, 11 July 2016, 14:05 GMT
Thanks for pointing it out. It seems to work properly if I put the line 'Include = /etc/pacman.d/*.conf' right before the repositories, so that it works both for options and custom repositories.

Is it possible to add this line in /etc/pacman.conf in order to allow automatic merging of upstream changes in pacman.conf ? This would also simplify third party scripts or configuration packages.

Loading...