Imported Upstream version 2.7.3

This commit is contained in:
Arnaud Quette 2015-04-30 15:53:36 +02:00
parent a356b56d11
commit fd413a3168
283 changed files with 14978 additions and 6511 deletions

View file

@ -111,7 +111,7 @@ sub gen_usb_files
open my $outputUPower, ">$outputUPower" || die "error $outputUPower : $!";
print $outputUPower '##############################################################################################################'."\n";
print $outputUPower '# Uninterruptible Power Supplies with USB HID interfaces'."\n#\n";
print $outputUPower '# to keep up to date, monitor: http://svn.debian.org/wsvn/nut/trunk/scripts/upower/95-upower-hid.rules'."\n\n";
print $outputUPower '# to keep up to date, monitor https://github.com/networkupstools/nut/commits/master/scripts/upower/95-upower-hid.rules'."\n\n";
print $outputUPower '# only support USB, else ignore'."\n".'SUBSYSTEM!="usb", GOTO="up_hid_end"'."\n\n";
print $outputUPower '# if usbraw device, ignore'."\n".'KERNEL!="hiddev*", GOTO="up_hid_end"'."\n\n";
print $outputUPower '# if an interface, ignore'."\n".'ENV{DEVTYPE}=="usb_interface", GOTO="up_hid_end"'."\n\n";
@ -169,7 +169,7 @@ sub gen_usb_files
print $out_devd "\tmatch \"vendor\"\t\t\"$vendorId\";\n";
#
print $out_devd "\tmatch \"product\"\t\t\"$productId\";\n";
print $out_devd "\taction \"chgrp \@RUN_AS_GROUP\@ /dev/\$device-name*; chmod g+rw /dev/\$device-name*\";\n";
print $out_devd "\taction \"chgrp \@RUN_AS_GROUP\@ /dev/\$cdev; chmod g+rw /dev/\$cdev\";\n";
print $out_devd "};\n";
# UPower device entry (only for USB/HID devices!)
@ -209,7 +209,7 @@ sub gen_usb_files
sub find_usbdevs
{
# maybe there's an option to turn off all .* files, but anyway this is stupid
return $File::Find::prune = 1 if ($_ eq '.svn') || ($_ =~ /^\.#/);
return $File::Find::prune = 1 if ($_ eq '.svn') || ($_ =~ /^\.#/) || ($_ =~ /\.orig$/);
my $nameFile=$_;
my $lastComment="";
@ -265,8 +265,8 @@ sub find_usbdevs
}
}
# store date (to be optimized)
# and don't overwritte actual vendor names with empty values
# store data (to be optimized)
# and don't overwrite actual vendor names with empty values
if( (!$vendorName{$VendorID}) or (($vendorName{$VendorID} eq "") and ($VendorName ne "")) )
{
$vendorName{$VendorID}=trim($VendorName);