[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.

Arnaud Quette aquette.dev at gmail.com
Mon May 14 12:25:56 UTC 2012


2012/3/9 Greg A. Woods <woods at planix.com>:
> From: "Greg A. Woods" <woods at planix.com>
>
> why it didn't use a plain shell-like glob I'll never guess.

glob is used in newer scripts that do similar things (augeas ups.conf
lens generation, SNMP info extraction, ...)

> why it exists in the first place is unimaginable too.

this specific script was extracted from the LIRC work, when I was
leading the Ubuntu Media Center (defunct) effort, and lightly adapted
to NUT.
it took me a minute to adapt and integrate it in NUT, which was fine.
not clean, nor optimal, but fine enough to do the job...

not sure to get the exact idea behind this comment.
but an answer may be: because I'm alone in this body (no clone
avail!), I only 24h a day like everyone, and I'm already pouring to
much time for the world and not enough to my family and myself?! then,
any help is always welcome ;-)

and there, I renew my proposition:
we always need motivated and competent people to help improve NUT.
would you be interested in joining us, and replace all these "stupid"
comments by sane implementations?

more seriously, this is the opensource credo "release early, release
often", and improve every iteration...
the thing there is that we needed visibility on the final use.
part of this, we generate 1 header (for nut-scanner) and bagazillions
of helper scripts (for hotplug, udev, upower, ...).
if you have a better idea that can address all these, in a better way,
I'm all hears.

> ---
>  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="";

applied to trunk, r3584, with an added TODO list, to track the needed rewrite.
thanks.

Arnaud
-- 
Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.free.fr/



More information about the Nut-upsdev mailing list