summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-01-14 14:11:14 +0000
committerKarl Berry <karl@freefriends.org>2009-01-14 14:11:14 +0000
commit8a75142be54c5a2f2e7a1fabe6781605cbdfa65f (patch)
tree977877a2f1782fb09220131e08438389c77f457e
parentc3b18d9efce359644f5e33d9bdea59a48fc42017 (diff)
(action_paper): do not check option_create_formats
here, now it is done in handle_ret_hash. (handle_ret_hash): use exists instead of defined; doc fixes. git-svn-id: svn://tug.org/texlive/trunk@11870 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr2.pl41
1 files changed, 21 insertions, 20 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr2.pl b/Master/texmf/scripts/texlive/tlmgr2.pl
index fb71e37ba77..a5a01f0d027 100755
--- a/Master/texmf/scripts/texlive/tlmgr2.pl
+++ b/Master/texmf/scripts/texlive/tlmgr2.pl
@@ -380,18 +380,19 @@ sub execute_action {
# run external programs (mktexlsr, updmap-sys, etc.) as specified by the
-# RET hash. We return the number of unsuccessful runs, zero if all ok.
+# keys in the RET hash. We return the number of unsuccessful runs, zero
+# if all ok.
#
sub handle_ret_hash {
my (%ret) = @_;
my $errors = 0;
- if (defined($ret{'mktexlsr'})) {
+ if (exists $ret{'mktexlsr'}) {
info("running mktexlsr\n");
$errors += system("mktexlsr");
}
- if (defined($ret{'map'})) {
+ if (exists $ret{'map'}) {
foreach my $m (@{$ret{'map'}}) {
info("$m\n");
$errors += system("updmap-sys --nomkmap --nohash --$m");
@@ -400,29 +401,33 @@ sub handle_ret_hash {
$errors += system("updmap-sys");
}
- chomp (my $TEXMFSYSVAR = `kpsewhich -var-value=TEXMFSYSVAR`);
- chomp (my $TEXMFLOCAL = `kpsewhich -var-value=TEXMFLOCAL`);
+ chomp(my $TEXMFSYSVAR = `kpsewhich -var-value=TEXMFSYSVAR`);
+ chomp(my $TEXMFLOCAL = `kpsewhich -var-value=TEXMFLOCAL`);
- if (defined($ret{'format'})) {
+ # format means create missing formats (because a new one was added).
+ # format-regenerate is used when the paper size changes. In that
+ # case, if option_create_formats is set, we simply want to generate
+ # all formats; if not, then we only want to refresh existing ones.
+ #
+ my $opt_fmt = $localtlpdb->option_create_formats;
+ if (exists $ret{'format'}) {
info("regenerating fmtutil.cnf in $TEXMFSYSVAR\n");
TeXLive::TLUtils::create_fmtutil($localtlpdb,
- "$TEXMFSYSVAR/web2c/fmtutil.cnf",
- "$TEXMFLOCAL/web2c/fmtutil-local.cnf");
- # run fmtutil-sys only if the option for building formats is set.
- my $fmt = $localtlpdb->option_create_formats;
- if ($localtlpdb->option_create_formats && !$ret{'format-regenerate'}) {
+ "$TEXMFSYSVAR/web2c/fmtutil.cnf",
+ "$TEXMFLOCAL/web2c/fmtutil-local.cnf");
+ if ($opt_fmt && !$ret{'format-regenerate'}) {
info("running fmtutil-sys --missing\n");
$errors += system("fmtutil-sys", "--missing");
}
}
- if (defined($ret{'format-regenerate'})) {
- my $a = "--refresh";
- $a = "--all" if $localtlpdb->option_create_formats;
- info("running fmtutil-sys $a\n");
+ #
+ if (exists $ret{'format-regenerate'}) {
+ my $a = $opt_fmt ? "--all" : "--refresh";
+ info("running fmtutil-sys $a to regenerate formats\n");
$errors += system("fmtutil-sys", $a);
}
- if (defined($ret{'language'})) {
+ if (exists $ret{'language'}) {
for my $ext ("dat", "def") {
my $lang = "language.$ext";
info("regenerating $lang\n");
@@ -732,10 +737,6 @@ sub action_paper {
unshift(@ARGV, "--list") if $opts{"list"};
merge_into(\%ret, TeXLive::TLPaper::do_paper($prog,$texmfsysconfig,@ARGV));
}
- if ($ret{"format"} && ! $localtlpdb->option_create_formats) {
- info("$0: option to update formats is off, skipping.\n");
- delete $ret{"format"};
- }
return \%ret;
}