[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[tex-common] 03/05: update-texmf: add -o|--output option (Closes: #267567)



This is an automated email from the git hooks/post-receive script.

preining pushed a commit to branch master
in repository tex-common.

commit f7bf1041ccb8950dd646ea8743e74c5fb465cfcf
Author: Norbert Preining <preining@debian.org>
Date:   Tue Aug 15 11:27:45 2017 +0900

    update-texmf: add -o|--output option (Closes: #267567)
---
 debian/changelog       |  3 ++-
 scripts/update-texmf   | 19 +++++++++++++------
 scripts/update-texmf.8 |  3 +++
 3 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 966b96f..8ae1e04 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,8 +3,9 @@ tex-common (6.08) UNRELEASED; urgency=medium
   * remove Florent from the list of uploaders, thanks for your work
     (Closes: #869311)
   * add $VERSION to dh_installtex (Closes: #872168)
+  * update-texmf: add -o|--output option (Closes: #267567)
 
- -- Norbert Preining <preining@debian.org>  Tue, 15 Aug 2017 10:37:42 +0900
+ -- Norbert Preining <preining@debian.org>  Tue, 15 Aug 2017 11:26:00 +0900
 
 tex-common (6.07) unstable; urgency=medium
 
diff --git a/scripts/update-texmf b/scripts/update-texmf
index 7ef1e33..89c5d43 100644
--- a/scripts/update-texmf
+++ b/scripts/update-texmf
@@ -21,6 +21,10 @@ while [ $# -ne 0 ]; do
       DEBUG=true
       VERBOSE=true
       shift;;
+    -o|--output)
+      shift
+      TXMF_CNF="$1"
+      shift;;
     *)
       echo "unknown option: $1"
       exit 1
@@ -28,11 +32,13 @@ while [ $# -ne 0 ]; do
   esac
 done
 
-# test wether /etc isn't mounted read-only
-if touch /etc/texmf/is_rw 2>/dev/null; then
-  rm -f /etc/texmf/is_rw
+# test wether destinatio is read-only
+DESTDIR=$(dirname "$TXMF_CNF")
+mkdir -p "$DESTDIR"
+if touch "$DESTDIR/is_rw" 2>/dev/null; then
+  rm -f "$DESTDIR/is_rw"
 else
-  echo "Directory /etc/texmf/ not writeable. Exiting."
+  echo "Directory \"$DESTDIR\" not writeable. Exiting."
   exit 1
 fi
 
@@ -46,7 +52,9 @@ fi
 
 if [ -z "$CNFFILES" ] ; then
   # no config files are found, remove texmf.cnf if it is there
-  rm -rf /etc/texmf/web2c/texmf.cnf
+  if [ -f "$TXMF_CNF" ] ; then
+    rm "$TXMF_CNF"
+  fi
   exit 0
 fi
 
@@ -93,7 +101,6 @@ for i in ${CNFFILES}; do
     echo "%%% End of file: $i" >> ${TMPTXMF}
 done
 
-mkdir -p ${TXMF}/web2c
 cp ${TMPTXMF} ${TXMF_CNF}
 rm -r ${TMPDIR}
 chmod 644 ${TXMF_CNF}
diff --git a/scripts/update-texmf.8 b/scripts/update-texmf.8
index 2be1cce..4ca7485 100644
--- a/scripts/update-texmf.8
+++ b/scripts/update-texmf.8
@@ -28,6 +28,9 @@ Show verbose messages.
 .B \-d, --debug
 Show debugging information, and don't delete temporary files. Implies
 --verbose. 
+.TP
+.B \-o, --output FILE
+Generate output in FILE instead of /etc/texmf/web2c/texmf.cnf.
 .SH SEE ALSO
 .PP
 Further information can be found in

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-tex/tex-common.git


Reply to: