summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-08-28 21:08:59 +0000
committerKarl Berry <karl@freefriends.org>2022-08-28 21:08:59 +0000
commitd7c17c9014987de25a4bf2df6bcc0f6427f7b7fd (patch)
tree8da5a8689b64b94188006f7a6bc5f28d86f8b207
parent15f60291051d3cd3e454d2011fbb0d135c6ed47d (diff)
c2a: new script to automatically run place if no changes.
tlpkg-ctan-check: do not check magicwatermark (author never updates) or m-tx (binaries). releng.tex: make texlive-rel unwritable. place: sort directory lists. others: doc tweaks, sync. git-svn-id: svn://tug.org/texlive/trunk@64220 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/doc/ChangeLog4
-rw-r--r--Build/source/texk/tests/TeXLive/TLConfig.pm2
-rw-r--r--Build/source/texk/tests/TeXLive/TLUtils.pm84
-rw-r--r--Build/source/texk/texlive/tl_support/fmtutil.cnf3
-rwxr-xr-xMaster/tlpkg/bin/c2a101
-rwxr-xr-xMaster/tlpkg/bin/tl-check-fmtshare2
-rwxr-xr-xMaster/tlpkg/bin/tl-update-tlnet2
-rwxr-xr-xMaster/tlpkg/bin/tlpkg-ctan-check2
-rw-r--r--Master/tlpkg/doc/releng.txt1
-rwxr-xr-xMaster/tlpkg/libexec/place4
10 files changed, 192 insertions, 13 deletions
diff --git a/Build/source/doc/ChangeLog b/Build/source/doc/ChangeLog
index 6c8bbc6863e..8e2e26ee628 100644
--- a/Build/source/doc/ChangeLog
+++ b/Build/source/doc/ChangeLog
@@ -1,3 +1,7 @@
+2022-05-29 Karl Berry <karl@tug.org>
+
+ * (mv): r
+
2022-05-28 Karl Berry <karl@tug.org>
* tlbuild.texi (Build one package): typo, buil -> build.
diff --git a/Build/source/texk/tests/TeXLive/TLConfig.pm b/Build/source/texk/tests/TeXLive/TLConfig.pm
index 42156139d08..64a13f30333 100644
--- a/Build/source/texk/tests/TeXLive/TLConfig.pm
+++ b/Build/source/texk/tests/TeXLive/TLConfig.pm
@@ -6,7 +6,7 @@
use strict; use warnings;
package TeXLive::TLConfig;
-my $svnrev = '$Revision: 62232 $';
+my $svnrev = '$Revision: 63068 $';
my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
sub module_revision { return $_modulerevision; }
diff --git a/Build/source/texk/tests/TeXLive/TLUtils.pm b/Build/source/texk/tests/TeXLive/TLUtils.pm
index 16adc71ad14..e828363bed4 100644
--- a/Build/source/texk/tests/TeXLive/TLUtils.pm
+++ b/Build/source/texk/tests/TeXLive/TLUtils.pm
@@ -1,4 +1,3 @@
-# $Id: TLUtils.pm 62822 2022-03-20 08:34:54Z siepo $
# TeXLive::TLUtils.pm - the inevitable utilities for TeX Live.
# Copyright 2007-2022 Norbert Preining, Reinhard Kotucha
# This file is licensed under the GNU General Public License version 2
@@ -8,7 +7,7 @@ use strict; use warnings;
package TeXLive::TLUtils;
-my $svnrev = '$Revision: 62822 $';
+my $svnrev = '$Revision: 63645 $';
my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
sub module_revision { return $_modulerevision; }
@@ -43,6 +42,8 @@ C<TeXLive::TLUtils> - TeX Live infrastructure miscellany
TeXLive::TLUtils::run_cmd($cmd [, @envvars ]);
TeXLive::TLUtils::system_pipe($prog, $infile, $outfile, $removeIn, @args);
TeXLive::TLUtils::diskfree($path);
+ TeXLive::TLUtils::get_user_home();
+ TeXLive::TLUtils::expand_tilde($str);
=head2 File utilities
@@ -234,6 +235,8 @@ BEGIN {
&run_cmd
&system_pipe
&diskfree
+ &get_user_home
+ &expand_tilde
&announce_execute_actions
&add_symlinks
&remove_symlinks
@@ -540,6 +543,7 @@ sub platform_desc {
return "$platform_name{$platform}";
} else {
my ($CPU,$OS) = split ('-', $platform);
+ $OS = "" if ! defined $OS; # e.g., -force-platform foo
return "$CPU with " . ucfirst "$OS";
}
}
@@ -815,6 +819,43 @@ computing the disk space.
sub diskfree {
my $td = shift;
+ my ($output, $retval);
+ if (win32()) {
+ # the powershell one-liner only works from win8 on.
+ my @winver = Win32::GetOSVersion();
+ if ($winver[1]<=6 && $winver[2]<=1) {
+ return -1;
+ }
+ my $avl;
+ if ($td =~ /^[a-zA-Z]:/) {
+ my $drv = substr($td,0,1);
+ # ea ignore: error action ignore: no output at all
+ my $cmd = "powershell -nologo -noninteractive -noprofile -command " .
+ "\"get-psdrive -name $drv -ea ignore |select-object free |format-wide\"";
+ ($output, $retval) = run_cmd($cmd);
+ # ignore exit code, just parse the output, which should
+ # consist of empty lines and a number surrounded by spaces
+ my @lines = split(/\r*\n/, $output);
+ foreach (@lines) {
+ chomp $_;
+ if ($_ !~ /^\s*$/) {
+ $_ =~ s/^\s*//;
+ $_ =~ s/\s*$//;
+ $avl = $_;
+ last;
+ }
+ }
+ if ($avl !~ /^[0-9]+$/) {
+ return (-1);
+ } else {
+ return (int($avl/(1024*1024)));
+ }
+ } else {
+ # maybe UNC drive; do not try to handle this
+ return -1;
+ }
+ }
+ # now windows case has been taken care of
return (-1) if (! $::progs{"df"});
# drop final /
$td =~ s!/$!!;
@@ -831,24 +872,55 @@ sub diskfree {
}
$td .= "/" if ($td !~ m!/$!);
return (-1) if (! -e $td);
- debug("Checking for free diskspace in $td\n");
- my ($output, $retval) = run_cmd("df -P \"$td\"", POSIXLY_CORRECT => 1);
+ debug("checking diskfree() in $td\n");
+ ($output, $retval) = run_cmd("df -P \"$td\"", POSIXLY_CORRECT => 1);
if ($retval == 0) {
# Output format should be this:
# Filesystem 512-blocks Used Available Capacity Mounted on
# /dev/sdb3 6099908248 3590818104 2406881416 60% /home
my ($h,$l) = split(/\n/, $output);
my ($fs, $nrb, $used, $avail, @rest) = split(' ', $l);
- debug("disk space: used=$used (512-block), avail=$avail (512-block)\n");
+ debug("diskfree: used=$used (512-block), avail=$avail (512-block)\n");
# $avail is in 512-byte blocks, so we need to divide by 2*1024 to
# obtain Mb. Require that at least 100M remain free.
return (int($avail / 2048));
} else {
- # error in running df -P out of whatever reason
+ # error in running df -P for whatever reason
return (-1);
}
}
+=item C<get_user_home()>
+
+Returns the current user's home directory (C<$HOME> on Unix,
+C<$USERPROFILE> on Windows, and C<~> if none of the two are
+set. Save in package variable C<$user_home_dir> after computing.
+
+=cut
+
+# only search for home directory once, and save expansion here
+my $user_home_dir;
+
+sub get_user_home {
+ return $user_home_dir if ($user_home_dir);
+ $user_home_dir = getenv (win32() ? 'USERPROFILE' : 'HOME') || '~';
+ return $user_home_dir;
+}
+
+=item C<expand_tilde($str)>
+
+Expands initial C<~> with the user's home directory in C<$str> if
+available, else leave C<~> in place.
+
+=cut
+
+sub expand_tilde {
+ my $str = shift;
+ my $h = get_user_home();
+ $str =~ s/^~/$h/;
+ return $str;
+}
+
=back
=head2 File utilities
diff --git a/Build/source/texk/texlive/tl_support/fmtutil.cnf b/Build/source/texk/texlive/tl_support/fmtutil.cnf
index 78e2f8dfefc..7cae9be11b8 100644
--- a/Build/source/texk/texlive/tl_support/fmtutil.cnf
+++ b/Build/source/texk/texlive/tl_support/fmtutil.cnf
@@ -1,4 +1,4 @@
-# Generated by /home/texlive/karl/Master/bin/x86_64-linux/tlmgr on Sun Mar 13 01:49:39 2022
+# Generated by /home/texlive/karl/Master/bin/x86_64-linux/tlmgr on Fri Jun 10 03:07:15 2022
# Originally written by Thomas Esser, 1998. Public domain.
#
# For guidance on how to support local formats, see the man
@@ -69,7 +69,6 @@ pdfcsplain xetex - -etex csplain.ini
eplain pdftex language.dat -translate-file=cp227.tcx *eplain.ini
#
# from hitex:
-hilatex hitex language.dat -etex -ltx hilatex.ini
hitex hitex language.def -etex -ltx hitex.ini
#
# from jadetex:
diff --git a/Master/tlpkg/bin/c2a b/Master/tlpkg/bin/c2a
new file mode 100755
index 00000000000..5ab303bcfbc
--- /dev/null
+++ b/Master/tlpkg/bin/c2a
@@ -0,0 +1,101 @@
+#!/usr/bin/env perl
+# $Id$
+# Public domain. Originally written by Karl Berry, 2022.
+#
+# Update from CTAN to TL. First, run the test import with c2l; then, if
+# no files were added or removed (and it was an existing package),
+# automatically run c2l -p to "place" the new package in svn.
+# Do not run svn commit. (Code needs to be refactored for common calls.)
+
+use strict; use warnings;
+
+(my $prg = $0) =~ s,.*/,,;
+
+my $place_branch = 0;
+#my $chicken = "";
+my $chicken = "-p";
+
+exit (&main ());
+
+sub main {
+ my $place = 0;
+ if ($ARGV[$#ARGV] =~ /^-?p$/) {
+ pop (@ARGV);
+ $place = 1;
+ }
+ printf "$prg: running c2l...";
+ my @lines = `set -o pipefail; c2l @ARGV </dev/null 2>&1 | tee /tmp/c2l.out`;
+ if ($?) {
+ print "first c2l failed, exiting.\n";
+ print @lines;
+ exit $?;
+ }
+
+ my $status = 1;
+ my $i;
+ for ($i = 0; $i < @lines; $i++) {
+ if ($lines[$i] =~ /^current vs.\ new/) {
+ my $nextline = $lines[$i+1];
+ if ($nextline =~ /^[0-9]+ common files, ([0-9]+) changed/) {
+ if ($1 == 0) {
+ print "seems nothing changed, done.\n";
+ print @lines;
+ $status = 0;
+ last;
+ } else {
+ $status = &do_place ("no new or removed files");
+ last;
+ }
+
+ } elsif ($place) {
+ $status = &do_place ("new/removed files, but p(lace) given");
+ last;
+
+ } else {
+ print "have new/removed files, exiting.\n";
+ print @lines;
+ last;
+ }
+ }
+ }
+
+ if ($i == @lines) {
+ if ($place) {
+ $status = &do_place ("no current vs. new, but p(lace) given");
+ } else {
+ print "no current vs. new, exiting.\n"; # new package, presumably
+ print @lines;
+ }
+ }
+
+ return $status;
+}
+
+
+sub do_place {
+ my ($desc,$c2cmd) = @_;
+
+ my $msg;
+ if ($c2cmd && $c2cmd eq "c2b") {
+ $msg = "$prg: $desc"; # place on branch
+ } else {
+ $c2cmd = "c2l";
+ my $branch_msg = $place_branch ? "(+branch)" : "";
+ $msg = "$desc, rerunning for svn$branch_msg...";
+ }
+
+ print "$msg\n";
+ my $cmd = "set -o pipefail;"
+ . "$c2cmd $chicken @ARGV </dev/null 2>&1 | tee /tmp/$c2cmd.out";
+ my @placelines = `$cmd`;
+ my $status = $?;
+ print @placelines;
+ if ($status) {
+ print "$prg: *** do_place($c2cmd) failed, exiting.\n";
+
+ } elsif ($c2cmd ne "c2b" && $place_branch) {
+ $status = &do_place ("running c2b for svn branch", "c2b");
+ }
+
+ return $status;
+}
diff --git a/Master/tlpkg/bin/tl-check-fmtshare b/Master/tlpkg/bin/tl-check-fmtshare
index a93883c680c..d9d339fba47 100755
--- a/Master/tlpkg/bin/tl-check-fmtshare
+++ b/Master/tlpkg/bin/tl-check-fmtshare
@@ -255,7 +255,7 @@ for fmt in $fmts; do
exit 1
fi
#echo "$0: (`date`)"
- echo "$0: built fmtfile: `ls -l $fmtfile`"
+ echo "$0: built fmtfile: `ls -l $fmtfile`" (on `hostname`)
engineversion=`$enginedir/$engine --version | sed 1q`
echo "$0: with engine: $enginedir/$engine ($engineversion)"
diff --git a/Master/tlpkg/bin/tl-update-tlnet b/Master/tlpkg/bin/tl-update-tlnet
index 440207a3865..6c08c7c95d1 100755
--- a/Master/tlpkg/bin/tl-update-tlnet
+++ b/Master/tlpkg/bin/tl-update-tlnet
@@ -305,7 +305,7 @@ install_tl_log=$tltryinst/$yyyy/install-tl.log
if test -r $install_tl_log \
&& grep -i '^fmtutil.*error.*' $install_tl_log >/dev/null; then
echo >&2
- echo "$prg: seems fmtutil failed, check $install_tl_log." >&2
+ echo "$prg: seems fmtutil failed, check: $install_tl_log" >&2
failure=true
else
: # appease -e
diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check
index 2af2a009d2e..817e6b8bb74 100755
--- a/Master/tlpkg/bin/tlpkg-ctan-check
+++ b/Master/tlpkg/bin/tlpkg-ctan-check
@@ -960,6 +960,8 @@ my @TLP_no_check = (
"luatex", # binary
"luahbtex", # binary
"luajittex", # binary
+ "m-tx", # binary
+ "magicwatermark", # 28aug22 awaiting upload with .dtx fix
"makeindex", # binary
"malayalam-latex", # binary
"metafont", # binary
diff --git a/Master/tlpkg/doc/releng.txt b/Master/tlpkg/doc/releng.txt
index 744f1c2be9b..8789eea22bf 100644
--- a/Master/tlpkg/doc/releng.txt
+++ b/Master/tlpkg/doc/releng.txt
@@ -459,6 +459,7 @@ ls -l !$
mount /home/ftp/texlive/Contents/live
cd
umount /mnt/tl
+chmod -R a-w /usr/local/texlive-rel/ # make unwritable, we should never change
- update ~www/texlive web pages (search for $prev and $prev-1):
acquire* - general
diff --git a/Master/tlpkg/libexec/place b/Master/tlpkg/libexec/place
index d650f582289..6a85e2f136d 100755
--- a/Master/tlpkg/libexec/place
+++ b/Master/tlpkg/libexec/place
@@ -267,9 +267,9 @@ close (DIRLIST) || warn "close($DIRLIST) failed: $!";
# detect that a package update has already been done by someone else.
if ($opt_mode eq "svn") {
print ("\nsvn status of those directories:\n");
- system ("svn status `cat $dirlist_file`");
+ system ("svn status `sort -u $dirlist_file`");
print ("\nsvn update of those directories:\n");
- system ("svn update `cat $dirlist_file`");
+ system ("svn update `sort -u $dirlist_file`");
}
# do nothing in git mode