IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23203


Ignore:
Timestamp:
Mar 6, 2009, 10:27:11 AM (17 years ago)
Author:
eugene
Message:

setting svn info in evn vars

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/eam_branch_20090303/psconfig/psbuild

    r22740 r23203  
    1313$stop = "";
    1414$verbose = 0;
     15$use_svn = 1;
    1516
    1617$extlibs = "none";
     
    8384    if ($ARGV[0] eq "-bootstrap") {
    8485        &bootstrap ();
     86    }
     87    if ($ARGV[0] eq "-skip-svn") {
     88        $use_svn = 0;
     89        shift; next;
    8590    }
    8691    if ($ARGV[0] eq "-env") {
     
    157162sub build_distribution {
    158163
     164    # set environment variables used to supply SVN info to the compilation
     165
     166    if ($use_svn) {
     167        # example dump from svn info:
     168        # pikake: svn info
     169        # Path: .
     170        # URL: https://svn.pan-starrs.ifa.hawaii.edu/repo/ipp/branches/eam_branches/eam_branch_20090303/ppImage
     171        # Repository Root: https://svn.pan-starrs.ifa.hawaii.edu/repo/ipp
     172        # Repository UUID: 60eb6cdc-a59c-4636-a4e0-dba66a9721fd
     173        # Revision: 23158
     174        # Node Kind: directory
     175        # Schedule: normal
     176        # Last Changed Author: price
     177        # Last Changed Rev: 23125
     178        # Last Changed Date: 2009-03-03 15:41:16 -1000 (Tue, 03 Mar 2009)
     179       
     180        $svn_version = `svnversion`; chomp $svn_version;
     181        @svn_info = `svn info`;
     182
     183        # get the svn_root first:
     184        foreach $line (@svn_info) {
     185            if ($line =~ m|^Repository Root:|) {
     186                ($svn_root) = $line =~ m|^Repository Root:\s*(\S*)|;
     187                last;
     188            }
     189        }
     190
     191        # now get the branch and UUID values
     192        foreach $line (@svn_info) {
     193            if ($line =~ m|^URL:|) {
     194                ($svn_branch) = $line =~ m|^URL:\s*$svn_root/*(\S*)|;
     195            }
     196            if ($line =~ m|^Repository UUID:|) {
     197                ($svn_source) = $line =~ m|^Repository UUID:\s*(\S*)|;
     198            }
     199        }
     200       
     201        $ENV{SVN_VERSION} = $svn_version;
     202        $ENV{SVN_BRANCH}  = $svn_branch;
     203        $ENV{SVN_SOURCE}  = $svn_source;
     204    } else {
     205        # alternatively, grab these from the following files:
     206        if (! -e "SVNINFO") {
     207            print "missing SVNINFO file for repository info, skipping\n";
     208        } else {
     209            @svn_info = `cat SVNINFO`;
     210            foreach $line (@svn_info) {
     211                ($name, $value) = split (" ", $line);
     212                $ENV{$name} = $value;
     213            }
     214        }
     215    }
     216    print "SVN_VERSION $ENV{SVN_VERSION}\n";
     217    print "SVN_BRANCH  $ENV{SVN_BRANCH}\n";
     218    print "SVN_SOURCE  $ENV{SVN_SOURCE}\n";
     219
    159220    # use psconfig.csh to set needed build aliases
    160 
    161221    if ($extlibs eq "check") {
    162222        $status = vsystem ("pschecklibs");
Note: See TracChangeset for help on using the changeset viewer.