[Nut-upsdev] [PATCH 18/36] this script is using some kind of "find" module so it's finding all kinds of stuff it should never look at.

Greg A. Woods woods at planix.com
Thu Mar 8 23:21:29 UTC 2012


From: "Greg A. Woods" <woods at planix.com>

why it didn't use a plain shell-like glob I'll never guess.

why it exists in the first place is unimaginable too.
---
 tools/nut-usbinfo.pl |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/nut-usbinfo.pl b/tools/nut-usbinfo.pl
index bd74bf8..2ef2934 100755
--- a/tools/nut-usbinfo.pl
+++ b/tools/nut-usbinfo.pl
@@ -211,7 +211,8 @@ sub gen_usb_files
 
 sub find_usbdevs
 {
-	return $File::Find::prune = 1 if $_ eq '.svn';
+	# maybe there's an option to turn off all .* files, but anyway this is stupid
+	return $File::Find::prune = 1 if ($_ eq '.svn') || ($_ =~ /^\.#/);
 
 	my $nameFile=$_;
 	my $lastComment="";
-- 
1.7.9.2




More information about the Nut-upsdev mailing list