[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#818687: RFS: btrfs-progs/4.4.1-1.1 [NMU]



On 04/21/2016 01:41 AM, Nicholas D Steeves wrote:
> On 20 April 2016 at 18:33, James Cowgill <jcowgill@debian.org> wrote:
>>> "if [ -x /usr/sbin/update-initramfs ] && [ -e /etc/initramfs-tools/initramfs.conf ]"
>>
>> I don't think there's anything particularly wrong with that line.
>>
>> The previous attempts at fixing this (using 'hash' and 'command -v')
>> are both bashisms so they shouldn't be used.
>>
>> If you really want to fix the lintian warning, using 'which' is
>> probably the best idea here since it's an essential executable, not a
>> shell builtin.
>>
>> if which update-initramfs > /dev/null 2>&1 && [ -e /etc/initramfs-tools/initramfs.conf ]
> 
> My first instinct was to use `which command`, which is what I
> generally use, but because this was official Debian work I read up on
> which vs hash vs command -v.  What I found was that `which` has
> undefined exit values from xNIX to yNIX, and is apparently considered
> bad style by some people.  Hash was the oldest posix-correct way to do
> it, using a shell internal function.  In this case, I think it broke
> on piuparts because piuparts used bash; so I think this was an dashism
> rather than a bashism ;-)

Actually, I would recomment ditching this code completely: initramfs-tools
is the default initramfs in Debian, but not the only one. For example,
there's also dracut. Instead of explicitly calling update-initramfs, which
is an initramfs-tools specific, the better way of making sure that the
initramfs is regenerated is to use triggers.

For this, just remove the maintainer script (postinst etc.) parts that
deal with update-initramfs entirely, and rather create a file called
debian/btrfs-progs.triggers with the following contents:

activate update-initramfs

All initramfs implementations in Debian subscribe to that dpkg trigger
will hence be regenerated when the state of a package activating this
trigger changes, i.e. the package is installed, upgraded or removed.

Note that you currently only ship integration for initramfs-tools, so this
doesn't mean that this trigger will immediately make btrfs-progs work with
all other initramfs implementations, but at least dracut supports btrfs
natively (btrfs support is already integrated there), so with this change
the package will now integrate with dracut properly and make the
packaging quite a bit simpler.

Regards,
Christian

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: