[Debian-tex-commits] SVN tex-common commit + diffs: r1887 - in
tex-common/trunk: debian scripts
Norbert Preining
preining-guest at costa.debian.org
Tue Oct 24 08:56:55 UTC 2006
Author: preining-guest
Date: 2006-10-24 08:56:54 +0000 (Tue, 24 Oct 2006)
New Revision: 1887
Added:
tex-common/trunk/scripts/postinst-texlsr
tex-common/trunk/scripts/postrm-texlsr
Modified:
tex-common/trunk/debian/changelog
tex-common/trunk/debian/rules
tex-common/trunk/scripts/dh_installtex
tex-common/trunk/scripts/postinst-tex
tex-common/trunk/scripts/postrm-tex
Log:
* dh_installtex: include only the minimal mktexlsr code in case no other
installation is done (ie no maps, formats, languages) [preining]
* dh_installtex: add ability to specify texmf trees on cmdline, and only
recreate the ls-R DB for /usr/share/texmf and /var/lib/texmf [preining]
(Closes: 392359)
Modified: tex-common/trunk/debian/changelog
===================================================================
--- tex-common/trunk/debian/changelog 2006-10-23 20:22:16 UTC (rev 1886)
+++ tex-common/trunk/debian/changelog 2006-10-24 08:56:54 UTC (rev 1887)
@@ -1,8 +1,13 @@
-tex-common (0.36) UNRELEASED; urgency=low
+tex-common (0.35.1) UNRELEASED; urgency=low
* fix format extraction regexp in dh_installtex [preining]
+ * dh_installtex: include only the minimal mktexlsr code in case no other
+ installation is done (ie no maps, formats, languages) [preining]
+ * dh_installtex: add ability to specify texmf trees on cmdline, and only
+ recreate the ls-R DB for /usr/share/texmf and /var/lib/texmf [preining]
+ (Closes: 392359)
- -- Norbert Preining <preining at debian.org> Sun, 22 Oct 2006 17:37:24 +0200
+ -- Norbert Preining <preining at debian.org> Tue, 24 Oct 2006 10:55:25 +0200
tex-common (0.35) unstable; urgency=low
Modified: tex-common/trunk/debian/rules
===================================================================
--- tex-common/trunk/debian/rules 2006-10-23 20:22:16 UTC (rev 1886)
+++ tex-common/trunk/debian/rules 2006-10-24 08:56:54 UTC (rev 1887)
@@ -89,6 +89,8 @@
# dh_installtex(.1) is already installed via the bin_scripts
grep -v '^[ \t]*#' scripts/postrm-tex > $(INSTDIR)/usr/share/debhelper/autoscripts/postrm-tex
grep -v '^[ \t]*#' scripts/postinst-tex > $(INSTDIR)/usr/share/debhelper/autoscripts/postinst-tex
+ grep -v '^[ \t]*#' scripts/postrm-texlsr > $(INSTDIR)/usr/share/debhelper/autoscripts/postrm-texlsr
+ grep -v '^[ \t]*#' scripts/postinst-texlsr > $(INSTDIR)/usr/share/debhelper/autoscripts/postinst-texlsr
# fontcache stuff with proper permissions
install -d $(INSTDIR)/etc/texmf/web2c/
Modified: tex-common/trunk/scripts/dh_installtex
===================================================================
--- tex-common/trunk/scripts/dh_installtex 2006-10-23 20:22:16 UTC (rev 1886)
+++ tex-common/trunk/scripts/dh_installtex 2006-10-24 08:56:54 UTC (rev 1887)
@@ -22,18 +22,41 @@
[B<language=>I<lang>,I<pattern>[,I<alternate>,...]]
[B<languagefile=>I<file.cnf>[=I<n>]]
[B<format=>I<format>,I<engine>,I<hyphenfile>,I<rest args>]
-[B<formatfile=>I<file.cnf>[=I<n>]
+[B<formatfile=>I<file.cnf>[=I<n>]]
+[B<texmftrees=>I<tree>[,I<tree>]]
=head1 DESCRIPTION
dh_installtex is a debhelper program that is responsible for
-registering map files, new formats, and new languages with TeX.
+updating the ls-R databases, registering map files, new formats,
+and new hyphenation patterns with TeX.
Your package should depend on tex-common so that the
update-* commands are available. (This program adds that dependency to
${misc:Depends}.)
-In each of the three cases you can use three different methods to
+If you only install files into /usr/share/texmf and want to be sure that
+mktexlsr is called in a correct way (e.g., also
+in the postrm script when there is no functional mktexlsr), simply call
+
+ dh_installtex
+
+[B<Warning:>] The ls-R databases are [B<only>] updated for the following
+trees: /usr/share/texmf and /var/lib/texmf. Normal TeX related packages
+following the Debian TeX Policy should only install files into these
+directories and /etc/texmf (which does not need a ls-R DB), so this is
+a sensible choice. If you need to rehash the ls-R database of some other
+trees (eg. because an old package had files in /usr/share/texmf-tetex)
+please specify these additional trees on the command line via the
+texmftrees option:
+
+ dh_installtex texmftrees=tree1,tree2,...
+
+This will update the ls-R databases for /usr/share/texmf, /var/lib/texmf, and
+in addition tree1 and tree2.
+
+If in addition you have to install map files, language definitions, or
+format definitions you can use three different methods to
specify what should be installed:
1) B<Pre made config files:> These files can be specified with the
@@ -161,10 +184,14 @@
my $flavor;
my $mapdoconfig = 0; # doconfig depending map/subflavor
my $priority=10; # priority with which files are installed
+my $dothefullstuff = 0;
my %cmdlineargs;
my %cmdlinefiles;
my %cmdlinefilespriority;
+my @cmdlinetexmftrees;
+my @defaulttexmftrees = qw,/usr/share/texmf /var/lib/texmf,;
+
#
# definitions for the different flavors
#
@@ -283,7 +310,6 @@
return 0;
}
-
#
#
# START OF THE MAIN PROGRAM
@@ -306,6 +332,8 @@
$cmdlinefilespriority{$type}{$fn}=$pr;
} elsif (m/^(map|language|format)=(.*)$/) {
push @{$cmdlineargs{$1}}, $2;
+ } elsif (m/^texmftrees=(.*)$/) {
+ @cmdlinetexmftrees = split /,/, $1;
} else {
error("Unrecognized argument: $_\n");
}
@@ -375,6 +403,10 @@
# we have nothing to do here, skip to the next one!
next;
}
+ # we got something, either a cmd line are for one of the
+ # config files, or a package (e.g., debian/pkg.maps) file
+ # do the full maintainer stuff!
+ $dothefullstuff = 1;
push @whattodo, $type;
if ($pkgfileoncmdline && ($pkgprovidedfile || ($#cmdlinearguments >= 0))) {
error("This call would create multiple copies of $priority$package.$configfileext{$_}.\nPlease read the man page on how this should be fixed!\n");
@@ -440,9 +472,9 @@
close(CFGFILE);
push @listlines, "$priority$package";
}
-
+
if ( ! -d "$tmp/var/lib/tex-common/$managedir{$type}/") {
- doit("install","-d","$tmp/var/lib/tex-common/$managedir{$type}/");
+ doit("install","-d","$tmp/var/lib/tex-common/$managedir{$type}/");
}
$dofilen = "$tmp/var/lib/tex-common/$managedir{$type}/$package.list";
open(LISTFILE, ">>$dofilen")||
@@ -478,8 +510,13 @@
@fmtdata = @{$data{"format"}};
}
if (! $dh{NOSCRIPTS}) {
- autoscript($package, "postinst", "postinst-tex", "s/#FORMATS#/@fmtdata/; s/#WHATTODO#/@whattodo/");
- autoscript($package, "postrm", "postrm-tex", "s/#FORMATS#/@fmtdata/; s/#WHATTODO#/@whattodo/");
+ my @alltexmftrees = (@cmdlinetexmftrees, @defaulttexmftrees);
+ autoscript($package, "postinst", "postinst-texlsr", "s|#TEXMFTREES#|@alltexmftrees|");
+ autoscript($package, "postrm", "postrm-texlsr", "s|#TEXMFTREES#|@alltexmftrees|");
+ if ($dothefullstuff) {
+ autoscript($package, "postinst", "postinst-tex", "s/#FORMATS#/@fmtdata/; s/#WHATTODO#/@whattodo/");
+ autoscript($package, "postrm", "postrm-tex", "s/#FORMATS#/@fmtdata/; s/#WHATTODO#/@whattodo/");
+ }
}
addsubstvar($package, "misc:Depends", "tex-common", ">= 0.7");
Modified: tex-common/trunk/scripts/postinst-tex
===================================================================
--- tex-common/trunk/scripts/postinst-tex 2006-10-23 20:22:16 UTC (rev 1886)
+++ tex-common/trunk/scripts/postinst-tex 2006-10-24 08:56:54 UTC (rev 1887)
@@ -1,7 +1,7 @@
#
# postinst-tex
#
-# postinst snippets for installing stuff for TeX
+# postinst snippets for registering hyphenation patterns, font maps, and formats
#
# Authors:
# Florent Rougon <f.rougon at free.fr>
@@ -14,34 +14,6 @@
# Let vim know that we don't want tabs
# vim:set expandtab: #
-
-# Tell if kpsewhich works. If this is the case:
-#
-# 1. kpsewhich is installed and;
-#
-# 2. libkpathsea is configured.
-dhit_libkpathsea_configured ()
-{
- kpsewhich --version >/dev/null 2>&1
-}
-
-dhit_update_lsr_files ()
-{
- tempfile=$(mktemp -p /tmp mktexlsr.XXXXXXXX)
- printf "Running mktexlsr. This may take some time... "
- if mktexlsr > $tempfile 2>&1 ; then
- rm -f $tempfile
- echo "done."
- else
- echo
- echo "mktexlsr failed. Output has been stored in"
- echo "$tempfile"
- echo "Please include this file if you report a bug."
- echo
- exit 1
- fi
-}
-
dhit_create_fontmaps ()
{
tempfile=$(mktemp -p /tmp updmap.XXXXXXXX)
@@ -99,18 +71,9 @@
case "$1" in
configure|abort-upgrade|abort-remove|abort-deconfigure)
- # It doesn't hurt to call all of them.
- # These programs are all in tex-common and can be run immediately.
- update-updmap --quiet
- update-language
- update-fmtutil
# All of the following needs an installed and configured
# basic TeX system, so check this.
if dhit_libkpathsea_configured; then
- # mktexlsr may not be present
- if which mktexlsr >/dev/null; then
- dhit_update_lsr_files
- fi
for i in #WHATTODO# ; do
if [ "$i" = map ] ; then
if which updmap-sys >/dev/null; then
Added: tex-common/trunk/scripts/postinst-texlsr
===================================================================
--- tex-common/trunk/scripts/postinst-texlsr (rev 0)
+++ tex-common/trunk/scripts/postinst-texlsr 2006-10-24 08:56:54 UTC (rev 1887)
@@ -0,0 +1,66 @@
+#
+# postinst-texlsr
+#
+# postinst snippets for calling maketexlsr, update-*
+#
+# Authors:
+# Florent Rougon <f.rougon at free.fr>
+# Norbert Preining <preining at logic.at>
+#
+# Please note that comments in this file are stripped before installation
+# by calling a grep -v '^[ \t]*#'
+# So please be careful if you add stuff here!
+#
+# Let vim know that we don't want tabs
+# vim:set expandtab: #
+
+
+# Tell if kpsewhich works. If this is the case:
+#
+# 1. kpsewhich is installed and;
+#
+# 2. libkpathsea is configured.
+dhit_libkpathsea_configured ()
+{
+ kpsewhich --version >/dev/null 2>&1
+}
+
+dhit_update_lsr_files ()
+{
+ tempfile=$(mktemp -p /tmp mktexlsr.XXXXXXXX)
+ printf "Running mktexlsr. This may take some time... "
+ if mktexlsr #TEXMFTREES# > $tempfile 2>&1 ; then
+ rm -f $tempfile
+ echo "done."
+ else
+ echo
+ echo "mktexlsr failed. Output has been stored in"
+ echo "$tempfile"
+ echo "Please include this file if you report a bug."
+ echo
+ exit 1
+ fi
+}
+
+case "$1" in
+ configure|abort-upgrade|abort-remove|abort-deconfigure)
+ # It doesn't hurt to call all of them.
+ # These programs are all in tex-common and can be run immediately.
+ update-updmap --quiet
+ update-language
+ update-fmtutil
+ # All of the following needs an installed and configured
+ # basic TeX system, so check this.
+ if dhit_libkpathsea_configured; then
+ # mktexlsr may not be present
+ if which mktexlsr >/dev/null; then
+ dhit_update_lsr_files
+ fi
+ fi
+ ;;
+
+ *)
+ echo "postinst called with unknown argument '$1'" >&2
+ exit 1
+ ;;
+esac
Modified: tex-common/trunk/scripts/postrm-tex
===================================================================
--- tex-common/trunk/scripts/postrm-tex 2006-10-23 20:22:16 UTC (rev 1886)
+++ tex-common/trunk/scripts/postrm-tex 2006-10-24 08:56:54 UTC (rev 1887)
@@ -1,7 +1,7 @@
#
# postrm-tex
#
-# postinst snippets for installing stuff for TeX
+# postrm snippets for registering hyphenation patterns, font maps, and formats
#
# Authors:
# Florent Rougon <f.rougon at free.fr>
@@ -14,17 +14,6 @@
# Let vim know that we don't want tabs
# vim:set expandtab: #
-
-# Tell if kpsewhich works. If this is the case:
-#
-# 1. kpsewhich is installed and;
-#
-# 2. libkpathsea is configured.
-dhit_libkpathsea_configured ()
-{
- kpsewhich --version >/dev/null 2>&1
-}
-
dhit_check_run_without_errors ()
{
silent=0
@@ -91,15 +80,6 @@
case "$1" in
remove|disappear)
- # It doesn't hurt to call all of them.
- dhit_check_run_without_errors -silent update-updmap --quiet
- dhit_check_run_without_errors -silent update-language
- dhit_check_run_without_errors -silent update-fmtutil
- # The mktexlsr call needs an installed and configured basic TeX
- # system, so check this.
- if dhit_libkpathsea_configured; then
- dhit_check_run_without_errors mktexlsr
- fi
for i in #WHATTODO# ; do
if [ "$i" = map ] ; then
dhit_libkpathsea_configured && \
Added: tex-common/trunk/scripts/postrm-texlsr
===================================================================
--- tex-common/trunk/scripts/postrm-texlsr (rev 0)
+++ tex-common/trunk/scripts/postrm-texlsr 2006-10-24 08:56:54 UTC (rev 1887)
@@ -0,0 +1,79 @@
+#
+# postrm-texlsr
+#
+# postrm snippets for calling mktexlsr and update-*
+#
+# Authors:
+# Florent Rougon <f.rougon at free.fr>
+# Norbert Preining <preining at logic.at>
+#
+# Please note that comments in this file are stripped before installation
+# by calling a grep -v '^[ \t]*#'
+# So please be careful if you add stuff here!
+#
+# Let vim know that we don't want tabs
+# vim:set expandtab: #
+
+
+# Tell if kpsewhich works. If this is the case:
+#
+# 1. kpsewhich is installed and;
+#
+# 2. libkpathsea is configured.
+dhit_libkpathsea_configured ()
+{
+ kpsewhich --version >/dev/null 2>&1
+}
+
+dhit_check_run_without_errors ()
+{
+ silent=0
+ if [ "$1" = "-silent" ] ; then
+ silent=1
+ shift
+ fi
+ if which "$1" >/dev/null; then
+ tempfile=$(mktemp -p /tmp checkrun.XXXXXXXX)
+ if [ $silent = 0 ] ; then
+ printf "Running $*. This may take some time..."
+ fi
+ set +e
+ if "$@" > $tempfile 2>&1 ; then
+ rm -f $tempfile
+ [ $silent = 0 ] && echo " done."
+ else
+ echo
+ echo "$* failed. Output has been stored in"
+ echo "$tempfile"
+ echo "If tex-common is not configured you can ignore this error" \
+ "message!"
+ echo "Otherwise, please include this file if you report a bug."
+ echo
+ fi
+ set -e
+ fi
+
+ return 0
+}
+
+case "$1" in
+ remove|disappear)
+ # It doesn't hurt to call all of them.
+ dhit_check_run_without_errors -silent update-updmap --quiet
+ dhit_check_run_without_errors -silent update-language
+ dhit_check_run_without_errors -silent update-fmtutil
+ # The mktexlsr call needs an installed and configured basic TeX
+ # system, so check this.
+ if dhit_libkpathsea_configured; then
+ dhit_check_run_without_errors mktexlsr #TEXMFTREES#
+ fi
+ ;;
+
+ purge|upgrade|failed-upgrade|abort-upgrade|abort-install)
+ ;;
+
+ *)
+ echo "postrm called with unknown argument '$1'" >&2
+ exit 1
+ ;;
+esac
More information about the Debian-tex-commits
mailing list