diff options
author | Chris Lawrence <lawrencc@debian.org> | 2009-03-01 16:38:43 -0600 |
---|---|---|
committer | Didier Raboud <didier@raboud.com> | 2010-05-23 00:08:51 +0200 |
commit | baa466e277f28aca7e9a27d7fd30c193d1996c0f (patch) | |
tree | ca85346175613573f3842d991473df8ab066d490 /debian/foomatic-filters.postinst | |
parent | f56211f0ff4ddf9371ebc4c31e8f95df1fc81a5c (diff) |
Imported Debian patch 4.0-20090301-1debian/4.0-20090301-1
Diffstat (limited to 'debian/foomatic-filters.postinst')
-rw-r--r-- | debian/foomatic-filters.postinst | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/debian/foomatic-filters.postinst b/debian/foomatic-filters.postinst new file mode 100644 index 0000000..bc30bff --- /dev/null +++ b/debian/foomatic-filters.postinst @@ -0,0 +1,108 @@ +#!/bin/bash -e + +# Source debconf library. +. /usr/share/debconf/confmodule + +readonly FILTERCONF=/etc/foomatic/filter.conf +readonly FILTERBACK=$FILTERCONF.debconf-old +readonly tempfile=`tempfile -pfoomatic-filters-` + +function parseconfig +{ + db_clear + eval $(/usr/bin/perl /usr/share/foomatic/parseconfig.pl) +} + +db_get foomatic-filters/config_parsed +if [ $RET = false ]; then + parseconfig + db_set foomatic-filters/config_parsed true +fi + +db_get foomatic-filters/filter_debug +debug="debug: 0" +if [ $RET = true ]; then + debug="debug: 1" +fi + +db_get foomatic-filters/textfilter +if [ "$RET" = Automagic ]; then + textfilter="# textfilter:" +else + if [ "$RET" = Custom ]; then + db_get foomatic-filters/custom_textfilter + fi + textfilter="textfilter: $RET" +fi + +# Disable the whole customized Ghostscript stuff +gspath="# gspath: gs" + +db_get foomatic-filters/ps_accounting +if [ $RET = true ]; then + ps_accounting="ps_accounting: 1" +else + ps_accounting="ps_accounting: 0" +fi + +db_get foomatic-filters/spooler +echo "$RET" >| /etc/foomatic/defaultspooler + +cat <<EOF >| $tempfile +# This file allows you to configure the "foomatic-rip" filter. + +# You can force reconfiguration managed via debconf by running the +# following command: +# dpkg-reconfigure foomatic-filters +# You may need to change the lowest priority of questions to be presented +# using the switch "-p" to access some or any of these options. + +# Command for converting text files to PostScript. +# +# Priority low +$textfilter + +# Enable debug output into a logfile in /tmp/foomatic-rip.log. +# It will contain status from this filter, plus Ghostscript stderr output. +# +# WARNING: This logfile is a potential security hole; do not use in production. +# +# Priority low +$debug + +# Enable insertion of PostScript code for accounting into each printjob. +# Currently only supported with CUPS. (EXPERIMENTAL) +# +# NOTE: Enabling this option may cause extra pages to be printed after each +# job as well as after banner pages, especially with generic +# PostScript printers. +# +# Priority low +$ps_accounting + +# Path to the Ghostscript interpreter; will search the path for 'gs' if +# not specified. +# +# Priority low +$gspath + +EOF + +if [ -e $FILTERCONF ]; then + chmod --reference=$FILTERCONF $tempfile +else + chmod 0644 $tempfile +fi + +ucf --three-way --debconf-ok $tempfile $FILTERCONF + +db_stop + +# Remove the temporary file +rm -f $tempfile + +#DEBHELPER# + +### Local Variables: +### tab-width: 4 +### End: |