diff options
Diffstat (limited to 'Build/cdbuild/ctan2tds.pl')
-rwxr-xr-x | Build/cdbuild/ctan2tds.pl | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Build/cdbuild/ctan2tds.pl b/Build/cdbuild/ctan2tds.pl index 43235228587..430abd29056 100755 --- a/Build/cdbuild/ctan2tds.pl +++ b/Build/cdbuild/ctan2tds.pl @@ -1033,6 +1033,9 @@ if ($result eq 0 ) { die ("OPTION FAILURE"); } +# Read from config file to make local adjustments to above +readconfig(); + # for (@ARGV) { $packagedir=$_; @@ -2852,3 +2855,30 @@ sub MAKElistings { &SYSTEM("$MV listings*pdf listings.pdf"); &donormal; } + +# Allow overrides. In particular, CTAN can change some hashes to make +# packages with licenses that TL doesn't allow. +# +# Put the config file "ctan2tds-config.pl" in the dir from which you +# run this script, or better, set the environment variable "CTAN2TDS_CONFIG". +# +sub readconfig +{ + my ($base,$dir,$ext) = fileparse ($0,'\.pl'); + + my $configFileName = "$dir/$base-config.pl"; + $configFileName = $ENV{"CTAN2TDS_CONFIG"} || $configFileName; + + my $result; + if (-f $configFileName) { + my $err = "Error: CTAN config file $configFileName"; + $result = eval `cat $configFileName`; # like require, but no look in INC + die "$err; evaluation in file failed: $@" + if $@; + die "$err; yielded result that is false" + unless $result; + } else { + $result=1; + } + return $result; +} |