--- loncom/build/Attic/parse.pl 2001/01/23 16:12:56 1.26 +++ loncom/build/Attic/parse.pl 2001/04/11 03:06:00 1.33 @@ -2,8 +2,18 @@ # Scott Harrison # November 2000 +# ... +# 04/10/2001 -# Read in loncapa tags and metagroup tags + +# 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 my ($file,$mode)=@ARGV; @@ -179,9 +189,12 @@ ALL: ALL END close OUT; - `install -d BinaryRoot/etc/pam.d`; `install -o 500 -g 500 -m 0700 -d BinaryRoot/home/www`; open OUT,">>setup_file_list.txt"; + print OUT "BinaryRoot/home/www\n"; + close OUT; + `install -d BinaryRoot/etc/pam.d`; + open OUT,">>setup_file_list.txt"; print OUT "BinaryRoot/etc/pam.d/passwd\n"; close OUT; open OUT,">BinaryRoot/etc/pam.d/passwd"; @@ -565,7 +578,9 @@ sub make_files_build_segment { my $description; my @allfiles=keys %{$info{'LOCATION'}{$distribution}}; 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) { # set other values my $dirdescription=$info{'DIRECTORY'}{$distribution}{$d}{'DESCRIPTION'}; @@ -606,9 +621,25 @@ sub make_files_build_segment { $depstat=" alwaysrun"; } $dependencies=~s/\s+/ $sdir/gs; + my @deps=split(/\s+/,$dependencies); + shift @deps; + my $testing=</dev/null; install -o $owner -g $group -m $devchmod \$(SOURCE)/$source \$(TARGET)/$rot END } } @@ -1326,6 +1357,7 @@ END my $category=$info{'LOCATION'}{$distribution}{$filesfull[$i]}{'CATEGORY'}; my $fdescription=$info{'LOCATION'}{$distribution}{$filesfull[$i]}{'DESCRIPTION'}; my $source=$info{'LOCATION'}{$distribution}{$filesfull[$i]}{'SOURCE'}; + my $source2=$info{'LOCATION'}{$distribution}{$filesfull[$i]}{'SOURCE'}; my $note=$info{'LOCATION'}{$distribution}{$filesfull[$i]}{'NOTE'}; $note.="
" if $note; my $listing=$info{'LOCATION'}{$distribution}{$filesfull[$i]}{'FILES'}; @@ -1358,6 +1390,9 @@ END $source="$source"; } } + my $checksum; + my $checksum_source; + my $checksum_target; if ($mode eq 'status') { $filestatus=''; my $fs; @@ -1380,6 +1415,16 @@ END } else { $fs=`find /$filesfull[$i] -prune -printf "\%m\t\%u\t\%g" 2>/dev/null`; + if (-f "/$filesfull[$i]" && !(-l "/$filesfull[$i]")) { + $checksum_source=`md5sum ../../$source2 | cut -d ' ' -f1`; + chop $checksum_source; + $checksum_target=`md5sum /$filesfull[$i] | cut -d ' ' -f1`; + chop $checksum_target; +# warn ("CS: $checksum_source, CT: $checksum_target\n"); + unless ($checksum_source eq $checksum_target) { + $checksum="
CHECKSUM DIFFERENCE"; + } + } } my $fsl=`find /$filesfull[$i] -type l -prune -printf "\%m\t\%u\t\%g" 2>/dev/null`; unless ($fs || $filestatus) { @@ -1403,13 +1448,13 @@ END $s=''; } if ($fs eq "$chmod$s$chown" && $fs eq "$devchmod$s$devchown") { - $filestatus='runtime+development'; + $filestatus="runtime+development$checksum"; } elsif ($fs eq "$chmod$s$chown") { - $filestatus='runtime'; + $filestatus="runtime$checksum"; } elsif ($fs eq "$devchmod$s$devchown") { - $filestatus='development'; + $filestatus="development$checksum"; } else { $filestatus="ERROR
$fs";