From a6cf6a4b2c668370cc038405aed2b8e7e3811fe7 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Wed, 18 Aug 2010 13:38:43 +0200 Subject: Substitute the fallacious use of dpkg-vendor in the postinst by build-time distro detection. --- debian/foomatic-filters.postinst | 122 --------------------------------------- 1 file changed, 122 deletions(-) delete mode 100644 debian/foomatic-filters.postinst (limited to 'debian/foomatic-filters.postinst') diff --git a/debian/foomatic-filters.postinst b/debian/foomatic-filters.postinst deleted file mode 100644 index 687523a..0000000 --- a/debian/foomatic-filters.postinst +++ /dev/null @@ -1,122 +0,0 @@ -#!/bin/bash - -set -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 $(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 - -# Since foomatic-filters 3.0.2-20070719-0ubuntu1 in Ubuntu and -# since foomatic-filters 4.0.5-1 in Debian, the default for inserting -# PostScript code for CUPS' page accounting changed. This functionality -# is now activated by default as for problematic drivers it can be -# deactivated individually -if dpkg --compare-versions "$2" lt-nl "4.0.5-1" || (dpkg --compare-versions "$2" lt-nl "3.0.2-20070719-0ubuntu1" && dpkg-vendor --derives-from Ubuntu); then - ps_accounting="ps_accounting: 1" - RET=true - db_set foomatic-filters/ps_accounting true -fi - - -db_get foomatic-filters/spooler -echo "$RET" >| /etc/foomatic/defaultspooler - -cat <| $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: -- cgit v1.2.3