]> git.proxmox.com Git - pve-manager.git/commitdiff
pvecfg: adapt version and release semantic
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 26 May 2019 13:58:16 +0000 (15:58 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 26 May 2019 14:11:43 +0000 (16:11 +0200)
Wit commit a74ba607d4b02c5734c5480de62700f52f96ac71 we switched over
to using the dpkg-dev provided helpers to set package version,
architecture and such in the buildsystem.

But unlike other repositories we used the version also for giving it
back over the API through the during build generated PVE::pvecfg
module, which wasn't fully updated to the new style.

This patch does that, and also cleans up semantics a bit, the
following two changed:

release is now the Debian release, instead of the "package release"
(i.e., the -X part of a full package version).
version is now simply the full (pve-manager) version, e.g., 6.0-1 or
the currently for testing used 6.0-0+1

This allows to do everything we used this information for even in a
slightly easier way (no  string concat needed anymore), and fits also
with the terminology we often used in our public channels (mailing
lists, forum, website)

Remove some cruft as we touch things.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Makefile
PVE/API2/Nodes.pm
PVE/APLInfo.pm
PVE/Makefile
PVE/Report.pm
PVE/Service/pveproxy.pm
PVE/pvecfg.pm.in
www/manager6/Workspace.js

index 68470c00025bfdc5a004f0bcab6971ad89c6b14a..be8cc56f7c78c671c36399ba463d09008faba43d 100644 (file)
--- 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
index 83df9956e40b4f69461521846c283cea0c9a3a60..4136f6ed33f74c2abc6be8aeeba3457df8bdef13 100644 (file)
@@ -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 {
index fe9455065dca3b2f7ff22322213996f86a5a1f35..99c02348456b0dfe76f49f0857e95169ce85e2f5 100644 (file)
@@ -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);
index 68d2ae2f9f27b481da205743e7120e49ce400345..ad21d3832ee19b44662a253aaec50e88ac4b9eb8 100644 (file)
@@ -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 $@
 
 %:
index 1199a6d5a1fad82b77910732dee4e432a9b9e931..529acb37390a0add7806453a4a8e0c0f4238dd50 100644 (file)
@@ -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';
index 467748b130e9035b2ac83ad12a4808825db4aa9a..4a515707b9a6a295ced8ed2e0161d2d49bffc1a8 100755 (executable)
@@ -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,
     };
 
index 376ed5d110786a8b18b6e8f46813dc6185ac32ac..6307ed9b0a48d32e2118f5803438da1e235a3a10 100644 (file)
@@ -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@',
     }
 }
index 6d706384d79bd2101c2aa451e6e730448f46768d..7c7714454b564e8231c8b4299c1a018a8375440e 100644 (file)
@@ -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');