OSSP CVS Repository

ossp - Difference in ossp-pkg/snmpdx/snmpdx.d/swOp.pm versions 1.8 and 1.9
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/snmpdx/snmpdx.d/swOp.pm 1.8 -> 1.9

--- swOp.pm      2004/07/28 13:37:48     1.8
+++ swOp.pm      2004/07/30 09:31:23     1.9
@@ -35,10 +35,20 @@
 
 sub probe ($$) {
     my ($self, $obj) = @_;
+    my $openpkg = $self->{-ctx}->{-opt}->{openpkg};
+
+    my $rpm;
+    if    ( -x "$openpkg/bin/openpkg" and -x "$openpkg/libexec/openpkg/rpm" ) { #OpenPKG 2.x
+        $rpm="$openpkg/bin/openpkg rpm"
+    }
+    elsif ( -x "$openpkg/bin/rpm" and not -x "$openpkg/libexec/openpkg/rpm" ) { #OpenPKG 1.x
+        $rpm="$openpkg/bin/rpm"
+    }
+    else { return; } #no (known) OpenPKG
 
     #   query details via rpm(1)
     my $out = $self->{-ctx}->{-sys}->run(
-        "openpkg rpm -qa --qf '[%{NAME} %{VERSION} %{RELEASE} %{BUILDTIME} %{INSTALLTIME}\\n]'", "10m");
+        "$rpm -qa --qf '[%{NAME} %{VERSION} %{RELEASE} %{BUILDTIME} %{INSTALLTIME}\\n]'", "10m");
     return if ($out->{-stdout} eq '');
 
     #   parse details into internal structure

CVSTrac 2.0.1