diff options
author | Karl Berry <karl@freefriends.org> | 2019-12-05 19:22:48 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-12-05 19:22:48 +0000 |
commit | 7f43f3692e1354166c0623faf83c84b23d041ea3 (patch) | |
tree | 390982346d7996f22dc8e5f00373ca4166cbf50d /Master/tlpkg/bin | |
parent | 8b5fd6387b9d1e730b07f360637812d8ecdbb253 (diff) |
no space before function calls, etc.
git-svn-id: svn://tug.org/texlive/trunk@53033 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin')
-rwxr-xr-x | Master/tlpkg/bin/tl-update-tlpdb | 121 |
1 files changed, 61 insertions, 60 deletions
diff --git a/Master/tlpkg/bin/tl-update-tlpdb b/Master/tlpkg/bin/tl-update-tlpdb index b59feb30da6..dc1bb1486f5 100755 --- a/Master/tlpkg/bin/tl-update-tlpdb +++ b/Master/tlpkg/bin/tl-update-tlpdb @@ -8,11 +8,11 @@ BEGIN { $^W = 1; - chomp ($mydir = `dirname $0`); - unshift (@INC, "$mydir/.."); + chomp($mydir = `dirname $0`); + unshift(@INC, "$mydir/.."); } -use strict; use warnings; +use strict; use experimental qw(smartmatch); # what the heck use TeXLive::TLConfig; @@ -34,7 +34,7 @@ my $opt_fromfiles = 0; my $opt_fromgit = 0; my $opt_fromgitsvn = 0; my $opt_keep_revisions = 0; -chomp (my $opt_master = `cd $::mydir/../.. && pwd`); +chomp(my $opt_master = `cd $::mydir/../.. && pwd`); my $opt_no_binsplit = 0; my $opt_no_commit = 0; # do/don't commit the changes my $opt_no_revision_check = undef; # set depending on options, if not explicit. @@ -65,17 +65,17 @@ GetOptions( "help|?" => \$help) or pod2usage(1); pod2usage(-exitstatus => 0, -verbose => 2) if $help; -my $progname = TeXLive::TLUtils::basename($0); +my $prg = TeXLive::TLUtils::basename($0); -exit (&main ()); +exit(&main()); sub main { if (! -d $opt_master) { - die "$progname: Master $opt_master not a directory, goodbye.\n"; + die "$prg: Master $opt_master not a directory, goodbye.\n"; } if ($opt_fromfiles + $opt_fromgit + $opt_fromgitsvn > 1) { - die "$progname: only one option --from[lines|git|gitsvn] can be given.\n"; + die "$prg: only one option --from[lines|git|gitsvn] can be given.\n"; } if (! $opt_catalogue) { @@ -95,13 +95,13 @@ sub main { our $tlc = undef; if (-r $opt_catalogue) { - info ("$progname: reading TeX Catalogue $opt_catalogue ...\n"); - $tlc = TeXLive::TeXCatalogue->new ("location" => $opt_catalogue); + info("$prg: reading TeX Catalogue $opt_catalogue ...\n"); + $tlc = TeXLive::TeXCatalogue->new("location" => $opt_catalogue); } else { - tlwarn("$progname: reusing Catalogue data, since source is not readable: " + tlwarn("$prg: reusing Catalogue data, since source is not readable: " . "$opt_catalogue\n"); if ($opt_catalogue_compare) { - tlwarn("$progname: unsetting --catalogue-compare since no Catalogue\n"); + tlwarn("$prg: unsetting --catalogue-compare since no Catalogue\n"); $opt_catalogue_compare = ""; } } @@ -114,21 +114,21 @@ sub main { my $oldtlpdb = undef; my $OLDTLPDB = "$opt_master/$tlpdb_loc"; if (-r $OLDTLPDB) { - $oldtlpdb = TeXLive::TLPDB->new ("root" => $opt_master); + $oldtlpdb = TeXLive::TLPDB->new("root" => $opt_master); } if (!defined($oldtlpdb)) { - tlwarn ("$progname: No revision check since no old tlpdb: $OLDTLPDB\n"); - finish ($newtlpdb, $pkgcount); + tlwarn("$prg: No revision check since no old tlpdb: $OLDTLPDB\n"); + finish($newtlpdb, $pkgcount); } if ($opt_no_revision_check) { if ($opt_keep_revisions) { copy_revisions_over($oldtlpdb, $newtlpdb); - info ("$progname: Keeping old revisions due to --keep-revisions\n"); + info("$prg: Keeping old revisions due to --keep-revisions\n"); } else { - info ("$progname: Not checking revisions due to --no-reverse-revision-check\n"); + info("$prg: Not checking revisions due to --no-reverse-revision-check\n"); } - finish ($newtlpdb, $pkgcount); + finish($newtlpdb, $pkgcount); } # compare_and_fix_tlpdbs returns true if any reversed revisions were found. @@ -147,14 +147,14 @@ sub main { # then we recreate the tlpdb, else we will report as buggy. # if (!$opt_fromfiles && $opt_fix_reverse_revisions && !$opt_no_commit) { - info ("$progname: Regenerating tlpdb after fixing\n"); + info("$prg: Regenerating tlpdb after fixing\n"); ($newtlpdb,$pkgcount) = create_tlpdb($tlc); # # now recheck, but do NOT try to check in changes again, since it # already failed: forcibly unset $opt_fix_reverse_revisions. $opt_fix_reverse_revisions = 0; if (compare_and_fix_tlpdbs($oldtlpdb, $newtlpdb)) { - tlwarn ("$progname: *** oops, should not happen!\n" + tlwarn("$prg: *** oops, should not happen!\n" . " After one iteration of compare_tlpdbs\n" . " the new tlpdb is still going backwards in time;\n" . " check output above and fix!\n"); @@ -168,19 +168,19 @@ sub main { # $newtlpdb points to the right one if ($buggy_tlpdb) { - tlwarn("$progname: the newly created tlpdb seems to be buggy.\n"); + tlwarn("$prg: the newly created tlpdb seems to be buggy.\n"); if ($opt_output) { - tlwarn("$progname: saving it anyway due to --output (to $opt_output)\n"); + tlwarn("$prg: saving it anyway due to --output (to $opt_output)\n"); $buggy_tlpdb = 0; } elsif ($opt_save_anyway) { - tlwarn("$progname: saving it anyway due to --save-anyway\n"); + tlwarn("$prg: saving it anyway due to --save-anyway\n"); $buggy_tlpdb = 0; } else { - tlwarn("$progname: not saving it, use --save-anyway if you want it\n"); + tlwarn("$prg: not saving it, use --save-anyway if you want it\n"); } } if (!$buggy_tlpdb) { - finish ($newtlpdb, $pkgcount); + finish($newtlpdb, $pkgcount); } else { # return error to the shell script, it is evaluated in cron.tl! return 1; @@ -192,7 +192,7 @@ sub main { # to its revision in OLDTLPDB (if the pkg exists in OLDTLPDB). # sub copy_revisions_over { - my ($oldtlpdb, $newtlpdb) = @_; + my ($oldtlpdb,$newtlpdb) = @_; for my $pkg ($newtlpdb->list_packages) { my $oldtlp = $oldtlpdb->get_package($pkg); if (defined($oldtlp)) { @@ -215,7 +215,7 @@ sub copy_revisions_over { # fine for here, as it will be dealt with in tl-update-containers. # sub compare_and_fix_tlpdbs { - my ($oldtlpdb, $newtlpdb) = @_; + my ($oldtlpdb,$newtlpdb) = @_; my %cmp = TeXLive::TLUtils::compare_tlpdbs($oldtlpdb, $newtlpdb); @@ -232,7 +232,7 @@ sub compare_and_fix_tlpdbs { } else { # revision change has been reported, if the revision is increasing # that is fine, otherwise try fixing it - my ($rA, $rB) = split (':', + my ($rA, $rB) = split(':', $cmp{'different_packages'}->{$p}->{'revision'}); if ($rA >= $rB) { $packages_needing_fixup{$p} = 1; @@ -244,12 +244,12 @@ sub compare_and_fix_tlpdbs { if (defined($cmp{'different_packages'}->{$p}->{'revision'})) { # revision change has been reported, if the revision is increasing # that is fine, otherwise try fixing it - my ($rA, $rB) = split (':', + my ($rA, $rB) = split(':', $cmp{'different_packages'}->{$p}->{'revision'}); # since we only register 'revision' key when there is a # change, we have either rA < rB or rA > rB if ($rA > $rB) { - tlwarn("$progname: big warning for $p: file lists didn't change " + tlwarn("$prg: big warning for $p: file lists didn't change " . "but revision is going backward! Very strange!\n"); $packages_needing_fixup{$p} = 1; } # if strange revision change @@ -269,7 +269,7 @@ sub compare_and_fix_tlpdbs { my @svn_changed_files = (); for my $p (sort keys %packages_needing_fixup) { - tlwarn("$progname: package $p has different files but " + tlwarn("$prg: package $p has different files but " . "same/decreasing revision number", $opt_fix_reverse_revisions ? "\n" : " [skipping fix since no fix_reverse_revisions]\n"); @@ -301,7 +301,7 @@ sub compare_and_fix_tlpdbs { } $fixfile .= $allf[0]; } - tlwarn("$progname: trying to fix it by running:\n"); + tlwarn("$prg: trying to fix it by running:\n"); my $time = time(); my $cmd = "svn propset texlive:force_incr_after_delete $time $fixfile"; $do_commit = 1; @@ -313,17 +313,17 @@ sub compare_and_fix_tlpdbs { if ($opt_no_commit) { if ($do_commit) { - tlwarn("$progname: tlpsrc files have been changed but not committed.\n"); - tlwarn("$progname: svn status output follows:\n"); + tlwarn("$prg: tlpsrc files have been changed but not committed.\n"); + tlwarn("$prg: svn status output follows:\n"); my $r = `svn status @svn_changed_files 2>&1`; tlwarn("$r\n"); } $do_commit = 0; } if ($do_commit) { - tlwarn("$progname: committing changes to tlpsrc files:\n"); + tlwarn("$prg: committing changes to tlpsrc files:\n"); TeXLive::TLUtils::xsystem("svn commit " - . "-m'($progname) force increased revision after removal of files' " + . "-m'($prg) force increased revision after removal of files' " . "@svn_changed_files"); } @@ -345,18 +345,18 @@ sub create_tlpdb { if (@ARGV) { # if we have cmd line arguments act as if --tlpsrc-from-cmdline was given. if (!$opt_tlpsrc_from_cmdline) { - debug ("$progname: generating tlpdb in /tmp/tlut for @ARGV.\n"); + debug("$prg: generating tlpdb in /tmp/tlut for @ARGV.\n"); $opt_tlpsrc_from_cmdline = 1; } } if (!$opt_tlpsrc_from_cmdline) { # if not otherwise given, use all tlpsrc files. - chdir ($tlpsrc_dir) || die "$progname: chdir($tlpsrc_dir) failed: $!"; - @ARGV = glob ("*.tlpsrc"); + chdir($tlpsrc_dir) || die "$prg: chdir($tlpsrc_dir) failed: $!"; + @ARGV = glob("*.tlpsrc"); } - info ("$progname: reading Master $opt_master ...\n"); - my $tltree = TeXLive::TLTREE->new ("svnroot" => $opt_master); + info("$prg: reading Master $opt_master ...\n"); + my $tltree = TeXLive::TLTREE->new("svnroot" => $opt_master); if ($opt_fromfiles) { $tltree->init_from_files; } elsif ($opt_fromgit) { @@ -367,7 +367,7 @@ sub create_tlpdb { $tltree->init_from_svn; } - info ("$progname: updating from tlpsrc ...\n"); + info("$prg: updating from tlpsrc ...\n"); my $tldb = TeXLive::TLPDB->new; my $src_count = 0; my $found_texlive_installation = 0; @@ -376,17 +376,17 @@ sub create_tlpdb { $src_count++; my $tlsrc = new TeXLive::TLPSRC; - $tlsrc->from_file ($f); - my $tlp = $tlsrc->make_tlpobj ($tltree, $opt_master); + $tlsrc->from_file($f); + my $tlp = $tlsrc->make_tlpobj($tltree, $opt_master); (my $base_f = $f) =~ s/\.tlpsrc$//; - $base_f = TeXLive::TLUtils::basename ($base_f); + $base_f = TeXLive::TLUtils::basename($base_f); warn "$f: package name " . $tlp->name . " does not match filename\n" if $tlp->name ne $base_f; if ($tlc) { # merge TeX Catalogue information - $tlp->update_from_catalogue ($tlc); + $tlp->update_from_catalogue($tlc); } # split bin packages off unless requested otherwise (no reason to so @@ -407,18 +407,19 @@ sub create_tlpdb { # # we do NOT use the tlpsrc file for computing the file revision # as this is actually wrong .. - $binobj->recompute_revision ($tltree); + $binobj->recompute_revision($tltree); if ($binobj->revision == 0) { ddebug("Package with revision number 0 not added: " . $binobj->name . "\n"); } else { - $tldb->add_tlpobj ($binobj); + $tldb->add_tlpobj($binobj); } } # we have to recompute the revision of the package itself # since the binfiles have been removed and that might lower the # revision number - $tlp->recompute_revision ($tltree, $tltree->file_svn_lastrevision("tlpkg/tlpsrc/$f")); + $tlp->recompute_revision($tltree, + $tltree->file_svn_lastrevision("tlpkg/tlpsrc/$f")); } } if ($tlp->name eq "00texlive.installation") { @@ -450,11 +451,11 @@ sub create_tlpdb { } # add the latest revision push @bar, "revision/".$tltree->revision; - $tlp->depends (@bar); + $tlp->depends(@bar); } - $tldb->add_tlpobj ($tlp); + $tldb->add_tlpobj($tlp); } - $tldb->root ($opt_master); + $tldb->root($opt_master); # we set several options in 00texlive.installation only in two cases: # 1) we are updating from *all* tlpsrc file, so no cmd line options @@ -507,7 +508,7 @@ sub tlpdb_catalogue_compare { my %ret; my $cmp_tlpdb = TeXLive::TLPDB->new("root" => $cmp_tlpdb_str); - die "$progname: no tlpdb to compare under: $cmp_tlpdb_str\n" + die "$prg: no tlpdb to compare under: $cmp_tlpdb_str\n" if ! defined $cmp_tlpdb; for my $p ($master_tlpdb->list_packages()) { @@ -521,11 +522,11 @@ sub tlpdb_catalogue_compare { $tlpB->replace_reloc_prefix(); if (! &tlpobj_catalogue_equal($tlpA, $tlpB)) { - debug("$progname: Catalogue changes in package: $p\n"); + debug("$prg: Catalogue changes in package: $p\n"); $ret{$p} = 1; } } - debug("$progname: ", 0 + keys %ret, " packages with Catalogue changes\n"); + debug("$prg: ", 0 + keys %ret, " packages with Catalogue changes\n"); return %ret; } @@ -631,7 +632,7 @@ sub equal_hashes { last if $ret == 0; } - #debug ("equal_hashes returns: $ret\n"); + #debug("equal_hashes returns: $ret\n"); return $ret; } @@ -648,15 +649,15 @@ sub finish { if ($opt_output) { if (open(OUT, ">$opt_output")) { $tlpdb->writeout(\*OUT); - info ("$progname: output $pkgcount packages to $opt_output.\n"); + info("$prg: output $pkgcount packages to $opt_output.\n"); } else { - tldie ("$progname: open(>$opt_output) failed: $!"); + tldie("$prg: open(>$opt_output) failed: $!"); } } else { $tlpdb->save; - info ("$progname: saved $pkgcount packages to " . $tlpdb->root . ".\n"); + info("$prg: saved $pkgcount packages to " . $tlpdb->root . ".\n"); } - exit (0); + exit(0); } __END__ |