diff options
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2010-05-20 11:17:54 +0000 |
---|---|---|
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2010-05-20 11:17:54 +0000 |
commit | 0457b178a2e50ed24680b52e0bbb6412d6df0799 (patch) | |
tree | e327eb15595280ace1ef90ed78806b4afb711e97 /Master/texmf | |
parent | fa8774e931594f29379afdb796e3a368825d7a9a (diff) |
Fix bugs in tlmgr generate language.
- "tlmgr generate language" used to issue an "undefined var in string"
- "tlmgr generate --dest foobar language" didn't work as advertised
git-svn-id: svn://tug.org/texlive/trunk@18371 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf')
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgr.pl | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index 437cbb83cad..bf26049cd96 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -3185,8 +3185,6 @@ sub action_arch { # GENERATE # sub action_generate { - my $dest = defined($opts{"dest"}) ? $opts{"dest"} : ""; - my $localconf = defined($opts{"localcfg"}) ? $opts{"localcfg"} : ""; my $what = shift @ARGV; init_local_db(); @@ -3206,7 +3204,7 @@ sub action_generate { # # if --rebuild-sys is given *and* --dest we warn that this might not # work if the destination is not the default one - if ($opts{"rebuild-sys"} && $dest) { + if ($opts{"rebuild-sys"} && $opts{"dest"}) { tlwarn("tlmgr generate $what: warning: both --rebuild-sys and --dest\n", "given; the call to fmtutil-sys can fail if the given\n", "destination is different from the default.\n"); @@ -3215,15 +3213,12 @@ sub action_generate { # we have to set TEXMFVAR, TEXMFCONFIG in the environment so that # searching for language.(dat/def) does search in the right place if ($what =~ m/^language(\.dat)?$/i) { - $dest ||= "$TEXMFSYSVAR/tex/generic/config/language.dat"; - $localconf ||= "$TEXMFLOCAL/tex/generic/config/language-local.dat"; + my $dest = $opts{"dest"} || + "$TEXMFSYSVAR/tex/generic/config/language.dat"; + my $localcfg = $opts{"localcfg"} || + "$TEXMFLOCAL/tex/generic/config/language-local.dat"; debug ("$0: writing language.dat data to $dest\n"); - TeXLive::TLUtils::create_language_dat($localtlpdb, $dest, $localconf); - if ($what =~ m/^language$/i) { - # the next if will match but we have to undefine the $dest - # variable so that it is reset to the right value - undef $dest; - } + TeXLive::TLUtils::create_language_dat($localtlpdb, $dest, $localcfg); if ($opts{"rebuild-sys"}) { do_cmd_and_check("fmtutil-sys --byhyphen $dest"); } else { @@ -3232,10 +3227,12 @@ sub action_generate { } } if ($what =~ m/^language(\.def)?$/i) { - $dest ||= "$TEXMFSYSVAR/tex/generic/config/language.def"; - $localconf ||= "$TEXMFLOCAL/tex/generic/config/language-local.def"; + my $dest = $opts{"dest"} ? $opts{"dest"} . '.def' : + "$TEXMFSYSVAR/tex/generic/config/language.def"; + my $localcfg = $opts{"localcfg"} || + "$TEXMFLOCAL/tex/generic/config/language-local.def"; debug("$0: writing language.def data to $dest\n"); - TeXLive::TLUtils::create_language_def($localtlpdb, $dest, $localconf); + TeXLive::TLUtils::create_language_def($localtlpdb, $dest, $localcfg); if ($opts{"rebuild-sys"}) { do_cmd_and_check("fmtutil-sys --byhyphen $dest"); } else { @@ -3245,10 +3242,10 @@ sub action_generate { } } elsif ($what =~ m/^fmtutil$/i) { - $dest ||= "$TEXMFSYSVAR/web2c/fmtutil.cnf"; - $localconf ||= "$TEXMFLOCAL/web2c/fmtutil-local.cnf"; + my $dest = $opts{"dest"} || "$TEXMFSYSVAR/web2c/fmtutil.cnf"; + my $localcfg = $opts{"localcfg"} || "$TEXMFLOCAL/web2c/fmtutil-local.cnf"; debug("$0: writing new fmtutil.cnf to $dest\n"); - TeXLive::TLUtils::create_fmtutil($localtlpdb, $dest, $localconf); + TeXLive::TLUtils::create_fmtutil($localtlpdb, $dest, $localcfg); if ($opts{"rebuild-sys"}) { do_cmd_and_check("fmtutil-sys --all"); @@ -3258,10 +3255,10 @@ sub action_generate { } } elsif ($what =~ m/^updmap$/i) { - $dest ||= "$TEXMFSYSCONFIG/web2c/updmap.cfg"; - $localconf ||= "$TEXMFLOCAL/web2c/updmap-local.cfg"; + my $dest = $opts{"dest"} || "$TEXMFSYSCONFIG/web2c/updmap.cfg"; + my $localcfg = $opts{"localcfg"} || "$TEXMFLOCAL/web2c/updmap-local.cfg"; debug("$0: writing new updmap.cfg to $dest\n"); - TeXLive::TLUtils::create_updmap($localtlpdb, $dest, $localconf); + TeXLive::TLUtils::create_updmap($localtlpdb, $dest, $localcfg); if ($opts{"rebuild-sys"}) { do_cmd_and_check("updmap-sys"); |