Control: forwarded 995131 https://github.com/networkupstools/nut/pull/528
Control: tags 995131 fixed-upstream

Already reported and fixed upstream:

  
https://github.com/networkupstools/nut/commit/d693c427c526af1a933fa9aa95165c483fe08114

The patch is basically the same.

No new upstream release has been made in the years since... there does
seem to be some recent activity in git.


live well,
  vagrant

On 2021-09-26, Vagrant Cascadian wrote:
> The comments for various udev rules list different drivers for some
> devices.
>
>   
> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/i386/diffoscope-results/nut.html
>
>   /lib/udev/rules.d/62-nut-usbups.rules
>
>   Krauler·UP-M500VA··-·blazer_usb
>   vs.
>   Krauler·UP-M500VA··-·nutdrv_qx
>
> The udev rules are generated from tools/nut-usbinfo.pl reading the files
> in ../drivers/, using perl's File::Find, which does not reliably return
> the same file ordering. In some cases, multiple drivers claim support
> for a given device, and which driver gets embedded into the udev
> comments depends on the order in which the directory contents were
> returned.
>
> The attached patch fixes this by sorting the directory output.
>
> With this patch applied, nut should become reproducible on
> tests.reproducible-builds.org.
>
> Our test infrastructure seems to only reliably catch this issue on i386
> and armhf (e.g. 32-bit architectures).
>
>
> Thanks for maintaining nut!
>
>
> live well,
>   vagrant
> From c18bf3799a6b8dafcfe42c1a0e595ae54b7d3f82 Mon Sep 17 00:00:00 2001
> From: Vagrant Cascadian <[email protected]>
> Date: Sun, 26 Sep 2021 19:21:00 +0000
> Subject: [PATCH] nut-usbinfo.pl: Sort the directory scan results.
>
> The order of the files processed depends on readdir order. As some
> devices are supported by multiple drivers, which one gets embedded in
> the output (e.g. udev rules) depends on the order of the processed
> files.
>
> https://reproducible-builds.org/docs/stable-inputs/
> ---
>  tools/nut-usbinfo.pl | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/nut-usbinfo.pl b/tools/nut-usbinfo.pl
> index 2c0dd05..56dd331 100755
> --- a/tools/nut-usbinfo.pl
> +++ b/tools/nut-usbinfo.pl
> @@ -76,7 +76,9 @@ my %vendorName;
>  
>  ################# MAIN #################
>  
> -find(\&find_usbdevs,$scanPath);
> +find({wanted => \&find_usbdevs,
> +      preprocess => sub { sort(@_)}}
> +     ,$scanPath);
>  &gen_usb_files;
>  
>  ################# SUB METHOD #################
> -- 
> 2.33.0

Attachment: signature.asc
Description: PGP signature

Reply via email to