summaryrefslogtreecommitdiff
path: root/Master/texmf
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2010-05-27 17:45:24 +0000
committerNorbert Preining <preining@logic.at>2010-05-27 17:45:24 +0000
commit0af7367578d5830a02649a81a90073fdf425a27b (patch)
tree3265e013795bef22d81edc6ebe9815e4f46da057 /Master/texmf
parent3cfa6e6c975e08ec4a2fa814a5ae5cbbf788fa4f (diff)
first shot at tlmgr support for editing ROOT/texmf.cnf and tlmgr/config file
git-svn-id: svn://tug.org/texlive/trunk@18530 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf')
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl51
1 files changed, 51 insertions, 0 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index 0b007f960f0..b72a44828cf 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -82,6 +82,7 @@ use TeXLive::TLPOBJ;
use TeXLive::TLUtils;
use TeXLive::TLWinGoo;
use TeXLive::TLDownload;
+use TeXLive::TLConfFile;
TeXLive::TLUtils->import(qw(member info give_ctan_mirror win32 dirname
mkdirhier copy log debug tlcmp));
use TeXLive::TLPaper;
@@ -4062,6 +4063,56 @@ sub action_postaction {
# tries to mimick texconfig conf but probably will add some more things
#
sub action_conf {
+ my $arg = shift @ARGV;
+ if (!defined($arg)) {
+ texconfig_conf_mimick();
+ return;
+ }
+ if ($arg eq "tlmgr" || $arg eq "texmf") {
+ my $fn;
+ my $cf;
+ if ($arg eq "tlmgr") {
+ chomp (my $TEXMFCONFIG = `kpsewhich -var-value=TEXMFCONFIG`);
+ $fn = "$TEXMFCONFIG/tlmgr/config";
+ if (-r $fn) {
+ $cf = TeXLive::TLConfFile->new($fn, "#", "=");
+ }
+ } else {
+ $fn = "$Master/texmf.cnf";
+ if (-r $fn) {
+ $cf = TeXLive::TLConfFile->new($fn, "%", "=");
+ }
+ }
+ my ($key, $val) = @ARGV;
+ if (!defined($key)) {
+ # show all settings
+ if ($cf) {
+ info("$arg configuration values:\n");
+ for my $k ($cf->keys) {
+ info("$k = " . $cf->value($k) . "\n");
+ }
+ } else {
+ info("$arg config file $fn not present\n");
+ }
+ } else {
+ if (!defined($val)) {
+ if (defined($cf->value($key))) {
+ info("$arg config setting $key = " . $cf->value($key) . "\n");
+ } else {
+ info("$key not defined in $arg config file\n");
+ }
+ } else {
+ $cf->value($key, $val);
+ }
+ }
+ if ($cf->is_changed) {
+ $cf->save;
+ }
+ }
+}
+
+
+sub texconfig_conf_mimick {
my $PATH = $ENV{'PATH'};
info("=========================== version information ==========================\n");
info(give_version());