diff options
author | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2005-11-21 18:39:07 +0000 |
---|---|---|
committer | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2005-11-21 18:39:07 +0000 |
commit | 364f4e452f50b30d5e7ca8eebe1c9eba44d6a285 (patch) | |
tree | c9c22eaf67eb99b227303e676593be55220cb256 /lib/sbin/CreateConfigurationBindings.pl | |
parent | 35319b632668f2f9604fe175af937a7d3ba3e3fb (diff) |
Remove auto-generated capability files if they should not exist
(e.g. if a thorn's configuration.ccl has changed).
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4200 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/CreateConfigurationBindings.pl')
-rw-r--r-- | lib/sbin/CreateConfigurationBindings.pl | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/sbin/CreateConfigurationBindings.pl b/lib/sbin/CreateConfigurationBindings.pl index fb46629c..5adc1fa6 100644 --- a/lib/sbin/CreateConfigurationBindings.pl +++ b/lib/sbin/CreateConfigurationBindings.pl @@ -168,10 +168,22 @@ sub CreateConfigurationBindings } } - # write everything to file - &WriteFile("./Thorns/make.$thorn.defn",\$defs); - &WriteFile("./Thorns/$thorn.h",\$incs); - &WriteFile("./Thorns/make.$thorn.deps",\$deps); + if ($cfg->{"\U$thorn\E REQUIRES"} || $cfg->{"\U$thorn\E OPTIONAL"}) + { + # write everything to file + # (write the files even if they are empty) + &WriteFile("./Thorns/make.$thorn.defn",\$defs); + &WriteFile("./Thorns/$thorn.h",\$incs); + &WriteFile("./Thorns/make.$thorn.deps",\$deps); + } + else + { + # remove the files + # (we cannot have old files staying around) + unlink "./Thorns/make.$thorn.defn"; + unlink "./Thorns/$thorn.h"; + unlink "./Thorns/make.$thorn.deps"; + } } |