source: ProjectBuilder/devel/pb/lib/cms.pm@ 9

Last change on this file since 9 was 9, checked in by Bruno Cornec, 17 years ago

cms2build begins to export

  • Property svn:executable set to *
File size: 1.0 KB
Line 
1#!/usr/bin/perl -w
2#
3# Creates common environment for SVN/CVS repository
4#
5# $Id$
6#
7
8require Exporter;
9@ISA = qw(Exporter);
10@EXPORT = qw(get_toolhome);
11
12use strict;
13
14# Expects we are in the right directory to launch CMS commands
15
16sub cms_init {
17
18my $ret;
19
20system("cd $ENV{'PBROOT'} ; svn info . 2>&1 > /dev/null");
21if ($? == -1) {
22 print "failed to execute: $!\n";
23} elsif ($? & 127) {
24 printf "child died with signal %d, %s coredump\n", ($? & 127), ($? & 128) ? 'with' : 'without';
25} else {
26 $ret = $? >> 8;
27 if ($ret == 0) {
28 $ENV{'PBREVISION'}=`(cd "$ENV{'PBROOT'}" ; svnversion .)`;
29 chomp($ENV{'PBREVISION'});
30 $ENV{'PBCMSLOG'}="svn log";
31 $ENV{'PBCMSLOGFILE'}="svn.log";
32 $ENV{'PBCMSEXP'}="svn export";
33 } else {
34 # By default if not SVN take CVS
35 $ENV{'PBREVISION'}=`(cd "$ENV{'PBROOT'}" ; cvs rannotate -f . 2>&1 | awk '{print \$1}' | grep -E '^[0-9]' | cut -d. -f2 |sort -nu | tail -1)`;
36 chomp($ENV{'PBREVISION'});
37 $ENV{'PBCMSLOG'}="cvs log";
38 $ENV{'PBCMSLOGFILE'}="cvs.log";
39 $ENV{'PBCMSEXP'}="cvs export"
40 }
41}
42}
431;
Note: See TracBrowser for help on using the repository browser.