Done, although I put it in the if
and not the very start of the function, as it does not need to be executed outside of it.
Martin Rys (6fe9f1ee) at 24 Mar 12:57
Make current_template be local
Martin Rys (eaff77d3) at 24 Mar 12:55
Apply 1 suggestion(s) to 1 file(s)
It would be more flexible. One file for overrides might suffice, on Arch Linux anyways.
Imagine a distribution that uses mkinitcpio with the default template.
The distribution then uses the override file for distribution defaults while otherwise keeping upstream ones.
Now the user would run into the same problem, as they would not have a proper place to put their overrides without fighting mkinitcpio or the distribution packaging.
The problem is not about having multiple images, the problem is overriding the defaults of one, which will be even more of a problem if/when !343 gets merged.
Hope that does it
Martin Rys (4f4fc446) at 23 Mar 16:42
Variable convention
Now it's always overwritten.
Even if it already matches, but I figured overwriting a KB on every kernel install when user has unhandled pacnew isn't a big deal.
Martin Rys (1eb6fdd1) at 23 Mar 15:31
Always push the pacnew
It seems it's currently built against ffmpeg 6, so the patch seems to not be necessary anymore, it's not used in the PKGBUILD.
Oh, that went over my head when I wrote that logic, I'll fix that.
It's certainly an annoyance, but possibly not such a big one.
On my own setup I plan to simply merge the pacnew every time, and re-apply my changes through Ansible again, until a more granular way to handle presets exists.
I presume one could add a hook for this, to automate it fully through Pacman.
If you do that without having the ability to drop-in configure presets #240, install/reinstall of a kernel, which runs mkinitcpio, will overwrite any changes, meaning that configurations will need to be rewritten every single time there is a kernel reinstall or update, and then run mkinitcpio for the second time to apply the changes again.
Pacman does not overwrite files changed by the user, it writes a pacnew.
I don't see a way to differentiate between new defaults and user changing the file, so for both of these, pacnew will be generated.
I agree that directly overwriting the file would be a better option, but only if there is a way to configure presets outside of the main preset file.
Calling it a "pacnew" would be wrong since pacman is not directly involved.
There's already a "pacsave", I simply added another pacfile to the logic.
And this way it will be picked up by pacdiff
(at least by its more extensive search methods).
Both could be renamed to something like .save .new, but I do think it is useful to keep the current logic of using the same extensions as pacman.
Generate pacnew if current preset does not match template.
Inform user about pacnews being created/present.
Inform user about pacsave being created.
Current behavior is to ignore modified templates, which ends up with issues like these:
% grep micr /etc/mkinitcpio.d/linux-zen.preset
ALL_microcode=(/boot/*-ucode.img)
% pacman -S linux-zen
...
==> WARNING: Deprecated option 'ALL_microcode' found. Update '/etc/mkinitcpio.d/linux-zen.preset' to use the 'microcode' hook instead.
...
% grep micr /etc/mkinitcpio.d/linux-zen.preset
ALL_microcode=(/boot/*-ucode.img)
This should, imo, be handled automatically (user did not modify preset -> overwrite), which does not currently seem feasible, so this PR creates a pacnew on kernel install, if the default preset is modified.
There was previously no STDOUT in the bash script, and I was not sure how to handle it.
The main script uses ==> WARNING:
syntax, so I used that, but main script also opt-out uses colors that I did not implement, which may be confusing when one warning is colored and the other isn't, feedback welcome.
Without implementing preset drop-in files as per #240, this will create a pacnew on every kernel update if people modify their presets, as there is no way to do it cleanly.
After that is implemented, perhaps the .pacnew solution can be dropped altogether and differing presets just overwritten, and users informed that the default preset is to not be modified outside of drop-ins.
Martin Rys (f803b807) at 19 Mar 11:22
mkinitcpio hook script: Generate pacnew if current file does not ma...
I thought it might be but I couldn't figure out where to put it, thanks for the quick fix!
Martin Rys (f3c9e6f8) at 14 Mar 20:24
php-legacy-redis
depends on php-legacy-igbinary
php-redis
on php-igbinary
But a mismatch is possible, leading to a broken PHP installation.
[0] # pacman -Ss ...
extra/php-legacy-redis 6.0.2-3 [installed]
extra/php-redis 6.0.2-3 [installed]
extra/php-igbinary 3.2.15-3
extra/php-legacy-igbinary 3.2.15-3 [installed]
[0] # pacman -R php-legacy-igbinary
checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: removing php-legacy-igbinary breaks dependency 'php-legacy-igbinary' required by php-legacy-redis
:: removing php-legacy-igbinary breaks dependency 'php-igbinary' required by php-redis
[1] # php -v
PHP Warning: PHP Startup: Unable to load dynamic library 'redis' (tried: /usr/lib/php/modules/redis (/usr/lib/php/modules/redis: cannot open shared object file: No such file or directory), /usr/lib/php/modules/redis.so (/usr/lib/php/modules/redis.so: undefined symbol: igbinary_serialize)) in Unknown on line 0
...
It sure doesn't, but it would help me not having to track repositories down when I want to send PRs to them.