Subversion Repositories DevTools

Rev

Rev 7322 | Rev 7324 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7322 Rev 7323
Line 351... Line 351...
351
unless ( $GBE_MACHTYPE )
351
unless ( $GBE_MACHTYPE )
352
{
352
{
353
    $GBE_MACHTYPE = 'win32' if ( $^O eq "cygwin" );
353
    $GBE_MACHTYPE = 'win32' if ( $^O eq "cygwin" );
354
    $GBE_MACHTYPE = 'win32' if ( $^O eq "MSWin32" );
354
    $GBE_MACHTYPE = 'win32' if ( $^O eq "MSWin32" );
355
    $GBE_MACHTYPE = 'win32' if ( $^O eq "win95" );
355
    $GBE_MACHTYPE = 'win32' if ( $^O eq "win95" );
-
 
356
    $GBE_HOSTMACH = $GBE_MACHTYPE;
356
    Verbose ("Setting GBE_MACHTYPE: $GBE_MACHTYPE") ;
357
    Verbose ("Setting GBE_MACHTYPE: $GBE_MACHTYPE") ;
357
}
358
}
358
 
359
 
359
ReportError ('Set env-var GBE_MACHTYPE (typically "win32")') unless ( $GBE_MACHTYPE );
360
ReportError ('Set env-var GBE_MACHTYPE (typically "win32")') unless ( $GBE_MACHTYPE );
360
ErrorDoExit();
361
ErrorDoExit();
361
 
362
 
362
if ( $GBE_MACHTYPE eq 'win32' )
363
if ( $GBE_HOSTMACH eq 'win32' )
363
{
364
{
364
    $PSPLIT = ';';
365
    $PSPLIT = ';';
365
    $GBE_UNIX = 0;
366
    $GBE_UNIX = 0;
366
}
367
}
367
 
368
 
Line 372... Line 373...
372
#   scripts from any other drive
373
#   scripts from any other drive
373
#
374
#
374
#   If GBE_CORE does not have a driver letter - then add one
375
#   If GBE_CORE does not have a driver letter - then add one
375
#   Note: Use the CWD before any CD operations
376
#   Note: Use the CWD before any CD operations
376
#
377
#
377
if ( $GBE_MACHTYPE eq 'win32'  && $GBE_CORE !~ m/^\w\:/ )
378
if ( $GBE_HOSTMACH eq 'win32'  && $GBE_CORE !~ m/^\w\:/ )
378
{
379
{
379
        my $cwd = getcwd();
380
        my $cwd = getcwd();
380
        $GBE_CORE = substr( $cwd, 0, 2 ) . '/' . $GBE_CORE;
381
        $GBE_CORE = substr( $cwd, 0, 2 ) . '/' . $GBE_CORE;
381
        $GBE_CORE =~ s~//~/~g;
382
        $GBE_CORE =~ s~//~/~g;
382
        Verbose2 ("Setting GBE_CORE drive: $GBE_CORE");
383
        Verbose2 ("Setting GBE_CORE drive: $GBE_CORE");
Line 429... Line 430...
429
                    {
430
                    {
430
                        local %ENV = %ENV;
431
                        local %ENV = %ENV;
431
 
432
 
432
                        $ENV{GBE_TOOLS} = "$GBE_CORE/TOOLS";
433
                        $ENV{GBE_TOOLS} = "$GBE_CORE/TOOLS";
433
                        $ENV{PERL5LIB} = "$GBE_CORE/TOOLS/LIB" ;
434
                        $ENV{PERL5LIB} = "$GBE_CORE/TOOLS/LIB" ;
434
                        $ENV{GBE_BIN}  = "$GBE_CORE/BIN.$GBE_MACHTYPE";
435
                        $ENV{GBE_BIN}  = "$GBE_CORE/BIN.$GBE_HOSTMACH";
435
                        $ENV{GBE_VERBOSE}  = $GBE_VERBOSE;
436
                        $ENV{GBE_VERBOSE}  = $GBE_VERBOSE;
436
 
437
 
437
                        etool ( 'cache_dpkg.pl', $package );
438
                        etool ( 'cache_dpkg.pl', $package );
438
                    }
439
                    }
439
                }
440
                }
Line 934... Line 935...
934
 
935
 
935
################################################################################
936
################################################################################
936
#   Setup the default JAVA_HOME
937
#   Setup the default JAVA_HOME
937
#   User should specify 1.4, 1.5,1.6 ....
938
#   User should specify 1.4, 1.5,1.6 ....
938
#
939
#
939
$JAVA_HOME = get_java_home ($opt_java)
940
$JAVA_HOME = get_java_home ($opt_java) if ( $opt_java );
940
    if ( $opt_java );
-
 
941
PathPrepend ("$JAVA_HOME/bin")
941
PathPrepend ("$JAVA_HOME/bin") if ( -d $JAVA_HOME );
942
    if ( -d $JAVA_HOME );
-
 
943
 
942
 
944
################################################################################
943
################################################################################
945
#   Setup GBE_VIEWBASE
944
#   Setup GBE_VIEWBASE
946
#   Ideally this should be configured externally
945
#   Ideally this should be configured externally
947
#
946
#
Line 974... Line 973...
974
#   versions.
973
#   versions.
975
#
974
#
976
PathPrepend ($GBE_BIN);
975
PathPrepend ($GBE_BIN);
977
 
976
 
978
################################################################################
977
################################################################################
-
 
978
# Under Windows - ensure that cmd.exe (or equivelent) is in the PATH
-
 
979
# Cygwin may remove it
-
 
980
# 
-
 
981
unless ( $GBE_JATS_SANE || $GBE_UNIX ) {
-
 
982
    if (exists $ENV{COMSPEC}) {
-
 
983
        $ENV{COMSPEC} =~ m~(.*)[\\/][^\\/]+~;
-
 
984
        $PATH = $PATH . $PSPLIT . $1;
-
 
985
    }
-
 
986
}
-
 
987
 
-
 
988
################################################################################
979
#   Clean PATH
989
#   Clean PATH
980
#       Remove duplicates
990
#       Remove duplicates
981
#       Remove empty elements
991
#       Remove empty elements
982
#       Clean path endings
992
#       Clean path endings
983
#       Place non-existent paths at the end. They will be seen, but not scanned
993
#       Place non-existent paths at the end. They will be seen, but not scanned
984
#
994
#
985
{
995
{
986
    my @new_path;
996
    my @new_path;
987
    my @non_exist;
997
    my @non_exist;
988
    my %seen;
998
    my %seen;
989
    foreach ( split $PSPLIT, $PATH )
999
    foreach ( split($PSPLIT, $PATH) )
990
    {
1000
    {
991
        s~[/\\]+$~~;                                # Remove trailing / or \
1001
        s~[/\\]+$~~;                                # Remove trailing / or \
992
        my $name = ( $GBE_UNIX ) ? $_ : lc ($_);    # Windows is case insensitive
1002
        my $name = ( $GBE_UNIX ) ? $_ : lc ($_);    # Windows is case insensitive
993
        next unless ( $_ );                         # Remove empty elements
1003
        next unless ( $_ );                         # Remove empty elements
994
        next if ( /^\.+$/ );                        # Remove . and ..
1004
        next if ( /^\.+$/ );                        # Remove . and ..