Bug 69266 - www/squid delete existing files when "make deinstall"
Summary: www/squid delete existing files when "make deinstall"
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-07-19 08:01 UTC by TsurutaniNaoki
Modified: 2004-07-25 17:40 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 TsurutaniNaoki 2004-07-19 08:01:06 UTC
	www/squid removes many files in $PREFIX/etc/squid when it is deinstalled.
	This port has no pkg-plist, and generate it in Makefile.
	It seems to me that the generating way is simple listing of
	existing files just after installation.
	But this procedure includes foreign files from www/squid.
	MD5 checksums are also recorded, so changed files are not removed,
	but many files that are not changed, cf. configuration files, are
	removed.

Fix: 

I don't know, but I think the way of generating PLIST should be improved.
How-To-Repeat: 	always.
Comment 1 edwin 2004-07-19 08:13:35 UTC
On Mon, Jul 19, 2004 at 04:00:04PM +0900, Tsurutani Naoki wrote:
> 	www/squid removes many files in $PREFIX/etc/squid when it is deinstalled.

Actually, it only removes:
	etc/rc.d/squid.sh
	etc/squid/mib.txt
	etc/squid/mime.conf.default
	etc/squid/msntauth.conf.default
	etc/squid/squid.conf.default

And the icons and errors directory.
If you want to customize the error-messages, copy the directory of
your native language first to a new one and use that one (don't
forget to update your squid.conf about this)

Edwin

-- 
Edwin Groothuis      |            Personal website: http://www.mavetju.org
edwin@mavetju.org    |          Weblog: http://weblog.barnet.com.au/edwin/
Comment 2 TsurutaniNaoki 2004-07-19 08:43:22 UTC
Edwin Groothuis <edwin@mavetju.org> wrote:

> On Mon, Jul 19, 2004 at 04:00:04PM +0900, Tsurutani Naoki wrote:
> > 	www/squid removes many files in $PREFIX/etc/squid when it is deinstalled.
> 
> Actually, it only removes:
> 	etc/rc.d/squid.sh
> 	etc/squid/mib.txt
> 	etc/squid/mime.conf.default
> 	etc/squid/msntauth.conf.default
> 	etc/squid/squid.conf.default
> 
> And the icons and errors directory.
> If you want to customize the error-messages, copy the directory of
> your native language first to a new one and use that one (don't
> forget to update your squid.conf about this)

Sorry, I wrote inaccurately.
I put files in icons/ and errors/, and I lost them.
I want to put them there, and the port should deinstall 
only what it had installed, I think.
Comment 3 tmseck-lists 2004-07-19 18:47:39 UTC
* Tsurutani Naoki <turutani@scphys.kyoto-u.ac.jp>:

>>Description:
>        www/squid removes many files in $PREFIX/etc/squid when it is deinstalled.
>        This port has no pkg-plist, and generate it in Makefile.
>        It seems to me that the generating way is simple listing of
>        existing files just after installation.
>        But this procedure includes foreign files from www/squid.
>        MD5 checksums are also recorded, so changed files are not removed,
>        but many files that are not changed, cf. configuration files, are
>        removed.

Oops. I admit I did not think about this case when I switched to dynamic
plist creation since I used to use a copy of the original directories
for modifications.

>>How-To-Repeat:
>        always.

Fortunately, you can avoid this.

If you want to customize your icons and/or the error pages, just put
these modified directories where the PLIST creation script
does not look for them.  Then use the 'icon_directory' and
'error_directory' configuration options to tell squid where your custom
files live. This will preserve them.

>        
>>Fix:
>        I don't know, but I think the way of generating PLIST should be improved.

I see the problem, but the only sure-fire way to avoid this would be to
stage a fake installation first, create the package list and then copy
this installation into the PREFIX dir, like firefox does. I am not
really fond of this and I would like to avoid it. Mind you that other
ports suffer from the same problem, e.g. vim. And while this will
preserve locally added files, it will still end in modified files being
overwritten on every update.
Comment 4 TsurutaniNaoki 2004-07-23 13:00:42 UTC
tmseck-lists@netcologne.de (Thomas-Martin Seck) wrote:

> >>Fix:
> >        I don't know, but I think the way of generating PLIST should be improved.
> 
> I see the problem, but the only sure-fire way to avoid this would be to
> stage a fake installation first, create the package list and then copy
> this installation into the PREFIX dir, like firefox does. I am not
> really fond of this and I would like to avoid it. Mind you that other
> ports suffer from the same problem, e.g. vim. And while this will
> preserve locally added files, it will still end in modified files being
> overwritten on every update.

