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
|
Rev | Line | |
---|
[2] | 1 | #!/usr/bin/perl -w
|
---|
| 2 | #
|
---|
| 3 | # Creates common environment for SVN/CVS repository
|
---|
| 4 | #
|
---|
| 5 | # $Id$
|
---|
| 6 | #
|
---|
| 7 |
|
---|
| 8 | require Exporter;
|
---|
| 9 | @ISA = qw(Exporter);
|
---|
| 10 | @EXPORT = qw(get_toolhome);
|
---|
| 11 |
|
---|
| 12 | use strict;
|
---|
| 13 |
|
---|
| 14 | # Expects we are in the right directory to launch CMS commands
|
---|
| 15 |
|
---|
[6] | 16 | sub cms_init {
|
---|
| 17 |
|
---|
[2] | 18 | my $ret;
|
---|
[6] | 19 |
|
---|
[8] | 20 | system("cd $ENV{'PBROOT'} ; svn info . 2>&1 > /dev/null");
|
---|
[2] | 21 | if ($? == -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) {
|
---|
[8] | 28 | $ENV{'PBREVISION'}=`(cd "$ENV{'PBROOT'}" ; svnversion .)`;
|
---|
| 29 | $ENV{'PBCMSLOG'}="svn log";
|
---|
| 30 | $ENV{'PBCMSEXP'}="svn export";
|
---|
[2] | 31 | } else {
|
---|
| 32 | # By default if not SVN take CVS
|
---|
[8] | 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"
|
---|
[2] | 36 | }
|
---|
| 37 | }
|
---|
[6] | 38 | }
|
---|
[2] | 39 | 1;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.