Commit c3e4292d authored by Shaheem Azmal M MD's avatar Shaheem Azmal M MD

Removed SVN_REV from files and replaced Commit with commit_hash

parent 3ddc3f88
......@@ -134,7 +134,7 @@ FO_CXXLDFLAGS = -lfossologyCPP -L$(CXXFOLIBDIR) -lstdc++ $(FO_LDFLAGS)
# define VERSION and COMMIT_ID
VERSION=`git describe --tags > /dev/null 2>&1 && git describe --tags | head -1 || echo "unknown"`
BRANCH=`git rev-parse --abbrev-ref HEAD > /dev/null 2>&1 && git rev-parse --abbrev-ref HEAD | head -1 || echo "unknown"`
COMMIT_ID=`git show > /dev/null 2>&1 && git show | head -1 | awk '{print substr($$2,1,6)}' || echo "unknown"`
COMMIT_HASH=`git show > /dev/null 2>&1 && git show | head -1 | awk '{print substr($$2,1,6)}' || echo "unknown"`
export PATH := $(TOP)/src/vendor/bin:$(PATH)
......@@ -154,7 +154,7 @@ WriteVERSIONFile = echo "writing VERSION file for $(1)"; \
echo "[$(1)]";\
echo "VERSION=$(VERSION)";\
echo "BRANCH=$(BRANCH)";\
echo "COMMIT=$(COMMIT_ID)";\
echo "COMMIT_HASH=$(COMMIT_HASH)";\
echo BUILD_DATE=`date +"%Y/%m/%d %R %Z"`;\
git show -s --format="%ct.%h" 2>/dev/null | {\
IFS='.' read ctimestamp chash && {\
......@@ -166,7 +166,7 @@ WriteVERSIONFile = echo "writing VERSION file for $(1)"; \
} > VERSION
# define VERSION and COMMIT_ID
DEFS = -DVERSION_S=\"$(VERSION)\" -DCOMMIT_ID_S=\"$(COMMIT_ID)\"
DEFS = -DVERSION_S=\"$(VERSION)\" -DCOMMIT_HASH_S=\"$(COMMIT_HASH)\"
# build html coverage report
#LCOV_OPT = --rc lcov_branch_coverage=1
......
......@@ -11,7 +11,7 @@ TOP = .
include Makefile.conf
endif
VARIABLES := PROJECT PROJECTUSER PROJECTGROUP DESTDIR PREFIX BINDIR SBINDIR SYSCONFDIR INITDIR LIBDIR INCLUDEDIR LIBEXECDIR DATAROOTDIR MODDIR LOCALSTATEDIR LOGDIR PROJECTSTATEDIR CACHEDIR MANDIR MAN1DIR DOCDIR WEBDIR PHPDIR VERSION SVN_REV TWIG_CACHE
VARIABLES := PROJECT PROJECTUSER PROJECTGROUP DESTDIR PREFIX BINDIR SBINDIR SYSCONFDIR INITDIR LIBDIR INCLUDEDIR LIBEXECDIR DATAROOTDIR MODDIR LOCALSTATEDIR LOGDIR PROJECTSTATEDIR CACHEDIR MANDIR MAN1DIR DOCDIR WEBDIR PHPDIR VERSION COMMIT_HASH TWIG_CACHE
%-process: %.in
@echo "Regenerating variables list ..."
......
......@@ -62,8 +62,8 @@
#define MAXCMD 4096
char SQL[256];
#ifdef SVN_REV_S
char BuildVersion[]="adj2nest build version: " VERSION_S " r(" SVN_REV_S ").\n";
#ifdef COMMIT_HASH_S
char BuildVersion[]="adj2nest build version: " VERSION_S " r(" COMMIT_HASH_S ").\n";
#else
char BuildVersion[]="adj2nest build version: NULL.\n";
#endif
......
......@@ -37,8 +37,8 @@ int debug = 0;
int DEB_SOURCE;
int DEB_BINARY;
#ifdef SVN_REV_S
char BuildVersion[]="buckets build version: " VERSION_S " r(" SVN_REV_S ").\n";
#ifdef COMMIT_HASH_S
char BuildVersion[]="buckets build version: " VERSION_S " r(" COMMIT_HASH_S ").\n";
#else
char BuildVersion[]="buckets build version: NULL.\n";
#endif
......@@ -66,7 +66,7 @@ int main(int argc, char **argv)
int hasPrules;
int user_pk = 0;
char *bucketpool_name;
char *SVN_REV;
char *COMMIT_HASH;
char *VERSION;
char *uploadtree_tablename;
char agent_rev[myBUFSIZ];
......@@ -175,9 +175,9 @@ int main(int argc, char **argv)
/* get agent pk
* Note, if GetAgentKey fails, this process will exit.
*/
SVN_REV = fo_sysconfig("buckets", "SVN_REV");
COMMIT_HASH = fo_sysconfig("buckets", "COMMIT_HASH");
VERSION = fo_sysconfig("buckets", "VERSION");
sprintf(agent_rev, "%s.%s", VERSION, SVN_REV);
sprintf(agent_rev, "%s.%s", VERSION, COMMIT_HASH);
agent_pk = fo_GetAgentKey(pgConn, basename(argv[0]), uploadtree.upload_fk, agent_rev, agentDesc);
/*** Initialize the license_ref table cache ***/
......
......@@ -299,7 +299,7 @@ class acme_review extends FO_Plugin
$spdx .= ' <specVersion>SPDX-1.1</specVersion>' . "\n";
$spdx .= ' <dataLicense rdf:about="http://spdx.org/licenses/PDDL-1.0" />' . "\n";
$spdx .= ' <CreationInfo>' . "\n";
$spdx .= " <creator>Tool: FOSSology v " . $SysConf['BUILD']['VERSION'] . " svn " . $SysConf['BUILD']['SVN_REV'] . "</creator>\n";
$spdx .= " <creator>Tool: FOSSology v " . $SysConf['BUILD']['VERSION'] . " svn " . $SysConf['BUILD']['COMMIT_HASH'] . "</creator>\n";
$spdx .= "<created>" . date('c') . "</created>\n"; // date-time in ISO 8601 format
$spdx .= '</CreationInfo>' . "\n";
......
......@@ -26,10 +26,10 @@ using namespace std;
void queryAgentId(int& agent, PGconn* dbConn)
{
char* SVN_REV = fo_sysconfig(AGENT_NAME, "SVN_REV");
char* COMMIT_HASH = fo_sysconfig(AGENT_NAME, "COMMIT_HASH");
char* VERSION = fo_sysconfig(AGENT_NAME, "VERSION");
char* agentRevision;
if (!asprintf(&agentRevision, "%s.%s", VERSION, SVN_REV))
if (!asprintf(&agentRevision, "%s.%s", VERSION, COMMIT_HASH))
{
exit(-1);
};
......
......@@ -56,9 +56,9 @@ class core_debug_fileloc extends FO_Plugin
public function Output()
{
global $BINDIR, $LIBDIR, $LIBEXECDIR, $INCLUDEDIR, $LOGDIR,
$SYSCONFDIR, $PROJECTSTATEDIR, $PROJECT, $VERSION, $SVN_REV;
$SYSCONFDIR, $PROJECTSTATEDIR, $PROJECT, $VERSION, $COMMIT_HASH;
$varray = array("BINDIR", "LIBDIR", "LIBEXECDIR", "INCLUDEDIR", "LOGDIR",
"SYSCONFDIR", "PROJECTSTATEDIR", "PROJECT", "VERSION", "SVN_REV");
"SYSCONFDIR", "PROJECTSTATEDIR", "PROJECT", "VERSION", "COMMIT_HASH");
global $MenuList;
$V = "";
$text = _(" Variable");
......
<?php
define("AGENT_DECIDER_NAME", "decider");
define("AGENT_DECIDER_VERSION", "{$VERSION}");
define("AGENT_DECIDER_REV", "{$SVN_REV}");
define("AGENT_DECIDER_REV", "{$COMMIT_HASH}");
<?php
define("AGENT_DECIDER_JOB_NAME", "deciderjob");
define("AGENT_DECIDER_JOB_VERSION", "{$VERSION}");
define("AGENT_DECIDER_JOB_REV", "{$SVN_REV}");
define("AGENT_DECIDER_JOB_REV", "{$COMMIT_HASH}");
......@@ -24,8 +24,8 @@
*/
#include "delagent.h"
#ifdef SVN_REV_S
char BuildVersion[]="delagent build version: " VERSION_S " r(" SVN_REV_S ").\n";
#ifdef COMMIT_HASH_S
char BuildVersion[]="delagent build version: " VERSION_S " r(" COMMIT_HASH_S ").\n";
#else
char BuildVersion[]="delagent build version: NULL.\n";
#endif
......@@ -79,7 +79,7 @@ int main (int argc, char *argv[])
char *agent_desc = "Deletes upload. Other list/delete options available from the command line.";
char *Parm = NULL;
//int Agent_pk = 0;
char *SVN_REV;
char *COMMIT_HASH;
char *VERSION;
char agent_rev[myBUFSIZ];
int option_index = 0;
......@@ -137,9 +137,9 @@ int main (int argc, char *argv[])
exit(-1);
}
SVN_REV = fo_sysconfig("delagent", "SVN_REV");
COMMIT_HASH = fo_sysconfig("delagent", "COMMIT_HASH");
VERSION = fo_sysconfig("delagent", "VERSION");
sprintf(agent_rev, "%s.%s", VERSION, SVN_REV);
sprintf(agent_rev, "%s.%s", VERSION, COMMIT_HASH);
/* Get the Agent Key from the DB */
fo_GetAgentKey(db_conn, basename(argv[0]), 0, agent_rev, agent_desc);
......
......@@ -33,8 +33,8 @@
#include "demomod.h"
#ifdef SVN_REV_S
char BuildVersion[]="demomod build version: " VERSION_S " r(" SVN_REV_S ").\n";
#ifdef COMMIT_HASH_S
char BuildVersion[]="demomod build version: " VERSION_S " r(" COMMIT_HASH_S ").\n";
#else
char BuildVersion[]="demomod build version: NULL.\n";
#endif
......@@ -54,7 +54,7 @@ int main(int argc, char **argv)
char sqlbuf[512];
int agent_pk = 0;
int user_pk = 0;
char *SVN_REV;
char *COMMIT_HASH;
char *VERSION;
char agent_rev[myBUFSIZ];
int upload_pk = 0;
......@@ -70,9 +70,9 @@ int main(int argc, char **argv)
/* get agent pk
* Note, if GetAgentKey fails, this process will exit.
*/
SVN_REV = fo_sysconfig("demomod", "SVN_REV");
COMMIT_HASH = fo_sysconfig("demomod", "COMMIT_HASH");
VERSION = fo_sysconfig("demomod", "VERSION");
snprintf(agent_rev, sizeof(agent_rev), "%s.%s", VERSION, SVN_REV);
snprintf(agent_rev, sizeof(agent_rev), "%s.%s", VERSION, COMMIT_HASH);
agent_pk = fo_GetAgentKey(pgConn, basename(argv[0]), Unused, agent_rev, agentDesc);
/* command line options */
......
......@@ -36,8 +36,8 @@
#include "libfossology.h"
#ifdef SVN_REV
char BuildVersion[]="Build version: " SVN_REV ".\n";
#ifdef COMMIT_HASH
char BuildVersion[]="Build version: " COMMIT_HASH ".\n";
#endif
#define MAXCMD 2048
......@@ -176,7 +176,7 @@ int main(int argc, char *argv[])
int pfile_count = 0;
int Agent_pk = 0;
int ars_pk = 0;
char *SVN_REV;
char *COMMIT_HASH;
char *VERSION;
char agent_rev[MAXCMD];
......@@ -218,9 +218,9 @@ int main(int argc, char *argv[])
exit(-1);
}
SVN_REV = fo_sysconfig("wc_agent", "SVN_REV");
COMMIT_HASH = fo_sysconfig("wc_agent", "COMMIT_HASH");
VERSION = fo_sysconfig("wc_agent", "VERSION");
sprintf(agent_rev, "%s.%s", VERSION, SVN_REV);
sprintf(agent_rev, "%s.%s", VERSION, COMMIT_HASH);
Agent_pk = fo_GetAgentKey(pgConn , basename(argv[0]), 0, agent_rev, agent_desc);
......
......@@ -38,8 +38,8 @@ along with this library; if not, write to the Free Software Foundation, Inc.0
#endif
#ifdef SVN_REV
char LibraryRepoBuildVersion[]="Library libfossrepo Build version: " SVN_REV ".\n";
#ifdef COMMIT_HASH
char LibraryRepoBuildVersion[]="Library libfossrepo Build version: " COMMIT_HASH ".\n";
#endif
#define MAXHOSTNAMELEN 64
......
......@@ -91,7 +91,7 @@ void fo_heartbeat()
/**
* @brief Checks that the agent is already in the agent table.
*
* This uses the VERSION and SVN_REV in the system configuration information to
* This uses the VERSION and COMMIT_HASH in the system configuration information to
* determine if a new agent record needs to be created for this agent in the
* database.
*/
......@@ -102,7 +102,7 @@ void fo_check_agentdb(PGconn* db_conn)
db_sql = g_strdup_printf(sql_check, module_name,
fo_config_get(sysconfig, module_name, "VERSION", NULL),
fo_config_get(sysconfig, module_name, "SVN_REV", NULL));
fo_config_get(sysconfig, module_name, "COMMIT_HASH", NULL));
db_result = PQexec(db_conn, db_sql);
if (PQresultStatus(db_result) != PGRES_TUPLES_OK)
{
......@@ -122,7 +122,7 @@ void fo_check_agentdb(PGconn* db_conn)
db_sql = g_strdup_printf(sql_insert, module_name,
fo_config_get(sysconfig, module_name, "VERSION", NULL),
fo_config_get(sysconfig, module_name, "SVN_REV", NULL),
fo_config_get(sysconfig, module_name, "COMMIT_HASH", NULL),
fo_config_get(sysconfig, module_name, "DESCRIPTION", NULL));
db_result = PQexec(db_conn, db_sql);
if (PQresultStatus(db_result) != PGRES_COMMAND_OK)
......
......@@ -24,8 +24,8 @@ stdout = data from file.
#include <stdio.h>
#include "libfossrepo.h"
#ifdef SVN_REV
char BuildVersion[]="Build version: " SVN_REV ".\n";
#ifdef COMMIT_HASH
char BuildVersion[]="Build version: " COMMIT_HASH ".\n";
#endif
int main(int argc, char* argv[])
......
......@@ -28,8 +28,8 @@ stdin can be pairs of files, or xml.
#include <ctype.h>
#include "libfossrepo.h"
#ifdef SVN_REV
char BuildVersion[]="Build version: " SVN_REV ".\n";
#ifdef COMMIT_HASH
char BuildVersion[]="Build version: " COMMIT_HASH ".\n";
#endif
/*** GLOBALS (for stats ***/
......
......@@ -24,8 +24,8 @@ Returns: 0=exist, 1=not exist
#include <stdio.h>
#include "libfossrepo.h"
#ifdef SVN_REV
char BuildVersion[]="Build version: " SVN_REV ".\n";
#ifdef COMMIT_HASH
char BuildVersion[]="Build version: " COMMIT_HASH ".\n";
#endif
int main(int argc, char* argv[])
......
......@@ -21,8 +21,8 @@ along with this library; if not, write to the Free Software Foundation, Inc.0
#include <stdio.h>
#include "libfossrepo.h"
#ifdef SVN_REV
char BuildVersion[]="Build version: " SVN_REV ".\n";
#ifdef COMMIT_HASH
char BuildVersion[]="Build version: " COMMIT_HASH ".\n";
#endif
int main(int argc, char* argv[])
......
......@@ -21,8 +21,8 @@ along with this library; if not, write to the Free Software Foundation, Inc.0
#include <stdio.h>
#include "libfossrepo.h"
#ifdef SVN_REV
char BuildVersion[]="Build version: " SVN_REV ".\n";
#ifdef COMMIT_HASH
char BuildVersion[]="Build version: " COMMIT_HASH ".\n";
#endif
int main(int argc, char* argv[])
......
......@@ -21,8 +21,8 @@ along with this library; if not, write to the Free Software Foundation, Inc.0
#include <stdio.h>
#include "libfossology.h"
#ifdef SVN_REV
char BuildVersion[]="Build version: " SVN_REV ".\n";
#ifdef COMMIT_HASH
char BuildVersion[]="Build version: " COMMIT_HASH ".\n";
#endif
int main(int argc, char* argv[])
......
......@@ -21,8 +21,8 @@ along with this library; if not, write to the Free Software Foundation, Inc.0
#include <stdio.h>
#include "libfossrepo.h"
#ifdef SVN_REV
char BuildVersion[]="Build version: " SVN_REV ".\n";
#ifdef COMMIT_HASH
char BuildVersion[]="Build version: " COMMIT_HASH ".\n";
#endif
int main(int argc, char* argv[])
......
......@@ -24,8 +24,8 @@ stdin = data to write.
#include <stdio.h>
#include "libfossrepo.h"
#ifdef SVN_REV
char BuildVersion[]="Build version: " SVN_REV ".\n";
#ifdef COMMIT_HASH
char BuildVersion[]="Build version: " COMMIT_HASH ".\n";
#endif
int main(int argc, char* argv[])
......
......@@ -31,8 +31,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
/* cunit includes */
#include <libfocunit.h>
#ifndef SVN_REV
#define SVN_REV "SVN_REV Unknown"
#ifndef COMMIT_HASH
#define COMMIT_HASH "COMMIT_HASH Unknown"
#endif
/* ************************************************************************** */
......@@ -148,7 +148,7 @@ void signal_connect_version()
FO_ASSERT_FALSE(valid);
FO_ASSERT_PTR_NOT_NULL(fgets(buffer, sizeof(buffer), read_from));
buffer[strlen(buffer) - 1] = '\0';
FO_ASSERT_STRING_EQUAL(buffer, SVN_REV);
FO_ASSERT_STRING_EQUAL(buffer, COMMIT_HASH);
write_con("CLOSE\n");
}
......@@ -209,7 +209,7 @@ void test_scheduler_connect()
memset(buffer, '\0', sizeof(buffer));
tmp = fgets(buffer, sizeof(buffer), read_from);
FO_ASSERT_PTR_NOT_NULL(tmp);
FO_ASSERT_STRING_EQUAL(buffer, SVN_REV);
FO_ASSERT_STRING_EQUAL(buffer, COMMIT_HASH);
tmp = fgets(buffer, sizeof(buffer), read_from);
FO_ASSERT_PTR_NOT_NULL(tmp);
......
......@@ -31,8 +31,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
/* cunit includes */
#include <CUnit/CUnit.h>
#ifndef SVN_REV
#define SVN_REV "SVN_REV Unknown"
#ifndef COMMIT_HASH
#define COMMIT_HASH "COMMIT_HASH Unknown"
#endif
extern char* dbConf;
......
......@@ -380,7 +380,7 @@ abstract class DefaultPlugin implements Plugin
$vars['versionInfo'] = array(
'version' => $SysConf['BUILD']['VERSION'],
'buildDate' => $SysConf['BUILD']['BUILD_DATE'],
'commitHash' => $SysConf['BUILD']['COMMIT'],
'commitHash' => $SysConf['BUILD']['COMMIT_HASH'],
'commitDate' => $SysConf['BUILD']['COMMIT_DATE']
);
}
......
......@@ -360,7 +360,7 @@ class FO_Plugin implements Plugin
$this->vars['versionInfo'] = array(
'version' => $SysConf['BUILD']['VERSION'],
'buildDate' => $SysConf['BUILD']['BUILD_DATE'],
'commitHash' => $SysConf['BUILD']['COMMIT'],
'commitHash' => $SysConf['BUILD']['COMMIT_HASH'],
'commitDate' => $SysConf['BUILD']['COMMIT_DATE']
);
......
......@@ -283,7 +283,7 @@ class Menu extends Object
$vars['versionInfo'] = array(
'version' => $SysConf['BUILD']['VERSION'],
'buildDate' => $SysConf['BUILD']['BUILD_DATE'],
'commitHash' => $SysConf['BUILD']['COMMIT'],
'commitHash' => $SysConf['BUILD']['COMMIT_HASH'],
'commitDate' => $SysConf['BUILD']['COMMIT_DATE']
);
}
......
......@@ -57,7 +57,7 @@ define("CONFIG_TYPE_TEXTAREA", 3);
* For example:
* - $SysConf[SYSCONFIG][LogoLink] => "http://my/logo.gif"
* - $SysConf[DIRECTORIES][MODDIR] => "/mymoduledir/
* - $SysConf[VERSION][SVN_REV] => "4467M"
* - $SysConf[VERSION][COMMIT_HASH] => "4467M"
*
* \Note Since so many files expect directory paths that used to be in pathinclude.php
* to be global, this function will define the same globals (everything in the
......
[VERSION]
VERSION=2.0.0
SVN_REV=4876M
COMMIT_HASH=4876M
BUILD_DATE=2011/10/25
......@@ -29,8 +29,8 @@
#include "maintagent.h"
#ifdef SVN_REV_S
char BuildVersion[]="maintagent build version: " VERSION_S " r(" SVN_REV_S ").\n";
#ifdef COMMIT_HASH_S
char BuildVersion[]="maintagent build version: " VERSION_S " r(" COMMIT_HASH_S ").\n";
#else
char BuildVersion[]="maintagent build version: NULL.\n";
#endif
......@@ -43,7 +43,7 @@ PGconn *pgConn = 0; // database connection
int main(int argc, char **argv)
{
int cmdopt;
char *SVN_REV;
char *COMMIT_HASH;
char *VERSION;
char agent_rev[myBUFSIZ];
......@@ -53,9 +53,9 @@ int main(int argc, char **argv)
/* get agent pk
* Note, if GetAgentKey fails, this process will exit.
*/
SVN_REV = fo_sysconfig("maintagent", "SVN_REV");
COMMIT_HASH = fo_sysconfig("maintagent", "COMMIT_HASH");
VERSION = fo_sysconfig("maintagent", "VERSION");
snprintf(agent_rev, sizeof(agent_rev), "%s.%s", VERSION, SVN_REV);
snprintf(agent_rev, sizeof(agent_rev), "%s.%s", VERSION, COMMIT_HASH);
int ValidateFoldersExe = 0;
int VerifyFilePermsExe = 0;
......
......@@ -38,8 +38,8 @@
#include "finder.h"
#ifdef SVN_REV_S
char BuildVersion[]="mimetype build version: " VERSION_S " r(" SVN_REV_S ").\n";
#ifdef COMMIT_HASH_S
char BuildVersion[]="mimetype build version: " VERSION_S " r(" COMMIT_HASH_S ").\n";
#else
char BuildVersion[]="mimetype build version: NULL.\n";
#endif
......@@ -68,7 +68,7 @@ int main(int argc, char *argv[])
PGresult *result;
char sqlbuf[1024];
int CmdlineFlag = 0; /** run from command line flag, 1 yes, 0 not */
char *SVN_REV;
char *COMMIT_HASH;
char *VERSION;
char agent_rev[MAXCMD];
......@@ -103,9 +103,9 @@ int main(int argc, char *argv[])
}
}
SVN_REV = fo_sysconfig("mimetype", "SVN_REV");
COMMIT_HASH = fo_sysconfig("mimetype", "COMMIT_HASH");
VERSION = fo_sysconfig("mimetype", "VERSION");
sprintf(agent_rev, "%s.%s", VERSION, SVN_REV);
sprintf(agent_rev, "%s.%s", VERSION, COMMIT_HASH);
/* Get the Agent Key from the DB */
Agent_pk = fo_GetAgentKey(pgConn, basename(argv[0]), 0, agent_rev, agent_desc);
......
......@@ -47,8 +47,8 @@ int parseArguments(MonkState* state, int argc, char** argv, int* fileOptInd)
state->verbosity++;
break;
case 'V':
#ifdef SVN_REV_S
printf(AGENT_NAME " version " VERSION_S " r(" SVN_REV_S ")\n");
#ifdef COMMIT_HASH_S
printf(AGENT_NAME " version " VERSION_S " r(" COMMIT_HASH_S ")\n");
#else
printf(AGENT_NAME " (no version available)\n");
#endif
......
......@@ -32,9 +32,9 @@ void bail(MonkState* state, int exitval) {
}
void queryAgentId(MonkState* state, const char* agentName, const char* agentDesc) {
char* svnRev = fo_sysconfig(agentName, "SVN_REV");
char* commitHash = fo_sysconfig(agentName, "COMMIT_HASH");
char* version = fo_sysconfig(agentName, "VERSION");
gchar* agentRevision = g_strdup_printf("%s.%s", version, svnRev);
gchar* agentRevision = g_strdup_printf("%s.%s", version, commitHash);
int agentId = fo_GetAgentKey(fo_dbManager_getWrappedConnection(state->dbManager),
agentName, 0, agentRevision, agentDesc);
......
......@@ -29,11 +29,11 @@ State getState(DbManager& dbManager)
int queryAgentId(DbManager& dbManager)
{
char* SVN_REV = fo_sysconfig(AGENT_NAME, "SVN_REV");
char* COMMIT_HASH = fo_sysconfig(AGENT_NAME, "COMMIT_HASH");
char* VERSION = fo_sysconfig(AGENT_NAME, "VERSION");
char* agentRevision;
if (!asprintf(&agentRevision, "%s.%s", VERSION, SVN_REV))
if (!asprintf(&agentRevision, "%s.%s", VERSION, COMMIT_HASH))
bail(-1);
int agentId = fo_GetAgentKey(dbManager.getConnection(), AGENT_NAME, 0, agentRevision, AGENT_DESC);
......
......@@ -73,7 +73,7 @@ Questions
---------
- Where the hell is checkstrings script? Do we want it?
- SVN_REV #ifdef stolen from other agent code. Where does this get
- COMMIT_HASH #ifdef stolen from other agent code. Where does this get
#defined?
- Why does nomos set the LANG environment variable?
- Implications of removing custom magic file?
......
......@@ -42,8 +42,8 @@ int Verbose = 0;
#define FUNCTION
#ifdef SVN_REV_S
char BuildVersion[]="nomos build version: " VERSION_S " r(" SVN_REV_S ").\n";
#ifdef COMMIT_HASH_S
char BuildVersion[]="nomos build version: " VERSION_S " r(" COMMIT_HASH_S ").\n";
#else
char BuildVersion[] = "nomos build version: NULL.\n";
#endif
......@@ -267,7 +267,7 @@ int main(int argc, char **argv)
char sErrorBuf[1024];
char *agent_desc = "License Scanner";
char **files_to_be_scanned; /**< The list of files to scan */
char *SVN_REV = NULL;
char *COMMIT_HASH = NULL;
char *VERSION = NULL;
char agent_rev[myBUFSIZ];
cacheroot_t cacheroot;
......@@ -291,9 +291,9 @@ int main(int argc, char **argv)
files_to_be_scanned = calloc(argc, sizeof(char *));
SVN_REV = fo_sysconfig("nomos", "SVN_REV");
COMMIT_HASH = fo_sysconfig("nomos", "COMMIT_HASH");
VERSION = fo_sysconfig("nomos", "VERSION");
sprintf(agent_rev, "%s.%s", VERSION, SVN_REV);
sprintf(agent_rev, "%s.%s", VERSION, COMMIT_HASH);
gl.agentPk = fo_GetAgentKey(gl.pgConn, basename(argv[0]), 0, agent_rev, agent_desc);
......
......@@ -30,8 +30,8 @@
*/
#include "pkgagent.h"
#ifdef SVN_REV_S
char BuildVersion[]="pkgagent build version: " VERSION_S " r(" SVN_REV_S ").\n";
#ifdef COMMIT_HASH_S
char BuildVersion[]="pkgagent build version: " VERSION_S " r(" COMMIT_HASH_S ").\n";
#else
char BuildVersion[]="pkgagent build version: NULL.\n";
#endif
......@@ -84,7 +84,7 @@ int main (int argc, char *argv[])
int rv;
PGresult *ars_result;
char sqlbuf[1024];
char *SVN_REV;
char *COMMIT_HASH;
char *VERSION;
char agent_rev[MAXCMD];
int CmdlineFlag = 0; /* run from command line flag, 1 yes, 0 not */
......@@ -94,9 +94,9 @@ int main (int argc, char *argv[])
//glb_rpmpi = (struct rpmpkginfo *)malloc(sizeof(struct rpmpkginfo));
//glb_debpi = (struct debpkginfo *)malloc(sizeof(struct debpkginfo));
SVN_REV = fo_sysconfig("pkgagent", "SVN_REV");
COMMIT_HASH = fo_sysconfig("pkgagent", "COMMIT_HASH");
VERSION = fo_sysconfig("pkgagent", "VERSION");
sprintf(agent_rev, "%s.%s", VERSION, SVN_REV);
sprintf(agent_rev, "%s.%s", VERSION, COMMIT_HASH);
Agent_pk = fo_GetAgentKey(db_conn, basename(argv[0]), 0, agent_rev, agent_desc);
/* Process command-line */
......
<?php
define("AGENT_VERSION", "{$VERSION}");
define("AGENT_REV", "{$SVN_REV}");
define("AGENT_REV", "{$COMMIT_HASH}");
......@@ -42,8 +42,8 @@ char SQL[256];
#define myBUFSIZ 2048
/*
#ifdef SVN_REV
char BuildVersion[]="Build version: " SVN_REV ".\n";
#ifdef COMMIT_HASH
char BuildVersion[]="Build version: " COMMIT_HASH ".\n";
#endif
*/
......@@ -66,7 +66,7 @@ int main (int argc, char *argv[])
{
int c;
char *SVN_REV;
char *COMMIT_HASH;
char *VERSION;
char agent_rev[myBUFSIZ];
......@@ -76,11 +76,11 @@ int main (int argc, char *argv[])
/*
Version reporting.
*/
SVN_REV = fo_sysconfig("regexscan", "SVN_REV");
COMMIT_HASH = fo_sysconfig("regexscan", "COMMIT_HASH");
VERSION = fo_sysconfig("regexscan", "VERSION");
sprintf(agent_rev, "%s.%s", VERSION, SVN_REV);
sprintf(agent_rev, "%s.%s", VERSION, COMMIT_HASH);
fprintf(stdout, "regexscan reports version info as '%s.%s'.\n", VERSION, SVN_REV);
fprintf(stdout, "regexscan reports version info as '%s.%s'.\n", VERSION, COMMIT_HASH);
/* Process command-line */
while((c = getopt(argc,argv,"civ")) != -1)
......
......@@ -47,8 +47,8 @@ char SQL[256];
#define myBUFSIZ 2048
/*
#ifdef SVN_REV
char BuildVersion[]="Build version: " SVN_REV ".\n";
#ifdef COMMIT_HASH
char BuildVersion[]="Build version: " COMMIT_HASH ".\n";
#endif
*/
......@@ -149,7 +149,7 @@ int main (int argc, char *argv[])
int user_pk;
long UploadPK=-1;
char *SVN_REV;
char *COMMIT_HASH;
char *VERSION;
char agent_rev[myBUFSIZ];
......@@ -159,11 +159,11 @@ int main (int argc, char *argv[])
/*
Version reporting.
*/
SVN_REV = fo_sysconfig("regexscan", "SVN_REV");
COMMIT_HASH = fo_sysconfig("regexscan", "COMMIT_HASH");
VERSION = fo_sysconfig("regexscan", "VERSION");
sprintf(agent_rev, "%s.%s", VERSION, SVN_REV);
sprintf(agent_rev, "%s.%s", VERSION, COMMIT_HASH);
#ifdef REGEX_DEBUG
fprintf(stdout, "regexscan reports version info as '%s.%s'.\n", VERSION, SVN_REV);
fprintf(stdout, "regexscan reports version info as '%s.%s'.\n", VERSION, COMMIT_HASH);
#endif
/* Process command-line */
......
......@@ -53,8 +53,8 @@ char SQL[256];
#define myBUFSIZ 2048
/*
#ifdef SVN_REV
char BuildVersion[]="Build version: " SVN_REV ".\n";
#ifdef COMMIT_HASH
char BuildVersion[]="Build version: " COMMIT_HASH ".\n";
#endif
*/
......@@ -311,7 +311,7 @@ int main (int argc, char *argv[])
int user_pk;
long UploadPK=-1;
char *SVN_REV;