summaryrefslogtreecommitdiff
path: root/lib/sbin/ConfigScriptParser.pl
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-04-07 23:50:56 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-04-07 23:50:56 +0000
commit41e53d9f4f39960c1f4ab59d5e960e516f0b6557 (patch)
tree717f2e68fd8aa68fd6338cc295dca5d8be7728e4 /lib/sbin/ConfigScriptParser.pl
parentbfeb83e554f3ff076992c68982d27353529110d7 (diff)
Latest changes from Yaakoub.
Error code of thorn-provided script is checked. LIBS and LIBDIRS should end up in correct places on link line. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@3650 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/ConfigScriptParser.pl')
-rw-r--r--lib/sbin/ConfigScriptParser.pl27
1 files changed, 19 insertions, 8 deletions
diff --git a/lib/sbin/ConfigScriptParser.pl b/lib/sbin/ConfigScriptParser.pl
index b15cde1f..a2e0df6a 100644
--- a/lib/sbin/ConfigScriptParser.pl
+++ b/lib/sbin/ConfigScriptParser.pl
@@ -20,17 +20,28 @@
sub ParseConfigScript
{
my($config_dir, $provides, $lang, $script, $thorn, $cfg, $thorns, $filename)=@_;
- my($line_number, $line, $temp);
+ my($line_number, $temp);
- $start_dir = `pwd`;
+ my $start_dir = `pwd`;
chdir $config_dir;
# Run the configuration script in the config_dir folder
- @data=`$lang $thorns{thorn}/$script`;
+ if ($lang ne '' && $script ne '')
+ {
+ @data=`$lang $thorns{$thorn}/$script`;
+ }
+
+ my $exit_value = $? >> 8;
+ my $signal_num = $? & 127;
+ my $dumped_core = $? & 128;
+
+ &CST_error (0, "Configuration script for thorn $thorn returned $exit_value\n") if $exit_value;
+ &CST_error (0, "Configuration script for thorn $thorn received signal $signal_num\n") if $signal_num;
+ &CST_error (0, "Configuration script for thorn $thorn dumped core\n" ) if $dumped_core;
for($line_number = 0; $line_number < @data; $line_number++)
{
- $line = $data[$line_number];
+ my $line = $data[$line_number];
# Parse the line
if($line =~ m/^\s*BEGIN\s+DEFINE\s*/i)
@@ -70,14 +81,14 @@ sub ParseConfigScript
{
$cfg->{"\U$thorn $provides\E INCLUDE_DIRECTORY"} .=' ' . $1;
}
- elsif($line =~ m/^\s*LIBRARY[^\s]*\s*(.*)$/i)
- {
- $cfg->{"\U$thorn $provides\E LIBRARY"} .= ' ' . $1;
- }
elsif($line =~ m/^\s*LIBRARY_DIRECTORY[^\s]*\s*(.*)$/i)
{
$cfg->{"\U$thorn $provides\E LIBRARY_DIRECTORY"} .= ' ' . $1;
}
+ elsif($line =~ m/^\s*LIBRARY[^\s]*\s*(.*)$/i)
+ {
+ $cfg->{"\U$thorn $provides\E LIBRARY"} .= ' ' . $1;
+ }
else
{
&CST_error (0, "Unrecognised line in ConfigScriptParser.ccl '$line'");