--- /dev/null
+package Ocsinventory::Agent::Backend::OS::Generic::Packaging::Deb;
+
+use strict;
+use warnings;
+
+sub check { can_run("dpkg") }
+
+sub run {
+ my $params = shift;
+ my $common = $params->{common};
+
+# use dpkg-query --show --showformat='${Package}|||${Version}\n'
+ foreach(`dpkg-query --show --showformat='\${Status}---\${Package}---\${Version}---\${Installed-Size}---\${Description}\n' | grep ^'install ok installed'`) {
+ if (/^(\S+)---(\S+)---(\S+)---(\S+)---(.*)/) {
+ $common->addSoftware ({
+ 'NAME' => $2,
+ 'VERSION' => $3,
+ 'FILESIZE' => $4,
+ 'COMMENTS' => $5,
+ 'FROM' => 'deb'
+ });
+ }
+ }
+}
+
+1;
package Ocsinventory::Agent::Backend::OS::Generic::Hostname;
sub check {
- eval { require (Sys::Hostname) };
- return 1 unless $@;
- `which hostname 2>&1`;
- return if ($? >> 8)!=0;
- `hostname 2>&1`;
- return if ($? >> 8)!=0;
- 1;
+ return 1 if can_load ("Sys::Hostname::Long");
+ return 1 if can_run ("hostname");
+ 0;
}
# Initialise the distro entry
sub run {
my $params = shift;
- my $inventory = $params->{inventory};
+ my $common = $params->{common};
my $hostname;
- # ico, Tue, 26 May 2009 17:58:27 +0200
- chomp ( my $hostname = `hostname --fqdn` );
+ if (can_load("Sys::Hostname::Long")) {
+ $hostname = Sys::Hostname::Long::hostname_long();
+ } else {
+ chomp ( $hostname = `hostname --fqdn` ); # TODO: This is not generic.
+ }
- $inventory->setHardware ({NAME => $hostname});
+ $common->setHardware ({NAME => $hostname});
}
1;
+-------------------+
Paket zamjenjuje Hostname.pm zbog slanja dugog oblika imena (FQDN).
+Takodjer zamjenjuje Deb.pm koji ne salje pakete oznacena kao removed.
- -- Ivan Rako <Ivan.Rako@CARNet.hr> Fri, 26 Jun 2009 15:00:05 +0200
+ -- Ivan Rako <Ivan.Rako@CARNet.hr> Sat, 31 Aug 2013 15:53:00 +0200
+ocsinventory-agent-cn (1:2.0.5~cn0) stable; urgency=low
+
+ * prva verzija paketa za wheezy
+ * dodaje novi Deb.pm koji ne salje popis paketa oznacenih kao removed
+ * dodaje novi ispravljeni Hostname.pm
+ * ispravke za Lintian
+
+ -- Ivan Rako <Ivan.Rako@CARNet.hr> Sat, 31 Aug 2013 15:53:57 +0200
+
ocsinventory-agent-cn (1:1.1.1-1) stable; urgency=low
* prva verzija paketa za squeeze
Section: net
Priority: optional
Maintainer: Ivan Rako <Ivan.Rako@CARNet.hr>
-Build-Depends: debhelper (>= 4.0.0)
-Standards-Version: 3.6.1
+Build-Depends: debhelper (>= 8)
+Standards-Version: 3.9.3
Package: ocsinventory-agent-cn
Architecture: all
-Depends: carnet-tools-cn (>= 2.7), ocsinventory-agent (>= 2:1.1.1-2.3), libcrypt-ssleay-perl
+Depends: ${misc:Depends}, carnet-tools-cn (>= 2.7), ocsinventory-agent (>= 2:2.0.5-1), libcrypt-ssleay-perl, libsys-hostname-long-perl
Description: Hardware and software inventory tool (client)
Open Computer and Software Inventory Next Generation is an
application designed to help a network or system administrator to
Hostname.pm usr/share/perl5/Ocsinventory/Agent/Backend/OS/Generic
+Deb.pm /usr/share/perl5/Ocsinventory/Agent/Backend/OS/Generic/Packaging
if ! grep -q ^server= /etc/ocsinventory/ocsinventory-agent.cfg; then
echo "server=$ocsserver" >> /etc/ocsinventory/ocsinventory-agent.cfg
fi
+
+#DEBHELPER#
set -e
if [ "$1" = remove ]; then
- dpkg-divert --quiet --package ocsinventory-agent-cn --remove --rename \
+ dpkg-divert --quiet --package ocsinventory-agent-srce --remove --rename \
/usr/share/perl5/Ocsinventory/Agent/Backend/OS/Generic/Hostname.pm || true
+ dpkg-divert --quiet --package ocsinventory-agent-srce --remove --rename \
+ /usr/share/perl5/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Deb.pm || true
fi
+
+#DEBHELPER#
set -e
if [ "$1" = install -o "$1" = upgrade ]; then
- dpkg-divert --quiet --package ocsinventory-agent-cn --rename \
+ dpkg-divert --quiet --package ocsinventory-agent-srce --rename \
--divert /usr/share/perl5/Ocsinventory/Agent/Backend/OS/Generic/Hostname.pm.divert \
/usr/share/perl5/Ocsinventory/Agent/Backend/OS/Generic/Hostname.pm
+ dpkg-divert --quiet --package ocsinventory-agent-srce --rename \
+ --divert /usr/share/perl5/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Deb.pm.divert \
+ /usr/share/perl5/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Deb.pm
fi
+
+#DEBHELPER#