|
Last change
on this file since 2 was 2, checked in by Bruno Cornec, 19 years ago |
|
Initial check in coming from mondorescue project rewritten partially in perl
|
-
Property svn:executable
set to
*
|
|
File size:
458 bytes
|
| Rev | Line | |
|---|
| [2] | 1 | #!/usr/bin/perl -w
|
|---|
| 2 | #
|
|---|
| 3 | # Module to compute TOOLHOME and put in the environment
|
|---|
| 4 | #
|
|---|
| 5 | # $Id$
|
|---|
| 6 | #
|
|---|
| 7 | require Exporter;
|
|---|
| 8 | @ISA = qw(Exporter);
|
|---|
| 9 | @EXPORT = qw(set_toolhome);
|
|---|
| 10 |
|
|---|
| 11 | use strict;
|
|---|
| 12 | use File::Basename;
|
|---|
| 13 |
|
|---|
| 14 | sub set_toolhome {
|
|---|
| 15 |
|
|---|
| 16 | my $tmp = dirname($PROGRAM_NAME);
|
|---|
| 17 | #print "$tmp\n";
|
|---|
| 18 | if ($tmp =~ /^\//) {
|
|---|
| 19 | $ENV{'TOOLHOME'} = $tmp;
|
|---|
| 20 | }
|
|---|
| 21 | else {
|
|---|
| 22 | $ENV{'TOOLHOME'} = "$ENV{PWD}/$tmp";
|
|---|
| 23 | }
|
|---|
| 24 |
|
|---|
| 25 | die "TOOLHOME doesn't exist" if (not (defined $ENV{'TOOLHOME'}));
|
|---|
| 26 | }
|
|---|
| 27 | 1;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.