I wonder why all files are not listed in Makefile.
There are many compile options, indeed, but the content of icons directory does not
differ, as I guess, and errors files are also same except the choice of language.
The following patch will solve the problem (at least on my host).
If you have another reason not to adopt the following way, please tell me.

--- /usr/ports/www/squid/Makefile.orig	Fri Jul 23 05:07:31 2004
+++ /usr/ports/www/squid/Makefile	Fri Jul 23 20:45:13 2004
@@ -311,6 +311,29 @@
 	@${SETENV} squid_user=${SQUID_UID} squid_group=${SQUID_GID} \
 	    PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
 
+# prepare for plist
+ICON_FILES=	anthony-binhex.gif anthony-bomb.gif anthony-box.gif \
+		anthony-box2.gif anthony-c.gif anthony-compressed.gif \
+		anthony-dir.gif anthony-dirup.gif anthony-dvi.gif \
+		anthony-f.gif anthony-image.gif anthony-image2.gif \
+		anthony-layout.gif anthony-link.gif anthony-movie.gif \
+		anthony-pdf.gif anthony-portal.gif anthony-ps.gif \
+		anthony-quill.gif anthony-script.gif anthony-sound.gif \
+		anthony-tar.gif anthony-tex.gif anthony-text.gif \
+		anthony-unknown.gif anthony-xbm.gif anthony-xpm.gif
+
+ERROR_FILES=	ERR_ACCESS_DENIED ERR_CACHE_ACCESS_DENIED \
+		ERR_CACHE_MGR_ACCESS_DENIED ERR_CANNOT_FORWARD \
+		ERR_CONNECT_FAIL ERR_DNS_FAIL ERR_FORWARDING_DENIED \
+		ERR_FTP_DISABLED ERR_FTP_FAILURE ERR_FTP_FORBIDDEN \
+		ERR_FTP_NOT_FOUND ERR_FTP_PUT_CREATED \
+		ERR_FTP_PUT_ERROR ERR_FTP_PUT_MODIFIED \
+		ERR_FTP_UNAVAILABLE ERR_INVALID_REQ ERR_INVALID_URL \
+		ERR_LIFETIME_EXP ERR_NO_RELAY ERR_ONLY_IF_CACHED_MISS \
+		ERR_READ_ERROR ERR_READ_TIMEOUT ERR_SHUTTING_DOWN \
+		ERR_SOCKET_FAILURE ERR_TOO_BIG ERR_UNSUP_REQ \
+		ERR_URN_RESOLVE ERR_WRITE_ERROR ERR_ZERO_SIZE_OBJECT
+
 post-install:
 .if defined(WITH_SQUID_PINGER)
 	${CHMOD} 4510 ${PREFIX}/libexec/squid/pinger; \
@@ -327,12 +350,14 @@
 	@cd ${PREFIX} && ${FIND} libexec/squid -type f -o -type l | ${SORT} \
 	    >>${TMPPLIST}
 	@${ECHO_CMD} "@dirrm libexec/squid" >>${TMPPLIST}
-	@cd ${PREFIX} && ${FIND} etc/squid/icons -type f -o -type l | ${SORT} \
-	    >>${TMPPLIST}
+.for i in ${ICON_FILES}
+	@${ECHO_CMD} "etc/squid/icons/${i}" >>${TMPPLIST}
+.endfor
 	@${ECHO_CMD} "@dirrm etc/squid/icons" >>${TMPPLIST}
 .for d in ${SQUID_LANGUAGES}
-	@cd ${PREFIX} && ${FIND} etc/squid/errors/${d} -type f | ${SORT} \
-	    >>${TMPPLIST}
+.for f in ${ERROR_FILES}
+	@${ECHO_CMD} "etc/squid/errors/${d}/${f}" >>${TMPPLIST}
+.endfor
 	@${ECHO_CMD} "@dirrm etc/squid/errors/${d}" >>${TMPPLIST}
 .endfor
 	@${ECHO_CMD} "@unexec rmdir %D/etc/squid/errors 2>/dev/null || true" \
Comment 5 tmseck-lists 2004-07-23 13:19:21 UTC
* Tsurutani Naoki (turutani@scphys.kyoto-u.ac.jp):

> I wonder why all files are not listed in Makefile.

...

Thanks for your input!

I worked on this myself and my solution was to move all static parts of
the package list back to pkg-plist. Adding the language specific error
pages would be done in a loop over the selected languages using a
hardcoded list of "official" file names, just like you propose. I'll
submit an update soon. Thanks again for spotting the problem!
Comment 6 Pav Lucistnik freebsd_committer freebsd_triage 2004-07-25 17:40:05 UTC
State Changed
From-To: open->closed

This should be fixed in revision 2.5.6_3 of the port.