From avatar@brahms.mmlab.cse.yzu.edu.tw  Sun Mar 11 21:31:27 2001
Return-Path: <avatar@brahms.mmlab.cse.yzu.edu.tw>
Received: from brahms.mmlab.cse.yzu.edu.tw (brahms.mmlab.cse.yzu.edu.tw [140.138.145.183])
	by hub.freebsd.org (Postfix) with SMTP id 1F6A537B719
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 11 Mar 2001 21:31:07 -0800 (PST)
	(envelope-from avatar@brahms.mmlab.cse.yzu.edu.tw)
Received: (qmail 6177 invoked by uid 1000); 12 Mar 2001 05:31:05 -0000
Message-Id: <20010312053105.6176.qmail@brahms.mmlab.cse.yzu.edu.tw>
Date: 12 Mar 2001 05:31:05 -0000
From: avatar@mmlab.cse.yzu.edu.tw
Reply-To: avatar@mmlab.cse.yzu.edu.tw
To: FreeBSD-gnats-submit@freebsd.org
Subject: [chinese/pine4] Uninstall unnecessary configuration file during pkg_delete
X-Send-Pr-Version: 3.2

>Number:         25720
>Category:       ports
>Synopsis:       [chinese/pine4] Uninstall unnecessary configuration file during pkg_delete
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 11 21:40:01 PST 2001
>Closed-Date:    Tue Mar 13 02:05:35 PST 2001
>Last-Modified:  Tue Mar 13 02:06:16 PST 2001
>Originator:     Tai-hwa Liang
>Release:        FreeBSD 4.2-20010219-STABLE i386
>Organization:
Multimedia Laboratory at Yuan Ze University, Taiwan, R.O.C.
>Environment:

	
	FreeBSD 4.2-RELEASE i386
	FreeBSD 4.3-BETA i386

>Description:

	
	In order to prevent extra config file installed within package from
being left in local directory after pkg_delete, we have to uninstall
/usr/local/etc/pine.conf during pkg_delete if necessary.

>How-To-Repeat:

	Please check and commit the patch provided in "Fix:" section, thanks.
	

>Fix:

	
diff -ru pine4.old/pkg-plist pine4/pkg-plist
--- pine4.old/pkg-plist	Sat Oct 10 12:29:27 1998
+++ pine4/pkg-plist	Mon Mar 12 11:29:17 2001
@@ -1,3 +1,6 @@
+@unexec %D/bin/pine -conf >%D/etc/pine.conf.tmp
+@unexec if cmp -s %D/etc/pine.conf %D/etc/pine.conf.tmp; then rm -f %D/etc/pine.conf; fi
+@unexec rm -f %D/etc/pine.conf.tmp
 bin/pgpdecode
 bin/pgpencrypt
 bin/pgpsign

>Release-Note:
>Audit-Trail:

From: Clive Lin <clive@CirX.ORG>
To: avatar@mmlab.cse.yzu.edu.tw
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: ports/25720: [chinese/pine4] Uninstall unnecessary configuration file during pkg_delete
Date: Mon, 12 Mar 2001 18:17:55 +0800

 Hi,
 
     Well, I think simply add etc/pine.conf would be sufficient. If
 pine.conf isn't modified, it would be removed. If it's customized,
 pkg_delete would not remove it because the checksum would
 mismatch. How do you think ?
 
 On Mon, Mar 12, 2001 at 05:31:05AM -0000, avatar@mmlab.cse.yzu.edu.tw wrote:
 > diff -ru pine4.old/pkg-plist pine4/pkg-plist
 > --- pine4.old/pkg-plist	Sat Oct 10 12:29:27 1998
 > +++ pine4/pkg-plist	Mon Mar 12 11:29:17 2001
 > @@ -1,3 +1,6 @@
 > +@unexec %D/bin/pine -conf >%D/etc/pine.conf.tmp
 > +@unexec if cmp -s %D/etc/pine.conf %D/etc/pine.conf.tmp; then rm -f %D/etc/pine.conf; fi
 > +@unexec rm -f %D/etc/pine.conf.tmp
 >  bin/pgpdecode
 >  bin/pgpencrypt
 >  bin/pgpsign
 
 -- 
 pub  1024D/F8D2B472 2000-08-05 Clive Lin <clive@CirX.ORG>
      Key fingerprint = 7F9D 57A8 55C7 AA18 49B5  3820 570B 27F6 F8D2 B472

From: Tai-hwa Liang <avatar@mmlab.cse.yzu.edu.tw>
To: Clive Lin <clive@CirX.ORG>
Cc: <FreeBSD-gnats-submit@FreeBSD.ORG>
Subject: Re: ports/25720: [chinese/pine4] Uninstall unnecessary configuration
 file during pkg_delete
