|
Last change
on this file since 16 was 9, checked in by Bruno Cornec, 19 years ago |
|
cms2build begins to export
|
-
Property svn:executable
set to
*
|
|
File size:
1.0 KB
|
| 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 .)`;
|
|---|
| [9] | 29 | chomp($ENV{'PBREVISION'});
|
|---|
| [8] | 30 | $ENV{'PBCMSLOG'}="svn log";
|
|---|
| [9] | 31 | $ENV{'PBCMSLOGFILE'}="svn.log";
|
|---|
| [8] | 32 | $ENV{'PBCMSEXP'}="svn export";
|
|---|
| [2] | 33 | } else {
|
|---|
| 34 | # By default if not SVN take CVS
|
|---|
| [8] | 35 | $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] | 36 | chomp($ENV{'PBREVISION'});
|
|---|
| [8] | 37 | $ENV{'PBCMSLOG'}="cvs log";
|
|---|
| [9] | 38 | $ENV{'PBCMSLOGFILE'}="cvs.log";
|
|---|
| [8] | 39 | $ENV{'PBCMSEXP'}="cvs export"
|
|---|
| [2] | 40 | }
|
|---|
| 41 | }
|
|---|
| [6] | 42 | }
|
|---|
| [2] | 43 | 1;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.