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

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

Ok seems better interm of organization with AppConfig usage

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