--- loncom/build/lpml_parse.pl 2001/09/07 16:49:18 1.4 +++ loncom/build/lpml_parse.pl 2001/09/08 17:45:09 1.5 @@ -4,7 +4,7 @@ # YEAR=2001 # May 2001 # 06/19/2001,06/20,06/24 - Scott Harrison -# 9/5/2001,9/6 - Scott Harrison +# 9/5/2001,9/6,9/7,9/8 - Scott Harrison ############################################################################### ## ## @@ -79,6 +79,19 @@ if (@ARGV) { $sourceroot=~s/\/$//; $targetroot=~s/\/$//; +my $invocation; +# --------------------------------------------------- Record program invocation +if ($mode eq 'install') { + $invocation=(<; my $parsestring = join('',@parsecontents); @@ -309,6 +322,7 @@ sub format_lpml { print '# LPML install targets. Linux Packaging Markup Language,'; print ' by Scott Harrison 2001'."\n"; print '# This file was automatically generated on '.`date`; + print "\n".$invocation; } else { return ''; @@ -565,7 +579,7 @@ sub format_directory { return $directory="\nDIRECTORY $targetdir $categoryname $description"; } elsif ($mode eq 'install') { - return "\t".'install '.$categoryhash{$categoryname}.' -d '. + return "\t".'install '.$categoryhash{$categoryname}.' -d /'. $targetroot.$targetdir."\n"; } else { @@ -653,15 +667,15 @@ sub format_file { "$build $status $dependencies" . "\nEND FILE"); } - elsif ($mode eq 'install') { + elsif ($mode eq 'install' && $categoryname ne 'conf') { return "\t".'@test -e '.$sourceroot.$source. - '/loncom/html/index.html && install '. + ' && install '. $categoryhash{$categoryname}.' '. - $sourceroot.$source.'/loncom/html/index.html '. + $sourceroot.$source.' '. $targetroot.$target. - '/home/httpd/html/index.html || echo "**** LON-CAPA WARNING '. - '**** CVS source file does not exist: '.$sourceroot.$source. - '/loncom/html/index.html"'."\n"; + ' || echo "**** LON-CAPA WARNING '. + '**** CVS source file does not exist: "'.$sourceroot.$source. + '"'."\n"; } else { return ''; @@ -684,8 +698,11 @@ sub format_link { "\nEND LINK"; } elsif ($mode eq 'install') { - push @links,"\t".'ln -s /'.$linkto.' /'.$targetroot.$target.' '. - $categoryname."\n"; + my @targets=split(/\;/,$target); + foreach my $tgt (@targets) { + push @links,"\t".'ln -fs /'.$linkto.' /'.$targetroot.$tgt. + "\n"; + } return ''; } else { @@ -710,6 +727,12 @@ sub format_fileglob { "$build $status $dependencies $filenames" . "\nEND FILEGLOB"; } + elsif ($mode eq 'install') { + return "\t".'install '. + $categoryhash{$categoryname}.' '. + $sourceroot.'/'.$sourcedir.$glob.' '. + $targetroot.'/'.$targetdir.'.'."\n"; + } else { return ''; } @@ -808,7 +831,6 @@ sub format_glob { # ---------------------------------------------------- Format filenames section sub format_filenames { my @tokeninfo=@_; - $glob=''; my $text=&trim($parser->get_text('/filenames')); if ($text) { $parser->get_tag('/filenames'); @@ -819,7 +841,6 @@ sub format_filenames { # ------------------------------------------------------- Format linkto section sub format_linkto { my @tokeninfo=@_; - $glob=''; my $text=&trim($parser->get_text('/linkto')); if ($text) { $parser->get_tag('/linkto');