Bug 110512

Summary: [PATCH] ftp/wget: disallow removing modified wgetrc file on deinstall
Product: Ports & Packages Reporter: Alexander Logvinov <ports>
Component: Individual Port(s)Assignee: Vasil Dimov <vd>
Status: Closed FIXED    
Severity: Affects Only Me CC: vd
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Alexander Logvinov 2007-03-19 11:40:06 UTC
  Disallow removing modified ${PREFIX}/etc/wgetrc file on deinstall
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2007-03-19 11:40:16 UTC
Responsible Changed
From-To: freebsd-ports-bugs->vd

Over to maintainer
Comment 2 Vasil Dimov freebsd_committer freebsd_triage 2007-03-27 21:15:38 UTC
State Changed
From-To: open->feedback

etc/wgetrc is not removed on deinstall if modified. 
Can you please, describe the steps to reproduce this.
Comment 3 Alexander Logvinov 2007-03-27 22:04:42 UTC
Hello!

Wednesday, March 28, 2007, 6:17:09 AM, you wrote:

> etc/wgetrc is not removed on deinstall if modified.
> Can you please, describe the steps to reproduce this.
 But how about "etc/wgetrc" line in pkg-plist file?

# cd /usr/ports/ftp/wget
# make install clean
# ls -l /usr/local/etc/wgetrc
-r--r--r--  1 root  wheel  4224 Mar 28 07:00 /usr/local/etc/wgetrc
# echo "test" >> /usr/local/etc/wgetrc
# make deinstall
===>  Deinstalling for ftp/wget
===>   Deinstalling wget-1.10.2
pkg_delete: '/usr/local/etc/wgetrc' fails original MD5 checksum - deleted anyway.
# ls -l /usr/local/etc/wgetrc
ls: /usr/local/etc/wgetrc: No such file or directory

--
WBR
Comment 4 Vasil Dimov freebsd_committer freebsd_triage 2007-03-31 21:34:33 UTC
On Wed, Mar 28, 2007 at 07:04:42 +1000, Alexander Logvinov wrote:
> Hello!
> 
> Wednesday, March 28, 2007, 6:17:09 AM, you wrote:
> 
> > etc/wgetrc is not removed on deinstall if modified.
> > Can you please, describe the steps to reproduce this.
>  But how about "etc/wgetrc" line in pkg-plist file?

Alexander,

I am very sorry for being so late with my responses.

The thing I am concerned about is that usually in this case the
solution would be to install etc/wgetrc.sample, so the user can copy
this file to etc/wgetrc if he needs to make any changes. Upon
installation/deinstallation etc/wgetrc.sample is overwritten/removed.

Can you create a patch that makes wget install its config file to
etc/wgetrc.sample and change the corresponding plist line?

-- 
Vasil Dimov
moc.elcaro@vomid.lisav        Software Developer @ Oracle/Innobase Oy
gro.DSBeerF@dv                Committer @ FreeBSD.org
gro.d5v@dv                    Home @ Sofia, Bulgaria
Comment 5 Alexander Logvinov 2007-04-02 06:48:30 UTC
Hello!

Sunday, April 1, 2007, 6:34:33 AM, you wrote:

>> > etc/wgetrc is not removed on deinstall if modified.
>> > Can you please, describe the steps to reproduce this.
>>  But how about "etc/wgetrc" line in pkg-plist file?
> I am very sorry for being so late with my responses.
 No problem!

> The thing I am concerned about is that usually in this case the
> solution would be to install etc/wgetrc.sample, so the user can copy
> this file to etc/wgetrc if he needs to make any changes. Upon
> installation/deinstallation etc/wgetrc.sample is overwritten/removed.
> Can you create a patch that makes wget install its config file to
> etc/wgetrc.sample and change the corresponding plist line?
 But why original patch doesn't suit you? :) I think it makes everything that you want. :)

 There is a check for modification of etc/wgetrc file in wget's gmake Makefile:

 1) If etc/wgetrc doesn't exist Makefile of wget creates etc/wgetrc from doc/sample.wgetrc and then Makefile of ports copies it to etc/wgetrc.dist (or .sample).

 2) doc/sample.wgetrc is copied to wgetrc.new and don't overwrite etc/wgetrc if etc/wgetrc exists and modified. We only move etc/wgetrc.new to etc/wgetrc.dist (or .sample) and don't touch etc/wgetrc.


--
WBR
Comment 6 Vasil Dimov freebsd_committer freebsd_triage 2007-04-11 20:39:27 UTC
State Changed
From-To: feedback->closed

A fix that installs wgetrc as wgetrc.sample has been committed. 
The proposed solution is a way too complex. 
Thanks for the inspiration!