summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2008-05-17 20:50:55 +0000
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2008-05-17 20:50:55 +0000
commit4b04a48f1c4993a5800d1e4046282cf5cc5b09ce (patch)
treea99dc0f59d828a4dc0be510ebfb7e97296df9992
parentdef05424340a9e0685cda87a6e5f125beb01f6f1 (diff)
new check for duplicated runfiles
git-svn-id: svn://tug.org/texlive/trunk@8193 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/tlpkg/bin/check-duplicated-runfiles67
-rwxr-xr-xMaster/tlpkg/bin/tlpkginfo2
2 files changed, 68 insertions, 1 deletions
diff --git a/Master/tlpkg/bin/check-duplicated-runfiles b/Master/tlpkg/bin/check-duplicated-runfiles
new file mode 100755
index 00000000000..016a9dfa8d8
--- /dev/null
+++ b/Master/tlpkg/bin/check-duplicated-runfiles
@@ -0,0 +1,67 @@
+#!/usr/bin/env perl
+# $Id$
+# Copyright 2008 Manuel Pegourie-Gonnard.
+# This file is licenced under the WTFPL version 2.
+#
+# Check there are no duplicated runtimes files.
+
+BEGIN {
+ $^W = 1;
+ ($mydir = $0) =~ s,/[^/]*$,,;
+ unshift (@INC, "$mydir/..");
+}
+
+use TeXLive::TLConfig;
+use TeXLive::TLPOBJ;
+use TeXLive::TLPDB;
+
+use File::Basename;
+
+# first, get and load the current texlive.tlpdb
+#
+chomp (my $Master = `cd $mydir/../.. && pwd`);
+$tlpdb = TeXLive::TLPDB->new ("root" => "$Master");
+die("Cannot find tlpdb in $Master!\n") unless defined($tlpdb);
+
+# build a list of all runtime files associated to 'normal' packages
+#
+(my $non_normal = `ls $Master/bin`) =~ s/\n/\$|/g; # binaries
+$non_normal .= '^0+texlive|^bin-|^collection-|^scheme-|^texlive-';
+my @runtime_files = ();
+foreach my $tlpn ($tlpdb->list_packages) {
+ next if ($tlpn =~ /$non_normal/);
+ my $tlp = $tlpdb->get_package($tlpn);
+ push @runtime_files, $tlp->runfiles;
+}
+
+# build the duplicates list
+#
+my @duplicates = (""); # just to use $duplicates[-1] freely
+my $prev = "";
+foreach my $f (sort map { basename($_) } @runtime_files) {
+ push (@duplicates, $f) if (($f eq $prev) and not ($f eq $duplicates[-1]));
+ $prev = $f;
+}
+shift @duplicates; # get rid of the fake 1st value
+
+# check if duplicates are different files
+#
+foreach my $f (@duplicates) {
+ my @copies = grep (/\/$f$/, @runtime_files);
+ my $diff = 0;
+ for (my $i = 1; $i < scalar(@copies); $i++) {
+ if ($diff = system ("diff -q --strip-trailing-cr "
+ . "$Master/$copies[$i-1] $Master/$copies[$i] >/dev/null")) {
+ print "# $f\ndiff $Master/$copies[$i-1] $Master/$copies[$i]\n";
+ last;
+ }
+ }
+ print join ("\n", @copies), "\n" if ($diff and (scalar(@copies) > 2));
+}
+
+### Local Variables:
+### perl-indent-level: 2
+### tab-width: 2
+### indent-tabs-mode: nil
+### End
+# vim: set tabstop=2 shiftwidth=2 expandtab:
diff --git a/Master/tlpkg/bin/tlpkginfo b/Master/tlpkg/bin/tlpkginfo
index f7c5d90c6fd..b4871ea3069 100755
--- a/Master/tlpkg/bin/tlpkginfo
+++ b/Master/tlpkg/bin/tlpkginfo
@@ -23,7 +23,7 @@ sub main
$latex_tds_dir = "$CTAN/macros/latex/contrib/latex-tds";
# erroneous tds files (warn Robin about them)
- $erroneous_tds = "lcyw"; # list format: pkg1|pkg2|etc
+ $erroneous_tds = "lcyw|kpfonts"; # list format: pkg1|pkg2|etc
if ($ARGV[0] eq "--ctan-dir") {
my $output = &find_ctan_dir ($ARGV[1]);