archrelease: copy trunk to community-any
[ArchLinux/community.git] / nut / repos / community-x86_64 / nut-snmp-usb-order.patch
blobcfdbbc96993f08e01a3fdb3f8485109ce1db0ce7
1 The code that generates the SNMP and USB headers to compile against does not
2 have a deterministic order, leading to different results at times.
4 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
6 diff -Nuar --exclude .libs --exclude '*.o' --exclude core nut-2.7.1.orig/tools/nut-snmpinfo.py nut-2.7.1/tools/nut-snmpinfo.py
7 --- nut-2.7.1.orig/tools/nut-snmpinfo.py 2014-01-04 19:08:19.117150636 -0800
8 +++ nut-2.7.1/tools/nut-snmpinfo.py 2013-07-26 12:41:11.000000000 -0700
9 @@ -78,7 +78,9 @@
10 output_file.write( "/* SNMP IDs device table */\n" )
11 output_file.write( "static snmp_device_id_t snmp_device_table[] = {\n" )
13 -for filename in glob.glob('../drivers/*-mib.c'):
14 +mibs = glob.glob('../drivers/*-mib.c')
15 +mibs.sort()
16 +for filename in mibs:
17 list_of_line = open(filename,'r').read().split(';')
18 for line in list_of_line:
19 if "mib2nut_info_t" in line:
20 diff -Nuar --exclude .libs --exclude '*.o' --exclude core nut-2.7.1.orig/tools/nut-usbinfo.pl nut-2.7.1/tools/nut-usbinfo.pl
21 --- nut-2.7.1.orig/tools/nut-usbinfo.pl 2014-01-04 19:12:45.595949760 -0800
22 +++ nut-2.7.1/tools/nut-usbinfo.pl 2013-11-17 11:27:38.000000000 -0800
23 @@ -75,7 +75,12 @@
25 ################# MAIN #################
27 -find(\&find_usbdevs,$scanPath);
28 +find({
29 + wanted => \&find_usbdevs,
30 + follow => 1,
31 + preprocess => sub { return sort @_ },
32 + },
33 + $scanPath);
34 &gen_usb_files;
36 ################# SUB METHOD #################