texlive[55226] Master/tlpkg/libexec/mptopdf-extract: only update

commits+karl at tug.org commits+karl at tug.org
Thu May 21 19:13:21 CEST 2020


Revision: 55226
          http://tug.org/svn/texlive?view=revision&revision=55226
Author:   karl
Date:     2020-05-21 19:13:20 +0200 (Thu, 21 May 2020)
Log Message:
-----------
only update mptopdf dir when there are changes to
the files; the mtimes change every day.

Modified Paths:
--------------
    trunk/Master/tlpkg/libexec/mptopdf-extract

Modified: trunk/Master/tlpkg/libexec/mptopdf-extract
===================================================================
--- trunk/Master/tlpkg/libexec/mptopdf-extract	2020-05-20 21:50:26 UTC (rev 55225)
+++ trunk/Master/tlpkg/libexec/mptopdf-extract	2020-05-21 17:13:20 UTC (rev 55226)
@@ -1,5 +1,6 @@
 #!/bin/sh
 # $Id$
+# Public domain. Originally written by Karl Berry, 2013.
 # Get the mptopdf files out of the context zip.  We distribute mptopdf
 # as a separate package, since it can be used with LaTeX.  See
 # description in mptopdf.tlpsrc for details.
@@ -26,9 +27,18 @@
 
 # Working directory.
 workdir=/home/ftp/tex/mptopdf
-cd $workdir || exit 1
-rm -rf $workdir.prev
-mkdir $workdir.prev
-mv * $workdir.prev
-unzip -q $context_zip $files
-ls -lt | head -3
+rm -rf $workdir.new
+mkdir $workdir.new
+cd $workdir.new || exit 1
+unzip -q $context_zip $files || exit 1
+
+cd ..
+if diff -ru 0 $workdir $workdir.new; then
+  rm -rf $workdir.new # same, nothing to do.
+else
+  # changed files, so work -> prev, new -> work.
+  # differences shown above.
+  rm -rf $workdir.prev
+  mv $workdir $workdir.prev || exit 1
+  mv $workdir.new $workdir || exit 1
+fi



More information about the tex-live-commits mailing list.