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
RevLine 
[2]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
[6]12sub cms_init {
13
[2]14my $ret;
[6]15
[8]16system("cd $ENV{'PBROOT'} ; svn info . 2>&1 > /dev/null");
[2]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) {
[8]24 $ENV{'PBREVISION'}=`(cd "$ENV{'PBROOT'}" ; svnversion .)`;
[9]25 chomp($ENV{'PBREVISION'});
[8]26 $ENV{'PBCMSLOG'}="svn log";
[9]27 $ENV{'PBCMSLOGFILE'}="svn.log";
[8]28 $ENV{'PBCMSEXP'}="svn export";
[2]29 } else {
30 # By default if not SVN take CVS
[8]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)`;
[9]32 chomp($ENV{'PBREVISION'});
[8]33 $ENV{'PBCMSLOG'}="cvs log";
[9]34 $ENV{'PBCMSLOGFILE'}="cvs.log";
[8]35 $ENV{'PBCMSEXP'}="cvs export"
[2]36 }
37}
[6]38}
[2]391;
Note: See TracBrowser for help on using the repository browser.