show deb pkg version
authorIvan Kohler <ivan@freeside.biz>
Thu, 19 Sep 2019 02:15:46 +0000 (19:15 -0700)
committerIvan Kohler <ivan@freeside.biz>
Thu, 19 Sep 2019 02:15:46 +0000 (19:15 -0700)
httemplate/view/Status.html

index af58f35..dbe08b5 100644 (file)
@@ -30,6 +30,14 @@ if ( ! $@ && $os =~ /^\s*Description:\s*(.+)$/ ) {
   $os = "Debian $deb_version";
 }
 
+my $pkg_version = '';
+-e '/usr/bin/dpkg-query'
+  and run( ['/usr/bin/dpkg-query',
+              '--showformat=${Version}', '--show', 'freeside'
+           ],
+           '>', \$pkg_version
+         );
+
 ( my $perl_ver = $^V ) =~ s/^v//;
 
 my $db = driver_name;
@@ -58,6 +66,13 @@ tie my %status, 'Tie::IxHash',
     { 'title' => 'Freeside version',
       'value' => $FS::VERSION,
     },
+    ( length($pkg_version)
+        ? ( { 'title' => 'Package version',
+              'value' => $pkg_version,
+            },
+          )
+        : ()
+    ),
     { 'title' => 'Operating System',
       'value' => $os,
     },