5
# Source debconf library.
6
. /usr/share/debconf/confmodule
8
readonly FILTERCONF=/etc/foomatic/filter.conf
9
readonly FILTERBACK=$FILTERCONF.debconf-old
10
readonly tempfile=`tempfile -pfoomatic-filters-`
15
eval $(perl /usr/share/foomatic/parseconfig.pl)
18
db_get foomatic-filters/config_parsed
19
if [ $RET = false ]; then
21
db_set foomatic-filters/config_parsed true
24
db_get foomatic-filters/filter_debug
26
if [ $RET = true ]; then
30
db_get foomatic-filters/textfilter
31
if [ "$RET" = Automagic ]; then
32
textfilter="# textfilter:"
34
if [ "$RET" = Custom ]; then
35
db_get foomatic-filters/custom_textfilter
37
textfilter="textfilter: $RET"
40
# Disable the whole customized Ghostscript stuff
43
db_get foomatic-filters/ps_accounting
44
if [ $RET = true ]; then
45
ps_accounting="ps_accounting: 1"
47
ps_accounting="ps_accounting: 0"
50
# Since foomatic-filters #FF_PS_DEFAULT_CHANGE_VERSION# in #MOTHER_DISTRO#,
51
# the default for inserting PostScript code for CUPS' page accounting changed.
52
# This functionality is now activated by default as for problematic drivers it
53
# can be deactivated individually.
54
if dpkg --compare-versions "$2" lt-nl "#FF_PS_DEFAULT_CHANGE_VERSION#"; then
55
ps_accounting="ps_accounting: 1"
57
db_set foomatic-filters/ps_accounting true
61
db_get foomatic-filters/spooler
62
echo "$RET" >| /etc/foomatic/defaultspooler
64
cat <<EOF >| $tempfile
65
# This file allows you to configure the "foomatic-rip" filter.
67
# You can force reconfiguration managed via debconf by running the
69
# dpkg-reconfigure foomatic-filters
70
# You may need to change the lowest priority of questions to be presented
71
# using the switch "-p" to access some or any of these options.
73
# Command for converting text files to PostScript.
78
# Enable debug output into a logfile in /tmp/foomatic-rip.log.
79
# It will contain status from this filter, plus Ghostscript stderr output.
81
# WARNING: This logfile is a potential security hole; do not use in production.
86
# Enable insertion of PostScript code for accounting into each printjob.
87
# Currently only supported with CUPS. (EXPERIMENTAL)
89
# NOTE: Enabling this option may cause extra pages to be printed after each
90
# job as well as after banner pages, especially with generic
91
# PostScript printers.
96
# Path to the Ghostscript interpreter; will search the path for 'gs' if
104
if [ -e $FILTERCONF ]; then
105
chmod --reference=$FILTERCONF $tempfile
110
ucf --three-way --debconf-ok $tempfile $FILTERCONF
114
# Remove the temporary file