[ocsinventory-agent/f17] missing patch
Remi Collet
remi at fedoraproject.org
Sun Sep 23 17:24:14 UTC 2012
commit 14f0d2fc8a34736b90039b7e7ce0cc4a69df8b99
Author: Remi Collet <remi at fedoraproject.org>
Date: Sun Sep 23 19:23:52 2012 +0200
missing patch
ocsinventory-agent-ifconfig.patch | 108 +++++++++++++++++++++++++++++++++++++
1 files changed, 108 insertions(+), 0 deletions(-)
---
diff --git a/ocsinventory-agent-ifconfig.patch b/ocsinventory-agent-ifconfig.patch
new file mode 100644
index 0000000..708fa2c
--- /dev/null
+++ b/ocsinventory-agent-ifconfig.patch
@@ -0,0 +1,108 @@
+=== modified file 'lib/Ocsinventory/Agent/Backend/OS/Linux/Network/IPv4.pm'
+--- lib/Ocsinventory/Agent/Backend/OS/Linux/Network/IPv4.pm 2010-07-27 22:03:30 +0000
++++ lib/Ocsinventory/Agent/Backend/OS/Linux/Network/IPv4.pm 2012-07-09 19:20:00 +0000
+@@ -11,7 +11,7 @@
+ my $common = $params->{common};
+ my @ip;
+ foreach (`ifconfig`){
+- if(/^\s*inet add?r\s*:\s*(\S+)/){
++ if(/^\s*inet add?r\s*:\s*(\S+)/ || /^\s*inet\s+(\S+)/){
+ ($1=~/127.+/)?next:push @ip, $1
+ };
+ }
+
+=== modified file 'lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm'
+--- lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm 2011-02-21 21:55:28 +0000
++++ lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm 2012-07-09 19:20:00 +0000
+@@ -157,13 +157,12 @@
+ $description = $driver = $ipaddress = $ipmask = $ipgateway = $macaddr = $pcislot = $status = $type = $virtualdev = undef;
+
+ } else { # In a section
+-
+- $description = $1 if $line =~ /^(\S+)/; # Interface name
+- $ipaddress = $1 if $line =~ /inet addr:(\S+)/i;
+- $ipmask = $1 if $line =~ /\S*mask:(\S+)/i;
+- $macaddr = $1 if $line =~ /hwadd?r\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i;
+- $status = 1 if $line =~ /^\s+UP\s/;
+- $type = $1 if $line =~ /link encap:(\S+)/i;
++ $description = $1 if ($line =~ /^(\S+):/ || $line =~ /^(\S+)/); # Interface name
++ $ipaddress = $1 if ($line =~ /inet addr:(\S+)/i || $line =~ /^\s*inet\s+(\S+)/);
++ $ipmask = $1 if ($line =~ /\S*mask:(\S+)/i || $line =~ /\S*netmask\s+(\S+)/);
++ $macaddr = $1 if ($line =~ /hwadd?r\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i || $line =~ /\s*ether\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i);
++ $status = 1 if ($line =~ /^\s+UP\s/ || $line =~ /^\S*UP,/);
++ $type = $1 if $line =~ /link encap:(\S+)/i;
+ }
+
+
+
+=== modified file 'lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm'
+--- lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm 2012-07-09 19:20:00 +0000
++++ lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm 2012-09-10 21:01:30 +0000
+@@ -162,7 +162,7 @@
+ $ipmask = $1 if ($line =~ /\S*mask:(\S+)/i || $line =~ /\S*netmask\s+(\S+)/);
+ $macaddr = $1 if ($line =~ /hwadd?r\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i || $line =~ /\s*ether\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i);
+ $status = 1 if ($line =~ /^\s+UP\s/ || $line =~ /^\S*UP,/);
+- $type = $1 if $line =~ /link encap:(\S+)/i;
++ $type = $1 if ($line =~ /link encap:(\S+)/i || $line =~ /^\s+(loop|ether).*\((\S+)\)/i);
+ }
+
+
+
+=== modified file 'lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm'
+--- lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm 2012-09-10 21:01:30 +0000
++++ lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm 2012-09-20 22:03:51 +0000
+@@ -161,7 +161,7 @@
+ $ipaddress = $1 if ($line =~ /inet addr:(\S+)/i || $line =~ /^\s*inet\s+(\S+)/);
+ $ipmask = $1 if ($line =~ /\S*mask:(\S+)/i || $line =~ /\S*netmask\s+(\S+)/);
+ $macaddr = $1 if ($line =~ /hwadd?r\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i || $line =~ /\s*ether\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i);
+- $status = 1 if ($line =~ /^\s+UP\s/ || $line =~ /^\S*UP,/);
++ $status = $1 if ($line =~ /^\s+UP\s/ || $line =~ /flags=.*(,|<)UP(,|>)/);
+ $type = $1 if ($line =~ /link encap:(\S+)/i || $line =~ /^\s+(loop|ether).*\((\S+)\)/i);
+ }
+
+
+=== modified file 'lib/Ocsinventory/Agent/Backend/OS/Linux/Network/IPv4.pm'
+--- lib/Ocsinventory/Agent/Backend/OS/Linux/Network/IPv4.pm 2012-07-09 19:20:00 +0000
++++ lib/Ocsinventory/Agent/Backend/OS/Linux/Network/IPv4.pm 2012-09-23 15:42:02 +0000
+@@ -11,7 +11,8 @@
+ my $common = $params->{common};
+ my @ip;
+ foreach (`ifconfig`){
+- if(/^\s*inet add?r\s*:\s*(\S+)/ || /^\s*inet\s+(\S+)/){
++ if(/^\s*inet\s*(\S+)\s*netmask/){
++ #if(/^\s*inet add?r\s*:\s*(\S+)/ || /^\s*inet\s+(\S+)/){
+ ($1=~/127.+/)?next:push @ip, $1
+ };
+ }
+
+=== modified file 'lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm'
+--- lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm 2012-09-20 22:03:51 +0000
++++ lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm 2012-09-23 15:42:02 +0000
+@@ -158,10 +158,10 @@
+
+ } else { # In a section
+ $description = $1 if ($line =~ /^(\S+):/ || $line =~ /^(\S+)/); # Interface name
+- $ipaddress = $1 if ($line =~ /inet addr:(\S+)/i || $line =~ /^\s*inet\s+(\S+)/);
+- $ipmask = $1 if ($line =~ /\S*mask:(\S+)/i || $line =~ /\S*netmask\s+(\S+)/);
+- $macaddr = $1 if ($line =~ /hwadd?r\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i || $line =~ /\s*ether\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i);
+- $status = $1 if ($line =~ /^\s+UP\s/ || $line =~ /flags=.*(,|<)UP(,|>)/);
++ $ipaddress = $1 if ($line =~ /inet addr:(\S+)/i || $line =~ /inet (\S+)\s+netmask/i);
++ $ipmask = $1 if ($line =~ /\S*mask:(\S+)/i || $line =~ /\S*netmask (\S+)\s/i);
++ $macaddr = $1 if ($line =~ /hwadd?r\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i || $line =~ /ether\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i);
++ $status = 1 if ($line =~ /^\s+UP\s/ || $line =~ /flags=.*(,|<)UP(,|>)/);
+ $type = $1 if ($line =~ /link encap:(\S+)/i || $line =~ /^\s+(loop|ether).*\((\S+)\)/i);
+ }
+
+
+--- lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm.old 2012-09-23 18:46:04.177526820 +0200
++++ lib/Ocsinventory/Agent/Backend/OS/Linux/Network/Networks.pm 2012-09-23 18:52:24.019984283 +0200
+@@ -162,7 +162,8 @@
+ $ipmask = $1 if ($line =~ /\S*mask:(\S+)/i || $line =~ /\S*netmask (\S+)\s/i);
+ $macaddr = $1 if ($line =~ /hwadd?r\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i || $line =~ /ether\s+(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})/i);
+ $status = 1 if ($line =~ /^\s+UP\s/ || $line =~ /flags=.*(,|<)UP(,|>)/);
+- $type = $1 if ($line =~ /link encap:(\S+)/i || $line =~ /^\s+(loop|ether).*\((\S+)\)/i);
++ $type = $1 if ($line =~ /link encap:(\S+)/i);
++ $type = $2 if ($line =~ /^\s+(loop|ether).*\((\S+)\)/i);
+ }
+
+
More information about the scm-commits
mailing list