From 7ff3260f0947da880bd1104bb65a8ddf957f9c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A9ri=20Le=20Bouder?= Date: Tue, 29 May 2012 11:33:05 +0200 Subject: [PATCH 1/5] fix warning if getDevicesFromUdev returns nothing closes: #1683 Reported-by: Benoit Campedel --- lib/FusionInventory/Agent/Tools/Linux.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/FusionInventory/Agent/Tools/Linux.pm b/lib/FusionInventory/Agent/Tools/Linux.pm index 6e8f5bc4b7..b6209da90a 100644 --- a/lib/FusionInventory/Agent/Tools/Linux.pm +++ b/lib/FusionInventory/Agent/Tools/Linux.pm @@ -33,6 +33,7 @@ sub getDevicesFromUdev { file => $file, pattern => qr/^N:(\S+)/ ); + next unless $device; next unless $device =~ /([hsv]d[a-z]|sr\d+)$/; push (@devices, _parseUdevEntry( logger => $params{logger}, file => $file, device => $device From d759b0a68f2b381aaa4e0fef7d4ab200cd9c2c66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A9ri=20Le=20Bouder?= Date: Tue, 29 May 2012 16:20:30 +0200 Subject: [PATCH 2/5] add NetInventory --- tools/createExtLinks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/createExtLinks.sh b/tools/createExtLinks.sh index f7625a3287..da4c8eee03 100755 --- a/tools/createExtLinks.sh +++ b/tools/createExtLinks.sh @@ -2,7 +2,7 @@ # Create symblink to the subi task modules set -e -for task in Deploy SNMPQuery NetDiscovery ESX; do +for task in Deploy SNMPQuery NetDiscovery NetInventory ESX; do taskLcName=`perl -e" print lc \"$task\""` taskFile=$PWD/../agent-task-$taskLcName/lib/FusionInventory/Agent/Task/$task.pm taskDir=$PWD/../agent-task-$taskLcName/lib/FusionInventory/Agent/Task/$task From f38543f2f3827281585a0a9ccf919f7f7104f3f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A9ri=20Le=20Bouder?= Date: Tue, 29 May 2012 16:37:42 +0200 Subject: [PATCH 3/5] fix syntax error --- lib/FusionInventory/Agent/Tools/Screen.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/FusionInventory/Agent/Tools/Screen.pm b/lib/FusionInventory/Agent/Tools/Screen.pm index d1f2f3b84c..25111b8b80 100644 --- a/lib/FusionInventory/Agent/Tools/Screen.pm +++ b/lib/FusionInventory/Agent/Tools/Screen.pm @@ -282,7 +282,7 @@ sub checkParsedEdid { sub _build_detailed_timing { my ($pixel_clock, $vv) = @_; - my $h = get_many_bits($vv, 'detailed_timing'); + my $h = _get_many_bits($vv, 'detailed_timing'); $h->{pixel_clock} = $pixel_clock / 100; # to have it in MHz my %detailed_timing_field_size = map { $_->[1], $_->[0] } @{$subfields{detailed_timing}}; foreach my $field (keys %detailed_timing_field_size) { @@ -301,7 +301,7 @@ sub _add_standard_timing_modes { '4/3', '5/4', '16/9', ); $v = [ map { - my $h = get_many_bits($_, 'standard_timing'); + my $h = _get_many_bits($_, 'standard_timing'); $h->{X} = ($h->{X} + 31) * 8; if ($_ ne "\x20\x20" && $h->{X} > 256) { # cf VALID_TIMING in Xorg edid.h $h->{vfreq} += 60; @@ -426,7 +426,7 @@ sub parseEdid { $dtd_offset -= 4; while ($dtd_offset > 0) { - my $h = get_many_bits($v, 'cea_data_block_collection'); + my $h = _get_many_bits($v, 'cea_data_block_collection'); $dtd_offset -= $h->{size} + 1; my $vv; @@ -434,7 +434,7 @@ sub parseEdid { if ($h->{type} == 0x02) { # Video Data Block my @vmodes = unpack("a" x $h->{size}, $vv); foreach my $vmode (@vmodes) { - $h = get_many_bits($vmode, 'cea_video_data_block'); + $h = _get_many_bits($vmode, 'cea_video_data_block'); my $cea_mode = $cea_video_modes[$h->{mode} - 1]; if (!$cea_mode) { warn "parse_edid: unhandled CEA mode $h->{mode}\n" if $verbose; @@ -504,7 +504,7 @@ sub parseEdid { if ($error < 1 && $in_cm{vertical}) { # using it for the ratio $edid{ratio} = $in_cm{horizontal} / $in_cm{vertical}; - $edid{ratio_name} = ratio_name($in_cm{horizontal}, $in_cm{vertical}, 'mm'); + $edid{ratio_name} = _ratio_name($in_cm{horizontal}, $in_cm{vertical}, 'mm'); $edid{ratio_precision} = 'mm'; } @@ -533,7 +533,7 @@ sub parseEdid { $h->{pixel_clock} / $horizontal_total / $vertical_total * 1000 * 1000 * ($h->{interlaced} ? 2 : 1), $h->{pixel_clock} / $horizontal_total * 1000, $h->{interlaced} ? "interlaced, " : '', - nearest_ratio($h->{horizontal_active} / $h->{vertical_active}, 0.01) || sprintf("%.2f", $h->{horizontal_active} / $h->{vertical_active}), + _nearest_ratio($h->{horizontal_active} / $h->{vertical_active}, 0.01) || sprintf("%.2f", $h->{horizontal_active} / $h->{vertical_active}), $dpi_string ? ", $dpi_string" : ''; $h->{ModeLine} = sprintf qq("%dx%d" $h->{pixel_clock} %d %d %d %d %d %d %d %d %shsync %svsync%s), From 69f00d65f486c85fa98e1f8a18d763ef8d299db9 Mon Sep 17 00:00:00 2001 From: Kevin Roy Date: Tue, 29 May 2012 18:04:53 +0200 Subject: [PATCH 4/5] [win32] fix command execution remove .exe suffix in order to fix command execution use backslash to be more windows-world compliant --- lib/FusionInventory/Agent/Tools/Win32.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/FusionInventory/Agent/Tools/Win32.pm b/lib/FusionInventory/Agent/Tools/Win32.pm index 16cd92a0d2..63d874484c 100644 --- a/lib/FusionInventory/Agent/Tools/Win32.pm +++ b/lib/FusionInventory/Agent/Tools/Win32.pm @@ -173,8 +173,8 @@ sub runCommand { }; $job->spawn( - "$ENV{SYSTEMROOT}/system32/cmd.exe", - "cmd.exe /c $params{command}", + "$ENV{SYSTEMROOT}\\system32\\cmd.exe", + "cmd /c $params{command}", $args ); From 6546aa26e9a968b4379eeb939984f502205514a2 Mon Sep 17 00:00:00 2001 From: Guillaume Rousse Date: Wed, 30 May 2012 08:45:13 +0200 Subject: [PATCH 5/5] better formulation --- README | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README b/README index eb1c835a47..400739a3f8 100644 --- a/README +++ b/README @@ -3,10 +3,9 @@ Description ----------- -The fusioinventory agent is a generic agent, running on each managed node. It -can perform a certain number of actions, called tasks, according to its own -execution plan, or on behalf of a GLPI server with fusioninventory plugin, -acting as a control point. +The FusionInventory agent is a generic management agent. It can perform a +certain number of tasks, according to its own execution plan, or on behalf of a +GLPI server with fusioninventory plugin, acting as a control point. Two of these tasks are included in agent source distribution, local inventory and wake on lan. Other tasks are distributed separatly, excepted for binary