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

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

Try to better organize the tree to be perl compliant

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