version 1.31, 2001/02/27 15:36:02
|
version 1.36, 2001/04/17 14:09:51
|
Line 2
|
Line 2
|
|
|
# Scott Harrison |
# Scott Harrison |
# November 2000 |
# November 2000 |
|
# 12/5/2000,12/7,12/8,12/9,12/10,12/11,12/12,12/13,12/14,12/21 Scott Harrison |
# Read in loncapa tags and metagroup tags |
# 1/8/2001,1/10/2001,1/13/2001,1/16/2001,1/18/2001,1/23/2001 Scott Harrison |
|
# 2/26/2001,2/27/2001,3/5/2001,4/10/2001,4/11,2001,4/13,2001 Scott Harrison |
|
# 4/17/2001 Scott Harrison |
|
|
|
# Read in loncapa tags and metagroup tags. Output various |
|
# useful files for viewing, compiling, monitoring, updating, |
|
# and installing. |
|
|
|
# This code works well. HOWEVER, I was in a rush when I |
|
# wrote it. Future plans are that the parsing should be |
|
# much more event-state based and the input should be |
|
# more XML-ish. -Scott |
|
|
# ---------------------------------------------- Read in command line arguments |
# ---------------------------------------------- Read in command line arguments |
my ($file,$mode)=@ARGV; |
my ($file,$mode)=@ARGV; |
Line 568 sub make_files_build_segment {
|
Line 579 sub make_files_build_segment {
|
my $description; |
my $description; |
my @allfiles=keys %{$info{'LOCATION'}{$distribution}}; |
my @allfiles=keys %{$info{'LOCATION'}{$distribution}}; |
my $tab="\t"; |
my $tab="\t"; |
my $sources="all: "; |
my $sources="# Dynamic Makefile generated by LON-CAPA build process\n\n"; |
|
$sources.="SHELL=\"/bin/sh\"\n\n"; |
|
$sources.="\nall: "; |
foreach my $d (@$dirs) { |
foreach my $d (@$dirs) { |
# set other values |
# set other values |
my $dirdescription=$info{'DIRECTORY'}{$distribution}{$d}{'DESCRIPTION'}; |
my $dirdescription=$info{'DIRECTORY'}{$distribution}{$d}{'DESCRIPTION'}; |
Line 609 sub make_files_build_segment {
|
Line 622 sub make_files_build_segment {
|
$depstat=" alwaysrun"; |
$depstat=" alwaysrun"; |
} |
} |
$dependencies=~s/\s+/ $sdir/gs; |
$dependencies=~s/\s+/ $sdir/gs; |
|
my @deps=split(/\s+/,$dependencies); |
|
shift @deps; |
|
my $testing=<<END; |
|
\@if !(echo "");\\ |
|
then echo "**** LON-CAPA WARNING **** Strange shell. Check your path settings.";\\ |
|
END |
|
foreach my $d (@deps) { |
|
$testing.=<<END; |
|
elif !(test -r $d);\\ |
|
then echo "**** LON-CAPA WARNING **** missing the file: $d";\\ |
|
END |
|
} |
|
chop $testing; |
$description.=<<END; |
$description.=<<END; |
$source2: $dependencies$depstat |
$source2: $depstat |
${tab}cd $directory; sh ./$buildfile |
$testing |
|
else \\ |
|
${tab}cd $directory; sh ./$buildfile;\\ |
|
fi |
|
|
END |
END |
} |
} |
Line 674 END
|
Line 703 END
|
my $rot=$filesfull[$i]; |
my $rot=$filesfull[$i]; |
$rot=~s/[^\/]+$/\./ if $rot=~/\*/; |
$rot=~s/[^\/]+$/\./ if $rot=~/\*/; |
my ($owner,$group)=split(/\:/,$devchown); |
my ($owner,$group)=split(/\:/,$devchown); |
if ($category ne 'conf') { |
if ($category ne 'conf' && $category ne 'symbolic link') { |
$description.=<<END if $category ne 'symbolic link'; |
if ($source!~/\*/) { |
|
$description.=<<END; |
|
\ttest '-e \$(SOURCE)/$source' \&\& install -o $owner -g $group -m $devchmod \$(SOURCE)/$source \$(TARGET)/$rot || echo "**** LON-CAPA WARNING **** CVS source file does not exist: \$(SOURCE)/$source" |
|
END |
|
} |
|
else { |
|
$description.=<<END; |
\tinstall -o $owner -g $group -m $devchmod \$(SOURCE)/$source \$(TARGET)/$rot |
\tinstall -o $owner -g $group -m $devchmod \$(SOURCE)/$source \$(TARGET)/$rot |
END |
END |
|
} |
} |
} |
} |
} |
} |
} |
Line 727 END
|
Line 763 END
|
my ($owner,$group)=split(/\:/,$devchown); |
my ($owner,$group)=split(/\:/,$devchown); |
if ($category eq 'conf') { |
if ($category eq 'conf') { |
$description.=<<END; |
$description.=<<END; |
\tcp -p \$(TARGET)/$rot \$(TARGET)/$rot`date +'.\%Y\%m\%d\%H\%M\%S'` 2 > /dev/null; install -o $owner -g $group -m $devchmod \$(SOURCE)/$source \$(TARGET)/$rot |
\tcp -p \$(TARGET)/$rot \$(TARGET)/$rot`date +'.\%Y\%m\%d\%H\%M\%S'` 2>/dev/null; install -o $owner -g $group -m $devchmod \$(SOURCE)/$source \$(TARGET)/$rot |
END |
END |
} |
} |
} |
} |