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

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

Basic function works (conf file read and interpret)

  • Property svn:executable set to *
File size: 916 bytes
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 $ENV{'PBCMSLOG'}="svn log";
30 $ENV{'PBCMSEXP'}="svn export";
31 } else {
32 # By default if not SVN take CVS
33 $ENV{'PBREVISION'}=`(cd "$ENV{'PBROOT'}" ; cvs rannotate -f . 2>&1 | awk '{print \$1}' | grep -E '^[0-9]' | cut -d. -f2 |sort -nu | tail -1)`;
34 $ENV{'PBCMSLOG'}="cvs log";
35 $ENV{'PBCMSEXP'}="cvs export"
36 }
37}
38}
391;
Note: See TracBrowser for help on using the repository browser.