diff --git a/Makefile b/Makefile index 68470c00..be8cc56f 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,8 @@ include /usr/share/dpkg/pkg-info.mk include /usr/share/dpkg/architecture.mk include defines.mk -export VERSION=${DEB_VERSION_UPSTREAM} +export PVERELEASE=${DEB_VERSION_UPSTREAM} +export VERSION=${DEB_VERSION_UPSTREAM_REVISION} DESTDIR= @@ -13,7 +14,7 @@ GITVERSION:=$(shell git rev-parse HEAD) # possibly set via debian/rules(.env) REPOID?=$(shell git rev-parse --short=8 HEAD) -DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_${DEB_BUILD_ARCH}.deb +DEB=${PACKAGE}_${VERSION}_${DEB_BUILD_ARCH}.deb all: ${SUBDIRS} set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i; done diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm index 83df9956..4136f6ed 100644 --- a/PVE/API2/Nodes.pm +++ b/PVE/API2/Nodes.pm @@ -218,9 +218,18 @@ __PACKAGE__->register_method ({ returns => { type => "object", properties => { - version => { type => 'string' }, - release => { type => 'string' }, - repoid => { type => 'string' }, + version => { + type => 'string', + description => 'The current installed pve-manager package version', + }, + release => { + type => 'string', + description => 'The current installed Proxmox VE Release', + }, + repoid => { + type => 'string', + description => 'The short git commit hash ID from which this version was build', + }, }, }, code => sub { diff --git a/PVE/APLInfo.pm b/PVE/APLInfo.pm index fe945506..99c02348 100644 --- a/PVE/APLInfo.pm +++ b/PVE/APLInfo.pm @@ -222,8 +222,8 @@ sub update { logmsg($logfd, "starting update"); my $ua = LWP::UserAgent->new; - my $version = PVE::pvecfg::version(); - $ua->agent("PVE/$version"); + my $release = PVE::pvecfg::release(); + $ua->agent("PVE/$release"); if ($proxy) { $ua->proxy(['http', 'https'], $proxy); diff --git a/PVE/Makefile b/PVE/Makefile index 68d2ae2f..ad21d383 100644 --- a/PVE/Makefile +++ b/PVE/Makefile @@ -17,7 +17,7 @@ all: pvecfg.pm ${SUBDIRS} set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i; done pvecfg.pm: pvecfg.pm.in - sed -e s/@VERSION@/${VERSION}/ -e s/@PACKAGERELEASE@/${PACKAGERELEASE}/ -e s/@PACKAGE@/${PACKAGE}/ -e s/@REPOID@/${REPOID}/ $< >$@.tmp + sed -e s/@VERSION@/${VERSION}/ -e s/@PVERELEASE@/${PVERELEASE}/ -e s/@PACKAGE@/${PACKAGE}/ -e s/@REPOID@/${REPOID}/ $< >$@.tmp mv $@.tmp $@ %: diff --git a/PVE/Report.pm b/PVE/Report.pm index 1199a6d5..529acb37 100644 --- a/PVE/Report.pm +++ b/PVE/Report.pm @@ -2,7 +2,7 @@ package PVE::Report; use strict; use warnings; -use PVE::pvecfg; + use PVE::Tools; $ENV{'PATH'} = '/sbin:/bin:/usr/sbin:/usr/bin'; diff --git a/PVE/Service/pveproxy.pm b/PVE/Service/pveproxy.pm index 467748b1..4a515707 100755 --- a/PVE/Service/pveproxy.pm +++ b/PVE/Service/pveproxy.pm @@ -212,8 +212,7 @@ sub get_index { $langfile = 1; } - my $ver = PVE::pvecfg::version(); - my $release = PVE::pvecfg::release(); + my $version = PVE::pvecfg::version(); my $wtversionraw = PVE::Tools::file_read_firstline("$basedirs->{widgettoolkit}/proxmoxlib.js"); my $wtversion; @@ -229,7 +228,7 @@ sub get_index { console => $args->{console}, nodename => $nodename, debug => $server->{debug}, - version => "$ver-$release", + version => "$version", wtversion => $wtversion, }; diff --git a/PVE/pvecfg.pm.in b/PVE/pvecfg.pm.in index 376ed5d1..6307ed9b 100644 --- a/PVE/pvecfg.pm.in +++ b/PVE/pvecfg.pm.in @@ -1,35 +1,33 @@ package PVE::pvecfg; use strict; -use vars qw(@ISA); -use Carp; +use warnings; sub package { - return '@PACKAGE@'; + return '@PACKAGE@'; } sub version { - return '@VERSION@'; + return '@VERSION@'; } sub release { - return '@PACKAGERELEASE@'; + return '@PVERELEASE@'; } sub repoid { - return '@REPOID@'; + return '@REPOID@'; } -# this is diplayed on the GUI sub version_text { - return '@VERSION@-@PACKAGERELEASE@/@REPOID@'; + return '@VERSION@/@REPOID@'; } # this is returned by the API sub version_info { return { 'version' => '@VERSION@', - 'release' => '@PACKAGERELEASE@', + 'release' => '@PVERELEASE@', 'repoid' => '@REPOID@', } } diff --git a/www/manager6/Workspace.js b/www/manager6/Workspace.js index 6d706384..7c771445 100644 --- a/www/manager6/Workspace.js +++ b/www/manager6/Workspace.js @@ -171,7 +171,7 @@ Ext.define('PVE.StdWorkspace', { var ui = me.query('#versioninfo')[0]; if (PVE.VersionInfo) { - var version = PVE.VersionInfo.version + '-' + PVE.VersionInfo.release; + var version = PVE.VersionInfo.version; ui.update('Virtual Environment ' + version); } else { ui.update('Virtual Environment');