--- loncom/build/lpml_parse.pl 2011/01/10 21:24:36 1.56 +++ loncom/build/lpml_parse.pl 2011/03/25 22:55:06 1.57 @@ -12,7 +12,7 @@ # The LearningOnline Network with CAPA # lpml_parse.pl - Linux Packaging Markup Language parser # -# $Id: lpml_parse.pl,v 1.56 2011/01/10 21:24:36 raeburn Exp $ +# $Id: lpml_parse.pl,v 1.57 2011/03/25 22:55:06 raeburn Exp $ # # Written by Scott Harrison, codeharrison@yahoo.com # @@ -86,6 +86,7 @@ Usage is for lpml file to come in throug typical choices: default,redhat6.2,debian2.2,redhat7 4th argument is to manually specify a sourceroot. 5th argument is to manually specify a targetroot. +6th argument is to manually specify a shell. Only the 1st argument is mandatory for the program to run. @@ -100,7 +101,7 @@ END # ------------------------------------------------- Grab command line arguments my $mode=''; -if (@ARGV==5) { +if (@ARGV == 6 || @ARGV == 5) { $mode = shift @ARGV; } else { @@ -135,6 +136,11 @@ $targetroot=~s/\/$//; # remove trailing $sourcerootarg=$sourceroot; $targetrootarg=$targetroot; +my $shell = 'sh'; +if (@ARGV) { + $shell = shift @ARGV; +} + my $logcmd='| tee -a WARNINGS'; my $invocation; # Record how the program was invoked @@ -147,6 +153,7 @@ if ($mode eq 'install' or $mode eq 'conf # 3rd argument (distribution) is: $dist # 4th argument (sourceroot) is: described below # 5th argument (targetroot) is: described below +# 6th argument (shell) is: $shell END } @@ -1151,11 +1158,11 @@ sub format_files { $tword=''; $tword=' alwaysrun' if $trigger eq 'always run'; if ($command!~/\s/) { $command=~s/\/([^\/]*)$//; - $command2="cd $command; sh ./$1;\\"; + $command2="cd $command; $shell ./$1;\\"; } else { $command=~s/(.*?\/)([^\/]+\s+.*)$/$1/; - $command2="cd $command; sh ./$2;\\"; + $command2="cd $command; $shell ./$2;\\"; } my $depstring; my $depstring2="\t\t\@echo '';\\\n"; @@ -1274,7 +1281,7 @@ sub format_file { my ($source2,$command,$trigger,@deps)=split(/\;/,$bi); $tword=''; $tword=' alwaysrun' if $trigger eq 'always run'; $command=~s/\/([^\/]*)$//; - $command2="cd $command; sh ./$1;\\"; + $command2="cd $command; $shell ./$1;\\"; my $depstring; foreach my $dep (@deps) { $depstring.=<