Bug 70195 - [SW-BUG] Every update of print/cups-base overwrites the configuration files
Summary: [SW-BUG] Every update of print/cups-base overwrites the configuration files
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-09 05:10 UTC by John Merryweather Cooper
Modified: 2004-08-12 15:07 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Merryweather Cooper 2004-08-09 05:10:21 UTC

To print graphics (i.e., from Gimp), or for best performance serving Windows clients, raw printing should be enabled.  The default for /usr/local/etc/cups/mime.convs and /usr/local/etc/cups/mime.types is to disable raw printing.  That's fine, only one line changes to each file are necessary to enable raw printing.  However, each recompile or update of print/cups-base overwrites these two files--disabling printing on my network.

Fix: 

Workaround:  I maintain backup copies of mime.convs and mime.types.  When print/cups-base overwrites these files, I overwrite the overwrites.  :)

A better solution would be to teach print/cups-base not to modify these files if they already exist.  These two files are crucial to a properly working CUPS server.
How-To-Repeat: 

Convigure mime.convs and mime.types for raw printing.  Re-install print/cups-base and watch as it overwrites your configuration file--breaking your configuration--100% of the time.
Comment 1 Volker Stolz freebsd_committer freebsd_triage 2004-08-10 13:37:18 UTC
John, it looks like there's some magic for this in the  
post-install-target, although as you observe it isn't applied to mime*.

Volker
Comment 2 Volker Stolz freebsd_committer freebsd_triage 2004-08-10 13:37:39 UTC
State Changed
From-To: open->feedback

Forwarded PR to maintainer
Comment 3 Akifyev Sergey 2004-08-12 12:06:43 UTC
On Tue, 2004-08-10 at 16:37, Volker Stolz wrote:
I've applied this magick to mime.types and mime.convs .
Look like previous maintainer thought it isn't necessary for theese
files, because all users would use defaults. I don't see anything bad in
checking theese files before overwriting, so here's the patch:

====[ cups-base.diff start
diff -ruN cups-base.orig/Makefile cups-base/Makefile
--- cups-base.orig/Makefile	Tue Aug  3 13:28:52 2004
+++ cups-base/Makefile	Thu Aug 12 14:53:57 2004
@@ -40,13 +40,10 @@
 
 post-install:
 	${MKDIR} ${CUPS_ETCDIR}
-.for f in classes.conf client.conf cupsd.conf printers.conf
+.for f in classes.conf client.conf cupsd.conf printers.conf mime.convs
mime.types
 	${INSTALL_DATA} ${WRKSRC}/conf/${f} ${CUPS_ETCDIR}/${f}.N
 	cd ${CUPS_ETCDIR}; if test ! -f ${f}; then ${CP} -p ${f}.N ${f}; fi
 .endfor # classes.conf client.conf cupsd.conf printers.conf
-.for f in mime.convs mime.types
-	${INSTALL_DATA} ${WRKSRC}/conf/${f} ${CUPS_ETCDIR}/${f}
-.endfor # mime.convs mime.types
 	cd ${CUPS_RCDIR}; ${MV} cups cups.sh.sample
 	${FIND} ${PREFIX}/man/cat* -type l -name '*.0' -delete
 	${MKDIR} ${CUPS_SPOOLDIR} ${CUPS_SPOOLDIR}/tmp
diff -ruN cups-base.orig/pkg-plist cups-base/pkg-plist
--- cups-base.orig/pkg-plist	Thu Mar 18 10:13:47 2004
+++ cups-base/pkg-plist	Thu Aug 12 14:58:46 2004
@@ -11,8 +11,12 @@
 @unexec if cmp -s %D/etc/cups/cupsd.conf.N %D/etc/cups/cupsd.conf; then
rm -f %D/etc/cups/cupsd.conf; fi
 etc/cups/cupsd.conf.N
 @exec if test ! -f %D/etc/cups/cupsd.conf; then cp -p
%D/etc/cups/cupsd.conf.N %D/etc/cups/cupsd.conf; fi
-etc/cups/mime.convs
-etc/cups/mime.types
+@unexec if cmp -s %D/etc/cups/mime.convs.N %D/etc/cups/mime.convs; then
rm -f %D/etc/cups/mime.convs; fi
+etc/cups/mime.convs.N
+@exec if test ! -f %D/etc/cups/mime.convs; then cp -p
%D/etc/cups/mime.convs.N %D/etc/cups/mime.convs; fi
+@unexec if cmp -s %D/etc/cups/mime.types.N %D/etc/cups/mime.types; then
rm -f %D/etc/cups/mime.types; fi
+etc/cups/mime.types.N
+@exec if test ! -f %D/etc/cups/mime.types; then cp -p
%D/etc/cups/mime.types.N %D/etc/cups/mime.types; fi
 @unexec if cmp -s %D/etc/cups/printers.conf.N
%D/etc/cups/printers.conf; then rm -f %D/etc/cups/printers.conf; fi
 etc/cups/printers.conf.N
 @exec if test ! -f %D/etc/cups/printers.conf; then cp -p
%D/etc/cups/printers.conf.N %D/etc/cups/printers.conf; fi
====[ cups-base.diff end

-- 
regards,
Sergey Akifyev <asa@gascom.ru>
JSC Gascom <http://www.gascom.ru>
PGP key available from:
ftp://ftp.gascom.ru/pub/PGP-keys/asa.txt
Comment 4 stolz 2004-08-12 13:22:49 UTC
On Thu, Aug 12, 2004 at 03:06:43PM +0400, Sergey Akifyev wrote:
> checking theese files before overwriting, so here's the patch:

The patch got munged (additional linebreaks), can you please resubmit
it, preferably as an attchment?

Volker
-- 
http://www-i2.informatik.rwth-aachen.de/stolz/ *** PGP *** S/MIME
L-Attriwutgrammatik
Comment 5 Volker Stolz freebsd_committer freebsd_triage 2004-08-12 15:07:10 UTC
State Changed
From-To: feedback->closed

Fixed, thanks!