IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 17, 2009, 12:07:42 PM (17 years ago)
Author:
beaumont
Message:

merged with head

Location:
branches/cnb_branches/cnb_branch_20090301/psModules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301/psModules

  • branches/cnb_branches/cnb_branch_20090301/psModules/src/config/pmVersion.c

    r10291 r23351  
    88#include "pmVersion.h"
    99
    10 static const char *cvsTag = "$Name: not supported by cvs2svn $";// CVS tag name
     10#ifndef PSMODULES_VERSION
     11#error "PSMODULES_VERSION is not set"
     12#endif
     13#ifndef PSMODULES_BRANCH
     14#error "PSMODULES_BRANCH is not set"
     15#endif
     16#ifndef PSMODULES_SOURCE
     17#error "PSMODULES_SOURCE is not set"
     18#endif
     19
     20#define xstr(s) str(s)
     21#define str(s) #s
    1122
    1223psString psModulesVersion(void)
    1324{
    14     psString version = NULL;            // Version, to return
    15     psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION);
    16     return version;
     25    char *value = NULL;
     26    psStringAppend(&value, "%s@%s", xstr(PSMODULES_BRANCH), xstr(PSMODULES_VERSION));
     27    return value;
    1728}
     29
     30psString psModulesSource(void)
     31{
     32    return psStringCopy(xstr(PSMODULES_SOURCE));
     33}
     34
    1835
    1936psString psModulesVersionLong(void)
    2037{
    21     psString version = psModulesVersion(); // Version, to return
    22     psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag
     38    psString version = psModulesVersion();  // Version, to return
     39    psString source = psModulesSource();    // Source
    2340
    24     psStringAppend(&version, " (cvs tag %s) %s, %s", tag, __DATE__, __TIME__);
     41    psStringPrepend(&version, "psModules ");
     42    psStringAppend(&version, " from %s, built %s, %s", source, __DATE__, __TIME__);
     43    psFree(source);
    2544
    26     psFree(tag);
     45#ifdef __OPTIMIZE__
     46    psStringAppend(&version, " optimised");
     47#else
     48    psStringAppend(&version, " unoptimised");
     49#endif
     50
     51#ifdef HAVE_NEBCLIENT
     52    psStringAppend(&version, " with nebclient");
     53#else
     54    psStringAppend(&version, " without nebclient");
     55#endif
     56
    2757    return version;
     58};
     59
     60
     61bool psModulesVersionHeader(psMetadata *header)
     62{
     63    PS_ASSERT_METADATA_NON_NULL(header, false);
     64
     65    psString version = psModulesVersion(); // Software version
     66    psString source = psModulesSource();   // Software source
     67
     68    psStringPrepend(&version, "psModules version: ");
     69    psStringPrepend(&source, "psModules source: ");
     70
     71    psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, version);
     72    psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, source);
     73
     74    psFree(version);
     75    psFree(source);
     76
     77    return true;
    2878}
Note: See TracChangeset for help on using the changeset viewer.