Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Use short version of git hash and concat it to the version
Baptiste Daroussin committed 12 years ago
commit ea8f34584aa900f69b84b0218ffe0577d08a2cd6
parent 0518c50
2 files changed +7 -7
modified pkg/Makefile
@@ -40,8 +40,8 @@ BINDIR= ${PREFIX}/sbin
MANDIR=		${PREFIX}/man/man

.if exists(${.CURDIR}/../.git) && exists(/usr/local/bin/git)
-
GITHASH!=	cd ${.CURDIR} && git rev-parse HEAD
-
CFLAGS+=	-DGITHASH="\" ${GITHASH}\""
+
GITHASH!=	cd ${.CURDIR} && git rev-parse --short HEAD
+
CFLAGS+=	-DGITHASH="\"${GITHASH}\""
.endif

.if defined(DEBUG_FLAGS)
modified pkg/main.c
@@ -50,10 +50,6 @@

#include "pkgcli.h"

-
#ifndef GITHASH
-
#define GITHASH ""
-
#endif
-

static void usage(const char *, const char *);
static void usage_help(void);
static int exec_help(int, char **);
@@ -466,7 +462,11 @@ show_version_info(int version)
	if (version > 1)
		printf("%-24s: ", "Version");

-
	printf(PKG_PORTVERSION""GITHASH"\n");
+
#ifndef GITHASH
+
	printf(PKG_PORTVERSION"\n");
+
#else
+
	printf(PKG_PORTVERSION"-"GITHASH"\n");
+
#endif

	if (version == 1)
		exit(EX_OK);