FS#64380 - [mkinitcpio] 27-1 /usr/share/mkinitcpio/hook.preset: It is a hook.preset.template.

Attached to Project: Arch Linux
Opened by regid (regid1) - Monday, 04 November 2019, 00:38 GMT
Last edited by Giancarlo Razzolini (grazzolini) - Tuesday, 18 February 2020, 09:37 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Dave Reisner (falconindy)
Giancarlo Razzolini (grazzolini)
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: Descriptive names helps a lot. /usr/share/mkinitcpio/hook.preset: Is a hook.preset.template. It is not an acceptable preset.

Other then changing the file name, I hope the following is the only required modification:
--- a/usr/share/libalpm/scripts/mkinitcpio-install 2019-10-29 14:01:14.000000000 +0000
+++ b/usr/share/libalpm/scripts/mkinitcpio-install 2019-11-04 00:28:35.905364148 +0000
@@ -18,11 +18,11 @@ while read -r line; do
preset="/etc/mkinitcpio.d/${pkgbase}.preset"
if [[ ! -e $preset ]]; then
if [[ -e $preset.pacsave ]]; then
- # move the pacsave to the template
+ # move the pacsave to the preset
mv "${preset}.pacsave" "$preset"
else
# create the preset from the template
- sed "s|%PKGBASE%|${pkgbase}|g" /usr/share/mkinitcpio/hook.preset \
+ sed "s|%PKGBASE%|${pkgbase}|g" /usr/share/mkinitcpio/hook.preseti.template \
| install -Dm644 /dev/stdin "$preset"
fi
fi

Additional info:
* mkinitcpio 27-1
This task depends upon

Closed by  Giancarlo Razzolini (grazzolini)
Tuesday, 18 February 2020, 09:37 GMT
Reason for closing:  No response
Additional comments about closing:  No response from the OP in a long time.
Comment by Giancarlo Razzolini (grazzolini) - Tuesday, 19 November 2019, 22:33 GMT
I guess if we are going to make the argument that a file literally called hook.preset is not descriptive, then why rename it to .preset.template? Let's go all the way in and call it only .template.

Perhaps this confusion stem from the place where this is installed? Right alongside a example.preset file? Also, if you want to argue that the hook.preset is not acceptable, you might also want to check the example.preset file. It literally saves the images to /tmp. How's that acceptable?

If you look at it from this angle, the hook.preset file might serve as an even better example than the example.preset bundled with mkinitcpio.

Having said all that, your patch has a typo. Can you also either send the patch to the [arch-projects] ML or (I personally prefer), open a PR on mknitcpio's github repository? We can move this discussion there if you want.

Loading...