summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-03-08 15:40:46 +0000
committerKarl Berry <karl@freefriends.org>2007-03-08 15:40:46 +0000
commit14d833933b27712ce59dab912670e4931bf7cdcd (patch)
treeb2a4c02ab373b1876e848fca5613ec3ed9ac55f2
parent5300b57e72bf03ac33de2ed93dfd82f1408a7970 (diff)
(readconfig): new routine to allow local overrides; from Jim Hefferon.
git-svn-id: svn://tug.org/texlive/trunk@4021 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xBuild/cdbuild/ctan2tds.pl30
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;
+}