[23704] | 1 |
|
---|
| 2 | BEGIN {
|
---|
| 3 | die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
|
---|
| 4 | die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'};
|
---|
| 5 | unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
|
---|
| 6 | unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan");
|
---|
| 7 | }
|
---|
| 8 |
|
---|
| 9 | use Cwd;
|
---|
| 10 | require util;
|
---|
| 11 |
|
---|
| 12 | my $env_ext = "GEXT_OPENOFFICE";
|
---|
| 13 | my $ext_desc = "the Open Office Extension";
|
---|
| 14 |
|
---|
| 15 | if (!defined $ENV{$env_ext}) {
|
---|
| 16 |
|
---|
| 17 | my $ext_home = cwd();
|
---|
| 18 | $ENV{$env_ext} = $ext_home;
|
---|
| 19 |
|
---|
| 20 | my $ext_bin_script = &util::filename_cat($ENV{$env_ext},"bin","script");
|
---|
| 21 | if (-d $ext_bin_script) {
|
---|
| 22 | &util::envvar_prepend("PATH",$ext_bin_script);
|
---|
| 23 | }
|
---|
| 24 |
|
---|
[23709] | 25 | if ($ENV{'GSDLOS'} =~ m/windows/i) {
|
---|
| 26 | $ENV{'GS_CP_SET'} = "yes";
|
---|
| 27 | }
|
---|
| 28 |
|
---|
[23704] | 29 | my ($ext_dir,$_prefix_dir) = File::Basename::fileparse($ext_home);
|
---|
| 30 | # GSDLEXTS always uses : as a separator
|
---|
| 31 | if (defined $ENV{'GSDLEXTS'}) {
|
---|
| 32 | $ENV{'GSDLEXTS'} .= ":$ext_dir";
|
---|
| 33 | }
|
---|
| 34 | else {
|
---|
| 35 | $ENV{'GSDLEXTS'} = $ext_dir;
|
---|
| 36 | }
|
---|
| 37 |
|
---|
| 38 | print STDERR "+Your environment is now setup for $ext_desc\n";
|
---|
| 39 | }
|
---|
| 40 | else {
|
---|
| 41 | print STDERR "+Your environment is already setup for $ext_desc\n";
|
---|
| 42 | }
|
---|
| 43 |
|
---|
| 44 | if (scalar(@ARGV>0)) {
|
---|
| 45 |
|
---|
| 46 | print STDERR "\n";
|
---|
| 47 |
|
---|
| 48 | my $cmd = join(" ",map {$_ = "\"$_\""} @ARGV);
|
---|
| 49 |
|
---|
| 50 | if (system($cmd)!=0) {
|
---|
| 51 | print STDERR "\nError: Failed to run '$cmd'\n";
|
---|
| 52 | print STDERR "$!\n";
|
---|
| 53 | }
|
---|
| 54 | }
|
---|
| 55 |
|
---|
| 56 | 1;
|
---|