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

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

Lots of modifs to find the right way. Probably still not good

  • Property svn:executable set to *
File size: 950 bytes
RevLine 
[2]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
16my @args = ("svn", "info", "2>&1", "/dev/null");
17my $ret;
18system(@args) == 0 or die "system @args failed: $?";
19if ($? == -1) {
20 print "failed to execute: $!\n";
21} elsif ($? & 127) {
22 printf "child died with signal %d, %s coredump\n", ($? & 127), ($? & 128) ? 'with' : 'without';
23} else {
24 $ret = $? >> 8;
25 if ($ret == 0) {
[5]26 $ENV{'REVISION'}=`(cd $PBROOT/.. ; svnversion .)`;
[2]27 $ENV{'CMSLOG'}="svn log";
28 $ENV{'CMSEXP'}="svn export";
29 } else {
30 # By default if not SVN take CVS
[5]31 $ENV{'REVISION'}=`(cd $PBROOT/.. ; cvs rannotate -f . 2>&1 | awk '{print $1}' | grep -E '^[0-9]' | cut -d. -f2 |sort -nu | tail -1)`;
[2]32 $ENV{'CMSLOG'}="cvs log";
33 $ENV{'CMSEXP'}="cvs export"
34 $ENV{'CVSROOT'}=$ENV{'CVSVAR'};
35 }
36}
371;
Note: See TracBrowser for help on using the repository browser.