From 51134fdc52d6670fdb0ba1503dd16210f2a537ae Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 8 Sep 2012 23:42:10 +0000 Subject: only maintain list of sh scripts in one place git-svn-id: svn://tug.org/texlive/trunk@27619 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/texlive/linked_scripts/ChangeLog | 5 ++ .../source/texk/texlive/linked_scripts/Makefile.am | 10 ++- .../source/texk/texlive/linked_scripts/Makefile.in | 6 ++ Master/tlpkg/bin/check-wrapper-consistency | 75 +++++++++++++--------- 4 files changed, 64 insertions(+), 32 deletions(-) diff --git a/Build/source/texk/texlive/linked_scripts/ChangeLog b/Build/source/texk/texlive/linked_scripts/ChangeLog index 9007574d761..5677b0126f5 100644 --- a/Build/source/texk/texlive/linked_scripts/ChangeLog +++ b/Build/source/texk/texlive/linked_scripts/ChangeLog @@ -1,3 +1,8 @@ +2012-09-09 Karl Berry + + * Makefile.am (echo-shell-scripts): new target for + check-wrapper-consistency. + 2012-08-09 Peter Breitenlohner * Makefile.am (installdirs-local): Make sure $(bindir) exists. diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.am b/Build/source/texk/texlive/linked_scripts/Makefile.am index 9f4354ef8dc..ca6407cfd3d 100644 --- a/Build/source/texk/texlive/linked_scripts/Makefile.am +++ b/Build/source/texk/texlive/linked_scripts/Makefile.am @@ -356,8 +356,16 @@ xupdmap.1: tetex/updmap.help2man tetex/updmap.pl EXTRA_DIST += tetex/updmap.help2man ## -.PHONY: run-texlinks +## This target is invoked by check-wrapper-consistency (run from cron). +.PHONY: echo-shell-scripts +shell_scripts = $(texmf_shell_scripts) $(texmf_dist_shell_scripts) +shell_scripts += $(texmf_dist_context_scripts) +echo-shell-scripts: + @echo $(shell_scripts) + +## ## This target is invoked by the top-level make, +.PHONY: run-texlinks ## to create the per-format engine symlinks in $(bindir), ## after everything else is installed. We explicitly specify the ## fmtutil.cnf file to use for the sake of distro builds. diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.in b/Build/source/texk/texlive/linked_scripts/Makefile.in index d7b92171778..3afecb3100f 100644 --- a/Build/source/texk/texlive/linked_scripts/Makefile.in +++ b/Build/source/texk/texlive/linked_scripts/Makefile.in @@ -411,6 +411,8 @@ relpath = $(SHELL) $(top_srcdir)/../../build-aux/relpath runscript = $(top_srcdir)/w32_wrapper/runscript.exe ctxscript = $(top_srcdir)/w32_wrapper/context/mtxrun.exe @WIN32_TRUE@WINEXT = $(EXEEXT) +shell_scripts = $(texmf_shell_scripts) $(texmf_dist_shell_scripts) \ + $(texmf_dist_context_scripts) run_texlinks = $(DESTDIR)$(bindir)/texlinks -v \ -f $(DESTDIR)$(web2cdir)/fmtutil.cnf \ -e "$(EXEEXT)" $(DESTDIR)$(bindir) @@ -991,6 +993,10 @@ xupdmap.1: tetex/updmap.help2man tetex/updmap.pl help2man --include=$< --source="TeX Live" --no-info \ $(srcdir)/tetex/updmap.pl >/tmp/$@ +.PHONY: echo-shell-scripts +echo-shell-scripts: + @echo $(shell_scripts) + .PHONY: run-texlinks run-texlinks: @WIN32_FALSE@ PATH="$(DESTDIR)$(bindir):$(PATH)"; export PATH; $(run_texlinks) diff --git a/Master/tlpkg/bin/check-wrapper-consistency b/Master/tlpkg/bin/check-wrapper-consistency index a958b913214..49ff4c9d122 100755 --- a/Master/tlpkg/bin/check-wrapper-consistency +++ b/Master/tlpkg/bin/check-wrapper-consistency @@ -11,14 +11,15 @@ BEGIN { $^W = 1; ($mydir = $0) =~ s,/[^/]*$,,; unshift (@INC, "$mydir/.."); + chomp ($Master = `cd $mydir/../.. && pwd`); } use Getopt::Long; use Pod::Usage; -our $mydir; -my $help = 0; +our ($mydir, $Master); +my $help = 0; GetOptions("help|?" => \$help) or pod2usage(1); pod2usage(-exitstatus => 0, -verbose => 2) if $help; @@ -28,7 +29,6 @@ exit (&main ()); sub main { my $err = 0; - chomp (my $Master = `cd $mydir/../.. && pwd`); my $bindir = "$Master/bin"; chdir ($bindir) || die "chdir($bindir) failed: $!"; @@ -62,6 +62,7 @@ sub unx_wrapper_entries { opendir (DIR, ".") || die "opendir($DIR) failed: $!"; while (my $ent = readdir (DIR)) { next unless -l $ent; # skip all but symlinks + next if -d $ent; # and skip directories (i.e., man/) my $target = readlink ($ent); die "readlink($ent) failed: $!" if !defined ($target); @@ -80,38 +81,23 @@ sub unx_wrapper_entries { -# Windows is special, as usual. Given the list of wrappers in UW, check -# that each of those entries (excluding various exceptions) exists in -# W32DIR as a .exe, and is a copy of the canonical w32 wrapper exe -# specified in W32CANONICAL. -# -# We should use the *_shell_scripts in linked_scripts/Makefile.am -# instead of redoing it here. +# Windows is painfully special, as usual. Given the list of wrappers in +# UW, check that each of those entries (excluding shell scripts) exists +# in W32DIR as a .exe, and furthermore is a copy of the canonical w32 +# wrapper exe specified in W32CANONICAL. # sub check_w32 { my ($w32dir, $w32canonical, %uw) = @_; my $diff = 0; - + + my %is_shell_script = &list_shell_scripts (); for my $k (sort keys %uw) { - my $target = $uw{$k}; - next if $target =~ /bibexport/; # shell script - next if $target =~ /context/; # does it its own way - next if $target =~ /dviout/; # gui stub - next if $target =~ /installfont-tl/; # shell script - next if $target =~ /latexfileversion/; # shell script - next if $target =~ /lua2dox/; # shell script - next if $target =~ /listings-ext/; # shell script - next if $target =~ /man/; # no symlink - next if $target =~ /pdfjam/; # shell scripts - next if $target =~ /psv/; # gui stub - next if $target =~ /simpdftex/; # shell script - next if $target =~ /texmfstart/; # has its own binary - next if $target =~ /texdoc/; # gui stub - next if $target =~ /texworks/; # gui stub - next if $target =~ /tlmgr/; # does things its own way - next if $target =~ /typeoutfileinfo/; # shell script - next if $target =~ /xasy/; # no need - #print "$k -> $uw{$k}\n"; + next if $is_shell_script{$k}; # skip shell scripts + # + # also skip these special cases: + next if $k =~ /^(tlmgr|xasy|texdoctk)$/; + # + # else do the diff with the canonical wrapper: $diff += system ("cmp $w32dir/$k.exe $w32canonical"); } @@ -121,7 +107,7 @@ sub check_w32 { foreach my $f (@binfiles) { next unless ($f =~ s/\.(bat|cmd)$//); # only batch files - next if ($uw{$f}); # already checked + next if $uw{$f}; # already checked $diff += system ("cmp $w32dir/$f.exe $w32canonical"); } @@ -130,3 +116,30 @@ sub check_w32 { return $diff; } + +# As it happens, we already distinguish sh scripts from others in the +# build process, for basically the same reason. So return the list +# maintained there by using a target defined in linked_scripts/Makefie +# for us. +# +sub list_shell_scripts { + my %sh; + + # has to be the Work/ directory to get the Makefile, not Makefile.{in,am}. + my $Work = "$Master/../Build/source/Work"; + my $Work_linked_scripts = "$Work/texk/texlive/linked_scripts"; + + # use make; ensure we get only the last line, although that should be + # all there is. + my $lst = `make -s -C $Work_linked_scripts echo-shell-scripts | tail -1`; + + for my $script (split (" ", $lst)) { + $script =~ s,^.*/,,; + $sh{$script} = 1; # save with extension (for listings-ext.sh) + # + $script =~ s,\.[^.]*$,,; + $sh{$script} = 1; # save without extension (everything else) + } + + return %sh; +} -- cgit v1.2.3