mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-04 11:26:55 +00:00
98_version.pm: fixing race condition when execution "version noheader"
git-svn-id: https://svn.fhem.de/fhem/trunk@10658 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
da952ed30a
commit
3dc9c484ee
@ -16,7 +16,7 @@ CommandVersion($$)
|
|||||||
{
|
{
|
||||||
my ($cl, $param) = @_;
|
my ($cl, $param) = @_;
|
||||||
|
|
||||||
my $noheader = ($param =~ s/\s+noheader\s*$//);
|
my $noheader = ($param =~ s/(?:^\s*|\s+)noheader\s*$//);
|
||||||
|
|
||||||
eval { "test" =~ /$param/ };
|
eval { "test" =~ /$param/ };
|
||||||
return "invalid filter regexp" if($@);
|
return "invalid filter regexp" if($@);
|
||||||
@ -30,7 +30,7 @@ CommandVersion($$)
|
|||||||
foreach my $fn (@files) {
|
foreach my $fn (@files) {
|
||||||
next unless($fn =~ /^(?:$modpath.?)?FHEM/ or $fn =~ /fhem.pl$/); # configDB
|
next unless($fn =~ /^(?:$modpath.?)?FHEM/ or $fn =~ /fhem.pl$/); # configDB
|
||||||
my $mod_name = ($fn=~ /[\/\\]([^\/\\]+)$/ ? $1 : $fn);
|
my $mod_name = ($fn=~ /[\/\\]([^\/\\]+)$/ ? $1 : $fn);
|
||||||
next if($param && $mod_name !~ /$param/);
|
next if($param ne "" && $mod_name !~ /$param/);
|
||||||
next if(grep(/$mod_name/, @ret));
|
next if(grep(/$mod_name/, @ret));
|
||||||
Log 4, "Looking for SVN Id in module $mod_name";
|
Log 4, "Looking for SVN Id in module $mod_name";
|
||||||
|
|
||||||
@ -58,8 +58,8 @@ CommandVersion($$)
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ret = map {/\$Id\: (\S+) (\S+) (.+?) \$/ ? sprintf("%-".$max."s %5d %s",$1,$2,$3) : $_} @ret;
|
@ret = map {/\$Id\: (\S+) (\S+) (.+?) \$/ ? sprintf("%-".$max."s %5d %s",$1,$2,$3) : $_} @ret;
|
||||||
@ret = sort {version_sortModules($a, $b)} grep {(defined($param) ? $_ =~ /$param/ : 1)} @ret;
|
@ret = sort {version_sortModules($a, $b)} grep {($param ne "" ? $_ =~ /$param/ : 1)} @ret;
|
||||||
return "no loaded modules found that match: $param" if($param && !@ret);
|
return "no loaded modules found that match: $param" if($param ne "" && !@ret);
|
||||||
return ($noheader ? "" : sprintf("%-".$max."s %s","File","Rev Last Change\n\n")).
|
return ($noheader ? "" : sprintf("%-".$max."s %s","File","Rev Last Change\n\n")).
|
||||||
trim(join("\n", grep (($_ =~ /^fhem.pl|\d\d_/), @ret))."\n\n".
|
trim(join("\n", grep (($_ =~ /^fhem.pl|\d\d_/), @ret))."\n\n".
|
||||||
join("\n", grep (($_ !~ /^fhem.pl|\d\d_/), @ret))
|
join("\n", grep (($_ !~ /^fhem.pl|\d\d_/), @ret))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user