Date: Mon, 12 Mar 2001 18:32:10 +0800 (CST)

 On Mon, 12 Mar 2001, Clive Lin wrote:
 >     Well, I think simply add etc/pine.conf would be sufficient. If
 > pine.conf isn't modified, it would be removed. If it's customized,
 > pkg_delete would not remove it because the checksum would
 > mismatch. How do you think ?
 Uhh, the "-conf" argument in pine was designed to generate per-version
 specific global configuration file.
 
 IMHO, the original idea to use @exec in PLIST was to generate such version
 dependent config file without committing latest version of files/pine.conf
 every time when pine is upgraded.
 
 files/pine.conf contains only zh-pine related directive currently, not
 global config information. Actually it should be renamed to pine.conf.sample
 to prevent from confusing.
 
 >
 [...]
 >
 
 -- 
 Regards,
 
 Tai-hwa Liang <avatar@mmlab.cse.yzu.edu.tw>
 Multimedia Laboratory, Dept. of Computer Science & Engineering
 Yuan Ze University
 Taiwan, Republic of China
 

From: Clive Lin <clive@CirX.ORG>
To: Tai-hwa Liang <avatar@mmlab.cse.yzu.edu.tw>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: ports/25720: [chinese/pine4] Uninstall unnecessary configuration file during pkg_delete
Date: Mon, 12 Mar 2001 18:42:51 +0800

 Okay, I have a (probally better) idea. How about adding a 
 
 ${CAT} ${FILESDIR}/pine.conf >> ${PREFIX}/etc/pine.conf
 
 in post-install: target of chinese/pine4/Makefile ?
 
 Anyway, you're the maintainer, you make the decision :-) You could
 just decide what's the best way for your further maintaining. I'll
 commit what you want.
 
 On Mon, Mar 12, 2001 at 06:32:10PM +0800, Tai-hwa Liang wrote:
 > On Mon, 12 Mar 2001, Clive Lin wrote:
 > >     Well, I think simply add etc/pine.conf would be sufficient. If
 > > pine.conf isn't modified, it would be removed. If it's customized,
 > > pkg_delete would not remove it because the checksum would
 > > mismatch. How do you think ?
 > Uhh, the "-conf" argument in pine was designed to generate per-version
 > specific global configuration file.
 [...]
 Sorry I dont' know this.. I'm not a pine user actually :-)
 
 -- 
 pub  1024D/F8D2B472 2000-08-05 Clive Lin <clive@CirX.ORG>
      Key fingerprint = 7F9D 57A8 55C7 AA18 49B5  3820 570B 27F6 F8D2 B472

From: Tai-hwa Liang <avatar@mmlab.cse.yzu.edu.tw>
To: Clive Lin <clive@CirX.ORG>
Cc: <FreeBSD-gnats-submit@FreeBSD.ORG>
Subject: Re: ports/25720: [chinese/pine4] Uninstall unnecessary configuration
 file during pkg_delete
Date: Mon, 12 Mar 2001 20:10:23 +0800 (CST)

 On Mon, 12 Mar 2001, Clive Lin wrote:
 > Okay, I have a (probally better) idea. How about adding a
 >
 > ${CAT} ${FILESDIR}/pine.conf >> ${PREFIX}/etc/pine.conf
 >
 > in post-install: target of chinese/pine4/Makefile ?
 I've already considered above scheme; however, it seemed that the new
 appended data would overwrite previous setting in original pine.conf.
 Considering following attribute/value pair already exists in
 ${PREFIX}/etc/pine.conf:
 
 feature-list=prefer-plain-text,
         enable-arrow-navigation,
         no-enable-flag-cmd,
         enable-full-header-cmd,
         enable-suspend,
         quell-folder-internal-msg,
         quit-without-confirm
 
 After append ${FILESDIR}/pine.conf in post-install, there would be two
 "feature-list" attribute/value pair in ${PREFIX}/etc/pine.conf.
 
 feature-list=prefer-plain-text,
         enable-arrow-navigation,
         no-enable-flag-cmd,
         enable-full-header-cmd,
         enable-suspend,
         quell-folder-internal-msg,
         quit-without-confirm
 .
 .
 .
 feature-list=quit-without-confirm
 
 The later would 'overwrite' the former during Pine execution
 unfortunately...
 
 >
 [...]
 >
 Maybe the better approach should be use '-P' to merge those changes:
 
 	${PREFIX}/bin/pine -P files/pine.conf -conf >${WRKSRC}/pine.conf
 
 However, it seemd that above combination didn't work in current
 version of Pine(I've submitted the patch to Pine dev. team hours ago, not
 yet received any respond).
 
 -- 
 Regards,
 
 Tai-hwa Liang <avatar@mmlab.cse.yzu.edu.tw>
 Multimedia Laboratory, Dept. of Computer Science & Engineering
 Yuan Ze University
 Taiwan, Republic of China
 
State-Changed-From-To: open->closed 
State-Changed-By: clive 
State-Changed-When: Tue Mar 13 02:05:35 PST 2001 
State-Changed-Why:  
Patch committed, thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=25720 
>Unformatted:
