changed default from ship to install

This commit is contained in:
Dave Schuyler 2002-08-13 03:22:51 +00:00
parent 9f65686c35
commit 09442a6672

View File

@ -3,7 +3,7 @@ require "$tool/include/ctutils.pl" ;
$shell_type = "csh" ; $shell_type = "csh" ;
if ( $ENV{"SHELL_TYPE"} ne "" ) { if ( $ENV{"SHELL_TYPE"} ne "" ) {
if ( $ENV{"SHELL_TYPE"} eq "sh" ) { if ( $ENV{"SHELL_TYPE"} eq "sh" ) {
$shell_type = "sh" ; $shell_type = "sh" ;
} }
} }
@ -21,8 +21,8 @@ require "$tool/include/ctquery.pl" ;
# %newenv = variable marked to be set to value # %newenv = variable marked to be set to value
sub CTAttachSet { sub CTAttachSet {
if ( ( $_[0] ne "" ) && ( $_[1] ne "" ) ) { if ( ( $_[0] ne "" ) && ( $_[1] ne "" ) ) {
&CTUDebug( "setting " . $_[0] . " to '" . $_[1] . "'\n" ) ; &CTUDebug( "setting " . $_[0] . " to '" . $_[1] . "'\n" ) ;
$newenv{$_[0]} = $_[1] ; $newenv{$_[0]} = $_[1] ;
} }
} }
@ -36,8 +36,8 @@ sub CTAttachSet {
sub CTSpoolEnv { sub CTSpoolEnv {
local( $ret ) = $ENV{$_[0]} ; local( $ret ) = $ENV{$_[0]} ;
if ( $envsep{$_[0]} ne "" ) { if ( $envsep{$_[0]} ne "" ) {
local( @splitlist ) = split( $envsep{$_[0]}, $ret ); local( @splitlist ) = split( $envsep{$_[0]}, $ret );
$ret = join( " ", @splitlist ) ; $ret = join( " ", @splitlist ) ;
} }
$ret ; $ret ;
} }
@ -54,96 +54,96 @@ sub CTSpoolEnv {
sub CTAttachMod { sub CTAttachMod {
&CTUDebug( "in CTAttachMod\n" ) ; &CTUDebug( "in CTAttachMod\n" ) ;
if ( $_[0] eq "CTPROJS" ) { if ( $_[0] eq "CTPROJS" ) {
# as part of the system, this one is special # as part of the system, this one is special
&CTUDebug( "doing a mod on $CTPROJS\n" ) ; &CTUDebug( "doing a mod on $CTPROJS\n" ) ;
if ( $newenv{$_[0]} eq "" ) { if ( $newenv{$_[0]} eq "" ) {
$newenv{$_[0]} = $ENV{$_[0]} ; $newenv{$_[0]} = $ENV{$_[0]} ;
} }
local( $proj ) = $_[3] ; local( $proj ) = $_[3] ;
$proj =~ tr/A-Z/a-z/ ; $proj =~ tr/A-Z/a-z/ ;
local( $curflav ) = &CTQueryProj( $proj ) ; local( $curflav ) = &CTQueryProj( $proj ) ;
if ( $curflav ne "" ) { if ( $curflav ne "" ) {
local( $tmp ) = $_[3] . ":" . $curflav ; local( $tmp ) = $_[3] . ":" . $curflav ;
if ( $newenv{$_[0]} =~ /$tmp/ ) { if ( $newenv{$_[0]} =~ /$tmp/ ) {
local( $hold ) = $newenv{$_[0]} ; local( $hold ) = $newenv{$_[0]} ;
$hold =~ s/$tmp/$_[1]/ ; $hold =~ s/$tmp/$_[1]/ ;
&CTUDebug( "already attached to " . $_[3] . " changing '" . &CTUDebug( "already attached to " . $_[3] . " changing '" .
$tmp . "' to '" . $_[1] . "' yielding '" . $hold . $tmp . "' to '" . $_[1] . "' yielding '" . $hold .
"'\n" ) ; "'\n" ) ;
$newenv{$_[0]} = $hold ; $newenv{$_[0]} = $hold ;
} else { } else {
&CTUDebug( "prepending '" . $_[1] . "' to CTPROJS\n" ) ; &CTUDebug( "prepending '" . $_[1] . "' to CTPROJS\n" ) ;
$newenv{$_[0]} = $_[1] . " " . $newenv{$_[0]} ; $newenv{$_[0]} = $_[1] . " " . $newenv{$_[0]} ;
} }
} else { } else {
&CTUDebug( "writing '" . $_[1] . "' to CTPROJS\n" ) ; &CTUDebug( "writing '" . $_[1] . "' to CTPROJS\n" ) ;
if ( $newenv{$_[0]} eq "" ) { if ( $newenv{$_[0]} eq "" ) {
$newenv{$_[0]} = $_[1] ; $newenv{$_[0]} = $_[1] ;
} else { } else {
$newenv{$_[0]} = $_[1] . " " . $newenv{$_[0]} ; $newenv{$_[0]} = $_[1] . " " . $newenv{$_[0]} ;
} }
} }
} elsif ( ( $_[0] ne "" ) && ( $_[1] ne "" ) ) { } elsif ( ( $_[0] ne "" ) && ( $_[1] ne "" ) ) {
local( $dosimple ) = 0 ; local( $dosimple ) = 0 ;
if ( $newenv{$_[0]} eq "" ) { if ( $newenv{$_[0]} eq "" ) {
# not in our 'new' environment yet, add it. # not in our 'new' environment yet, add it.
# may still be empty # may still be empty
$newenv{$_[0]} = &CTSpoolEnv( $_[0] ) ; $newenv{$_[0]} = &CTSpoolEnv( $_[0] ) ;
} }
if ( ! ( $newenv{$_[0]} =~ /$_[1]/ )) { if ( ! ( $newenv{$_[0]} =~ /$_[1]/ )) {
&CTUDebug( "'" . $_[1] . "' exists in " . $_[0] . &CTUDebug( "'" . $_[1] . "' exists in " . $_[0] .
" testing for simple modification\n" ) ; " testing for simple modification\n" ) ;
# if it's in there already, we're done before we started. # if it's in there already, we're done before we started.
if ( $_[1] =~ /^$_[2]/ ) { if ( $_[1] =~ /^$_[2]/ ) {
&CTUDebug( "new value contains root '" . $_[2] . &CTUDebug( "new value contains root '" . $_[2] .
"', may not be able to do simple edit\n" ) ; "', may not be able to do simple edit\n" ) ;
# damn, might need to do an in-place edit # damn, might need to do an in-place edit
local( $curroot ) = $ENV{$_[3]} ; local( $curroot ) = $ENV{$_[3]} ;
&CTUDebug( "current root for '" . $_[3] . "' is '" . &CTUDebug( "current root for '" . $_[3] . "' is '" .
$curroot . "'\n" ) ; $curroot . "'\n" ) ;
if ( $curroot eq "" ) { if ( $curroot eq "" ) {
&CTUDebug( "can do simple edit\n" ) ; &CTUDebug( "can do simple edit\n" ) ;
$dosimple = 1 ; $dosimple = 1 ;
} else { } else {
local( $test ) = $_[1] ; local( $test ) = $_[1] ;
$test =~ s/^$_[2]// ; $test =~ s/^$_[2]// ;
$test = $curroot . $test ; $test = $curroot . $test ;
if ( $newenv{$_[0]} =~ /$test/ ) { if ( $newenv{$_[0]} =~ /$test/ ) {
# there it is. in-place edit # there it is. in-place edit
local( $foo ) = $newenv{$_[0]} ; local( $foo ) = $newenv{$_[0]} ;
$foo =~ s/$test/$_[1]/ ; $foo =~ s/$test/$_[1]/ ;
&CTUDebug( "doing in-place edit on " . $_[0] . &CTUDebug( "doing in-place edit on " . $_[0] .
" changing '" . $test . "' to '" . " changing '" . $test . "' to '" .
$_[1] . "' yielding '" . $foo . "'\n" ) ; $_[1] . "' yielding '" . $foo . "'\n" ) ;
$newenv{$_[0]} = $foo ; $newenv{$_[0]} = $foo ;
} else { } else {
&CTUDebug( "'" . $test . "' did not appear in $_[0]." . &CTUDebug( "'" . $test . "' did not appear in $_[0]." .
" Simple edit\n" ) ; " Simple edit\n" ) ;
$dosimple = 1 ; $dosimple = 1 ;
} }
} }
} else { } else {
&CTUDebug( "new value does not contain root '" . $_[2] . &CTUDebug( "new value does not contain root '" . $_[2] .
"', can do simple edit\n" ) ; "', can do simple edit\n" ) ;
# don't have to sweat in-place edits # don't have to sweat in-place edits
$dosimple = 1 ; $dosimple = 1 ;
} }
} }
if ( $dosimple ) { if ( $dosimple ) {
if ( $newenv{$_[0]} eq "" ) { if ( $newenv{$_[0]} eq "" ) {
&CTUDebug( "no pre-existing value in " . $_[0] . &CTUDebug( "no pre-existing value in " . $_[0] .
" setting it to '" . $_[1] . "'\n" ) ; " setting it to '" . $_[1] . "'\n" ) ;
$newenv{$_[0]} = $_[1] ; $newenv{$_[0]} = $_[1] ;
} elsif ( $envpostpend{$_[0]} ) { } elsif ( $envpostpend{$_[0]} ) {
&CTUDebug( "post-pending '" . $_[1] . "' to " . $_[0] . &CTUDebug( "post-pending '" . $_[1] . "' to " . $_[0] .
"\n" ) ; "\n" ) ;
$newenv{$_[0]} = $newenv{$_[0]} . " " . $_[1] ; $newenv{$_[0]} = $newenv{$_[0]} . " " . $_[1] ;
} else { } else {
&CTUDebug( "pre-pending '" . $_[1] . "' to " . $_[0] . &CTUDebug( "pre-pending '" . $_[1] . "' to " . $_[0] .
"\n" ) ; "\n" ) ;
$newenv{$_[0]} = $_[1] . " " . $newenv{$_[0]} ; $newenv{$_[0]} = $_[1] . " " . $newenv{$_[0]} ;
} }
} }
} }
} }
@ -180,6 +180,7 @@ sub CTAttachCompute {
# #
while ( ! $done ) { while ( ! $done ) {
$spec = &CTResolveSpec( $_[0], $flav ) ; $spec = &CTResolveSpec( $_[0], $flav ) ;
#print STDERR "spec line '" . $spec . "' flav: '" . $flav ."'\n";
&CTUDebug( "spec line = '$spec'\n" ) ; &CTUDebug( "spec line = '$spec'\n" ) ;
if ( $spec ne "" ) { if ( $spec ne "" ) {
$root = &CTComputeRoot( $_[0], $flav, $spec ) ; $root = &CTComputeRoot( $_[0], $flav, $spec ) ;
@ -203,7 +204,7 @@ sub CTAttachCompute {
} elsif ( $flav eq "ship" ) { } elsif ( $flav eq "ship" ) {
$flav = "release" ; $flav = "release" ;
} else { } else {
$flav = "ship" ; $flav = "install" ;
} }
} elsif ( ! $done ) { } elsif ( ! $done ) {
$spec = "" ; $spec = "" ;
@ -232,122 +233,122 @@ sub CTAttachCompute {
local( $localdocnt ) = 0 ; local( $localdocnt ) = 0 ;
local( %localpost ); local( %localpost );
if ( -e $init ) { if ( -e $init ) {
&CTUDebug( "scanning " . $_[0] . ".init\n" ) ; &CTUDebug( "scanning " . $_[0] . ".init\n" ) ;
local( @linesplit ) ; local( @linesplit ) ;
local( $linetmp ) ; local( $linetmp ) ;
local( $loop ) ; local( $loop ) ;
local( $looptmp ) ; local( $looptmp ) ;
local( *INITFILE ) ; local( *INITFILE ) ;
if ( -x $init ) { if ( -x $init ) {
open( INITFILE, "$init $_[0] $_[1] $root |" ) ; open( INITFILE, "$init $_[0] $_[1] $root |" ) ;
} else { } else {
open( INITFILE, "< $init" ) ; open( INITFILE, "< $init" ) ;
} }
while ( <INITFILE> ) { while ( <INITFILE> ) {
s/\n$// ; s/\n$// ;
@linesplit = split( /\#/ ) ; @linesplit = split( /\#/ ) ;
$_ = $linesplit[0] ; $_ = $linesplit[0] ;
if ( $_ =~ /^MODABS/ ) { if ( $_ =~ /^MODABS/ ) {
@linesplit = split ; @linesplit = split ;
$linetmp = $linesplit[1] ; $linetmp = $linesplit[1] ;
shift( @linesplit ) ; shift( @linesplit ) ;
shift( @linesplit ) ; shift( @linesplit ) ;
if ( $localmod{$linetmp} eq "" ) { if ( $localmod{$linetmp} eq "" ) {
$localmod{$linetmp} = join( " ", @linesplit ) ; $localmod{$linetmp} = join( " ", @linesplit ) ;
} else { } else {
$localmod{$linetmp} = $localmod{$linetmp} . " " . $localmod{$linetmp} = $localmod{$linetmp} . " " .
join( " ", @linesplit ) ; join( " ", @linesplit ) ;
} }
} elsif ( $_ =~ /^MODREL/ ) { } elsif ( $_ =~ /^MODREL/ ) {
@linesplit = split ; @linesplit = split ;
$linetmp = $linesplit[1] ; $linetmp = $linesplit[1] ;
shift( @linesplit ) ; shift( @linesplit ) ;
shift( @linesplit ) ; shift( @linesplit ) ;
foreach $loop ( @linesplit ) { foreach $loop ( @linesplit ) {
$looptmp = $root . "/" . &CTUShellEval($loop) ; $looptmp = $root . "/" . &CTUShellEval($loop) ;
if ( -e $looptmp ) { if ( -e $looptmp ) {
if ( $localmod{$linetmp} eq "" ) { if ( $localmod{$linetmp} eq "" ) {
$localmod{$linetmp} = $looptmp ; $localmod{$linetmp} = $looptmp ;
} else { } else {
$localmod{$linetmp} = $localmod{$linetmp} . " " . $localmod{$linetmp} = $localmod{$linetmp} . " " .
$looptmp ; $looptmp ;
} }
} }
} }
} elsif ( $_ =~ /^SETABS/ ) { } elsif ( $_ =~ /^SETABS/ ) {
@linesplit = split ; @linesplit = split ;
$linetmp = $linesplit[1] ; $linetmp = $linesplit[1] ;
shift( @linesplit ) ; shift( @linesplit ) ;
shift( @linesplit ) ; shift( @linesplit ) ;
if ( $localset{$linetmp} eq "" ) { if ( $localset{$linetmp} eq "" ) {
$localset{$linetmp} = join( " ", @linesplit ) ; $localset{$linetmp} = join( " ", @linesplit ) ;
} else { } else {
$localset{$linetmp} = $localset{$linetmp} . " " . $localset{$linetmp} = $localset{$linetmp} . " " .
join( " ", @linesplit ) ; join( " ", @linesplit ) ;
} }
} elsif ( $_ =~ /^SETREL/ ) { } elsif ( $_ =~ /^SETREL/ ) {
@linesplit = split ; @linesplit = split ;
$linetmp = $linesplit[1] ; $linetmp = $linesplit[1] ;
shift( @linesplit ) ; shift( @linesplit ) ;
shift( @linesplit ) ; shift( @linesplit ) ;
foreach $loop ( @linesplit ) { foreach $loop ( @linesplit ) {
$looptmp = $root . "/" . &CTUShellEval($loop) ; $looptmp = $root . "/" . &CTUShellEval($loop) ;
if ( -e $looptmp ) { if ( -e $looptmp ) {
if ( $localset{$linetmp} eq "" ) { if ( $localset{$linetmp} eq "" ) {
$localset{$linetmp} = $looptmp ; $localset{$linetmp} = $looptmp ;
} else { } else {
$localset{$linetmp} = $localset{$linetmp} . " " . $localset{$linetmp} = $localset{$linetmp} . " " .
$looptmp ; $looptmp ;
} }
} }
} }
} elsif ( $_ =~ /^SEP/ ) { } elsif ( $_ =~ /^SEP/ ) {
@linesplit = split ; @linesplit = split ;
$localsep{$linesplit[1]} = $linesplit[2] ; $localsep{$linesplit[1]} = $linesplit[2] ;
} elsif ( $_ =~ /^CMD/ ) { } elsif ( $_ =~ /^CMD/ ) {
@linesplit = split ; @linesplit = split ;
$localcmd{$linesplit[1]} = $linesplit[2] ; $localcmd{$linesplit[1]} = $linesplit[2] ;
} elsif ( $_ =~ /^DOCSH/ ) { } elsif ( $_ =~ /^DOCSH/ ) {
if ( $shell_type ne "sh" ) { if ( $shell_type ne "sh" ) {
@linesplit = split ; @linesplit = split ;
shift( @linesplit ) ; shift( @linesplit ) ;
$localdo{$localdocnt} = join( " ", @linesplit ) ; $localdo{$localdocnt} = join( " ", @linesplit ) ;
$localdocnt++ ; $localdocnt++ ;
} }
} elsif ( $_ =~ /^DOSH/ ) { } elsif ( $_ =~ /^DOSH/ ) {
if ( $shell_type eq "sh" ) { if ( $shell_type eq "sh" ) {
@linesplit = split ; @linesplit = split ;
shift( @linesplit ) ; shift( @linesplit ) ;
$localdo{$localdocnt} = join( " ", @linesplit ) ; $localdo{$localdocnt} = join( " ", @linesplit ) ;
$localdocnt++ ; $localdocnt++ ;
} }
} elsif ( $_ =~ /^DO/ ) { } elsif ( $_ =~ /^DO/ ) {
@linesplit = split ; @linesplit = split ;
shift( @linesplit ) ; shift( @linesplit ) ;
$localdo{$localdocnt} = join( " ", @linesplit ) ; $localdo{$localdocnt} = join( " ", @linesplit ) ;
$localdocnt++ ; $localdocnt++ ;
} elsif ( $_ =~ /^POSTPEND/ ) { } elsif ( $_ =~ /^POSTPEND/ ) {
@linesplit = split ; @linesplit = split ;
$localpost{$linesplit[1]} = 1 ; $localpost{$linesplit[1]} = 1 ;
} elsif ( $_ =~ /^ATTACH/ ) { } elsif ( $_ =~ /^ATTACH/ ) {
@linesplit = split ; @linesplit = split ;
shift( @linesplit ) ; shift( @linesplit ) ;
foreach $loop ( @linesplit ) { foreach $loop ( @linesplit ) {
push( @attachqueue, $loop ) ; push( @attachqueue, $loop ) ;
} }
} elsif ( $_ ne "" ) { } elsif ( $_ ne "" ) {
print STDERR "Unknown .init directive '$_'\n" ; print STDERR "Unknown .init directive '$_'\n" ;
} }
} }
close( INITFILE ) ; close( INITFILE ) ;
} }
# now handle sub-attaches # now handle sub-attaches
&CTUDebug( "performing sub-attaches\n" ) ; &CTUDebug( "performing sub-attaches\n" ) ;
while ( @attachqueue != () ) { while ( @attachqueue != () ) {
$item = shift( @attachqueue ) ; $item = shift( @attachqueue ) ;
&CTUDebug( "attaching to " . $item . "\n" ) ; &CTUDebug( "attaching to " . $item . "\n" ) ;
&CTAttachCompute( $item, $defflav, 1 ) ; &CTAttachCompute( $item, $defflav, 1 ) ;
} }
# now we will do our extentions, then apply the mods from the .init # now we will do our extentions, then apply the mods from the .init
@ -355,7 +356,7 @@ sub CTAttachCompute {
&CTUDebug( "extending paths\n" ) ; &CTUDebug( "extending paths\n" ) ;
local( $type ) = &CTSpecType( $spec ) ; local( $type ) = &CTSpecType( $spec ) ;
if ( $type eq "vroot" ) { if ( $type eq "vroot" ) {
&CTAttachMod( "PATH", "/usr/atria/bin", $root, $proj ) ; &CTAttachMod( "PATH", "/usr/atria/bin", $root, $proj ) ;
} }
# For now, we will not check whether the various /bin, /lib, # For now, we will not check whether the various /bin, /lib,
@ -370,30 +371,30 @@ sub CTAttachCompute {
$item = $root . "/bin" ; $item = $root . "/bin" ;
#if ( -e $item ) { #if ( -e $item ) {
&CTAttachMod( "PATH", $item, $root, $proj ) ; &CTAttachMod( "PATH", $item, $root, $proj ) ;
#} #}
$item = $root . "/lib" ; $item = $root . "/lib" ;
#if ( -e $item ) { #if ( -e $item ) {
if ( $ENV{"PENV"} eq "WIN32" ) { if ( $ENV{"PENV"} eq "WIN32" ) {
&CTAttachMod( "PATH", $item, $root, $proj ) ; &CTAttachMod( "PATH", $item, $root, $proj ) ;
} }
&CTAttachMod( "LD_LIBRARY_PATH", $item, $root, $proj ) ; &CTAttachMod( "LD_LIBRARY_PATH", $item, $root, $proj ) ;
#} #}
$item = $root . "/src" ; $item = $root . "/src" ;
#if ( -e $item ) { #if ( -e $item ) {
&CTAttachMod( "CDPATH", $item, $root, $proj ) ; &CTAttachMod( "CDPATH", $item, $root, $proj ) ;
#} #}
$item = $root . "/include" ; $item = $root . "/include" ;
#if ( -e $item ) { #if ( -e $item ) {
&CTAttachMod( "CT_INCLUDE_PATH", $item, $root, $proj ) ; &CTAttachMod( "CT_INCLUDE_PATH", $item, $root, $proj ) ;
#} #}
$item = $root . "/etc" ; $item = $root . "/etc" ;
#if ( -e $item ) { #if ( -e $item ) {
&CTAttachMod( "ETC_PATH", $item, $root, $proj ) ; &CTAttachMod( "ETC_PATH", $item, $root, $proj ) ;
#} #}
} }
@ -402,27 +403,27 @@ sub CTAttachCompute {
# run thru the stuff saved up from the .init file # run thru the stuff saved up from the .init file
foreach $item ( keys %localsep ) { foreach $item ( keys %localsep ) {
$envsep{$item} = $localsep{$item} ; $envsep{$item} = $localsep{$item} ;
} }
foreach $item ( keys %localpost ) { foreach $item ( keys %localpost ) {
$envpostpend{$item} = $localpost{$item} ; $envpostpend{$item} = $localpost{$item} ;
} }
foreach $item ( keys %localmod ) { foreach $item ( keys %localmod ) {
local( @splitthis ) = split( / +/, $localmod{$item} ) ; local( @splitthis ) = split( / +/, $localmod{$item} ) ;
local( $thing ) ; local( $thing ) ;
foreach $thing ( @splitthis ) { foreach $thing ( @splitthis ) {
&CTAttachMod( $item, $thing, $root, $proj ) ; &CTAttachMod( $item, $thing, $root, $proj ) ;
} }
} }
foreach $item ( keys %localset ) { foreach $item ( keys %localset ) {
&CTAttachSet( $item, $localset{$item} ) ; &CTAttachSet( $item, $localset{$item} ) ;
} }
foreach $item ( keys %localcmd ) { foreach $item ( keys %localcmd ) {
$envcmd{$item} = $localcmd{$item} ; $envcmd{$item} = $localcmd{$item} ;
} }
foreach $item ( keys %localdo ) { foreach $item ( keys %localdo ) {
$envdo{$docnt} = $localdo{$item} ; $envdo{$docnt} = $localdo{$item} ;
$docnt++ ; $docnt++ ;
} }
} }
@ -457,39 +458,39 @@ sub CTAttachWriteScript {
foreach $item ( keys %newenv ) { foreach $item ( keys %newenv ) {
local( $sep ) = " " ; local( $sep ) = " " ;
if ( $envsep{$item} ne "" ) { if ( $envsep{$item} ne "" ) {
$sep = $envsep{$item} ; $sep = $envsep{$item} ;
} }
local( @splitlist ) = split( / +/, $newenv{$item} ) ; local( @splitlist ) = split( / +/, $newenv{$item} ) ;
local( $outval ) = join( $sep, @splitlist ) ; local( $outval ) = join( $sep, @splitlist ) ;
if ( $shell_type eq "sh" ) { if ( $shell_type eq "sh" ) {
print OUTFILE "$item=\"" . $outval . "\"\n" ; print OUTFILE "$item=\"" . $outval . "\"\n" ;
if ( $envcmd{$item} ne "set" ) { if ( $envcmd{$item} ne "set" ) {
print OUTFILE "export $item\n" ; print OUTFILE "export $item\n" ;
} }
} else { } else {
if ( $envcmd{$item} ne "" ) { if ( $envcmd{$item} ne "" ) {
print OUTFILE $envcmd{$item} . " $item " ; print OUTFILE $envcmd{$item} . " $item " ;
if ( $envcmd{$item} eq "set" ) { if ( $envcmd{$item} eq "set" ) {
print OUTFILE "= ( " ; print OUTFILE "= ( " ;
} }
print OUTFILE $outval ; print OUTFILE $outval ;
if ( $envcmd{$item} eq "set" ) { if ( $envcmd{$item} eq "set" ) {
print OUTFILE ")" ; print OUTFILE ")" ;
} }
print OUTFILE "\n" ; print OUTFILE "\n" ;
} else { } else {
print OUTFILE "setenv $item \"$outval\"\n" ; print OUTFILE "setenv $item \"$outval\"\n" ;
if ( $ctdebug ) { if ( $ctdebug ) {
print OUTFILE "echo setting " . $item . " to '" . $outval . "'\n" ; print OUTFILE "echo setting " . $item . " to '" . $outval . "'\n" ;
} }
} }
} }
} }
if ( $newenv{"CDPATH"} ne "" ) { if ( $newenv{"CDPATH"} ne "" ) {
if ( $shell_type ne "sh" ) { if ( $shell_type ne "sh" ) {
print OUTFILE "set cdpath = ( \$" . "CDPATH )\n" ; print OUTFILE "set cdpath = ( \$" . "CDPATH )\n" ;
if ( $ctdebug ) { if ( $ctdebug ) {
print OUTFILE "echo assigning cdpath\n" ; print OUTFILE "echo assigning cdpath\n" ;
} }