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
|
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 |
|
---|
| 20 | chdir "$ENV{'PBROOT'}";
|
---|
| 21 | system("svn info 2>&1 /dev/null") == 0 or die "system svn info failed: $?";
|
---|
[2] | 22 | if ($? == -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) {
|
---|
[6] | 29 | $ENV{'REVISION'}=`(cd "$ENV{'PBROOT'}/.." ; svnversion .)`;
|
---|
[2] | 30 | $ENV{'CMSLOG'}="svn log";
|
---|
| 31 | $ENV{'CMSEXP'}="svn export";
|
---|
| 32 | } else {
|
---|
| 33 | # By default if not SVN take CVS
|
---|
[6] | 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)`;
|
---|
[2] | 35 | $ENV{'CMSLOG'}="cvs log";
|
---|
| 36 | $ENV{'CMSEXP'}="cvs export"
|
---|
| 37 | }
|
---|
| 38 | }
|
---|
[6] | 39 | }
|
---|
[2] | 40 | 1;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.