[pve-devel] [PATCH manager] use git rev-parse for repoid

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Jun 14 13:06:58 CEST 2017


On 06/14/2017 12:22 PM, Dominik Csapak wrote:
> instead of getting the repoid from .git/refs/heads/master
>
> using HEAD as commit also means we get the correct commit hash for when
> building the package (e.g. when building from stable-4)

This patch fixes the issue just partially and just in one package.

We also write the commit in the SOURCE file which we install in the docs 
directory.
There we use:
GITVERSION:=$(shell cat .git/refs/heads/master)

This should be swapped with:
GITVERSION:=$(shell git rev-parse HEAD)

A simple grep tell me that at least the following packages are affected:
novnc-pve
vncterm
corosync-pve
pve-docs
pve-manager
pve-manager
pve-kernel
dab
pve-storage
pve-storage
pve-container
pve-cluster
pve-access-control
lxcfs
pve-firewall
librados2-perl
qemu-server
pve-common
spiceterm
pve-ha-manager
fence-agents-pve
pve-libspice-server

But at least the WebUI shows the correct version with your patch.

> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
> since changing the build to dpkg-buildpackage we would get an empty
> string, because we do not copy the .git dir to dest
>   PVE/Makefile | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/PVE/Makefile b/PVE/Makefile
> index ac230fbf..33c110be 100644
> --- a/PVE/Makefile
> +++ b/PVE/Makefile
> @@ -14,7 +14,7 @@ PERLSOURCE = 			\
>   
>   all: pvecfg.pm ${SUBDIRS}
>   
> -REPOID=`../repoid.pl ../.git`
> +REPOID=$(shell git rev-parse --short HEAD)
>   
>   pvecfg.pm: pvecfg.pm.in
>   	sed -e s/@VERSION@/${VERSION}/ -e s/@PACKAGERELEASE@/${PACKAGERELEASE}/ -e s/@PACKAGE@/${PACKAGE}/ -e s/@REPOID@/${REPOID}/ $< >$@.tmp





More information about the pve-devel mailing list