show deb pkg version
[freeside.git] / httemplate / view / Status.html
index 7fb03eb..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,
     },
@@ -121,7 +136,7 @@ if ( $db eq 'PostgreSQL' ) {
                 && FS::Record->scalar_sql('SHOW archive_mode') eq 'on';
 
   my $slave = 
-    FS::Record->scalar_sql('SHOW archive_command') =~ / postgres\@([\w\.\-]+): /
+    FS::Record->scalar_sql('SHOW archive_command') =~ / postgres\@([\w\.\-]+):/
       ? $1 : '';
 
   $status{'Replication'} = [
@@ -141,11 +156,11 @@ if ( $db eq 'PostgreSQL' ) {
       # http://www.keithf4.com/monitoring_streaming_slave_lag/
       # except pg_stat_replication still doesn't fill in the columns we need as
       # non-Pg user :/
-      push @{ $status{'Replication'} }, 
-        { 'title' => 'Slave',
-          'value' => $slave || '(Missing, or unparseable archive_command)',
-        },
-      ;
+      #push @{ $status{'Replication'} }, 
+      #  { 'title' => 'Slave',
+      #    'value' => $slave || '(Missing, or unparseable archive_command)',
+      #  },
+      #;
     }
   }