Bug 134714 - ports-mgmt/portupgrade deletes user data without question or backup.
Summary: ports-mgmt/portupgrade deletes user data without question or backup.
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: 2009-05-19 16:50 UTC by sec
Modified: 2012-04-12 12:08 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 sec 2009-05-19 16:50:01 UTC
This just happened to me again -- I really think it should be fixed by
now.

Portupgrade of any port where some of the ports files have been modified
deletes these files even though these changes are detected first.

The only thing you get is a message like this scrolling by:

| pkg_delete: '/usr/local/etc/munin/templates/munin-comparison-day.tmpl'
| fails original MD5 checksum - deleted anyway.

This message makes me angry every time this happens. If it knows there
is something wrong, ask me how to proceed, or at least back up the
modified file.

Yes, I know that the underlying problem lies with pkg_delete and the
"-f" option. I think it is simply wrong for portupgrade to call
pkg_delete with "-f" and blindly assume everything is ok.

Fix: 

Several options come to my mind.

a) Make pkg_delete return via exit code wether changed files were
   detected and keep the backup in this case.

b) Create an option for pkg_delete to only skip dependencies, and let
   portupgrade fail/ask the user in case this doesn't work.

c) Let portupgrade check the output from pkg_delete for these messages
   and handle the cases itself.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2009-05-20 00:11:10 UTC
Responsible Changed
From-To: freebsd-bugs->sem

Fix synopsis and assign.
Comment 2 Sergey Matveychuk freebsd_committer freebsd_triage 2009-05-20 09:54:02 UTC
man pkg_delete says:
      -f, --force
              Force removal of the package, even if a dependency is 
recorded or
              the deinstall or require script fails.

Nothing about changed files.

Even if pkg_delete will leave the file, the port overwrite it when will 
install. So, badly formed port should be fixed. Ports I've made tell 
users when deinstall something like that: "please note, the files will 
not be removed:... if you will not use the application anymore, remove 
them yourself".
-- 
Dixi.
Sem.
Comment 3 Sergey Matveychuk freebsd_committer freebsd_triage 2009-05-20 09:55:11 UTC
State Changed
From-To: open->suspended

I think it's relate to badly formed ports, not portupgrade
Comment 4 sec 2009-05-20 10:05:17 UTC
On Wed, May 20, 2009 at 12:54 +0400, Sergey Matveychuk wrote:
> man pkg_delete says:
>      -f, --force
>              Force removal of the package, even if a dependency is 
> recorded or
>              the deinstall or require script fails.
> 
> Nothing about changed files.

Yet it deletes these files.

> Even if pkg_delete will leave the file, the port overwrite it when will 
> install. So, badly formed port should be fixed. Ports I've made tell 
> users when deinstall something like that: "please note, the files will 
> not be removed:... if you will not use the application anymore, remove 
> them yourself".

The port might be wrong in that it should have installed the templates
as *.sample files I give you that. Still having FreeBSD tell you
blatantly: "You changed this file, I don't care about your work, I'll
djust delete it" makes me angry. I argue that this should be fixed. Even
considering that we never will know what files a user will change from a
port in his specific configuration.

Why are we even keeping checksums if we don't use them where they could
help?

Please don't close my PRs just because you didn't have that problem yet.

CU,
    Sec
-- 
When in doubt, invent a chinese proverb.
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2009-07-25 02:49:38 UTC
Responsible Changed
From-To: sem->ruby

sem@ has turned over maintainership of portupgrade to the ruby mailing list.
Comment 6 Philip M. Gollucci freebsd_committer freebsd_triage 2010-09-10 00:11:22 UTC
Responsible Changed
From-To: ruby->pgollucci

I will take it
Comment 7 Philip M. Gollucci freebsd_committer freebsd_triage 2010-09-10 00:14:53 UTC
State Changed
From-To: suspended->open
Comment 8 Philip M. Gollucci freebsd_committer freebsd_triage 2010-09-24 07:22:17 UTC
Responsible Changed
From-To: pgollucci->freebsd-ports-bugs

going to have enotime for the next 2 weeks, sorry
Comment 9 Steve Price freebsd_committer freebsd_triage 2011-01-03 17:19:33 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ruby

Over to maintainer(s).
Comment 10 Tilman Keskinoz freebsd_committer freebsd_triage 2011-07-25 12:48:32 UTC
State Changed
From-To: open->suspended

Correct state is suspended. 

This is not only a bug in portupgrade but a general problem of the  
ports collection
Comment 11 Philip M. Gollucci freebsd_committer freebsd_triage 2012-02-22 05:23:21 UTC
Responsible Changed
From-To: ruby->freebsd-ports-bugs

Over to maintainer.
Comment 12 Chris Rees freebsd_committer freebsd_triage 2012-04-12 12:08:21 UTC
State Changed
From-To: suspended->closed

You're absolutely right that it's a problem, but it's with the 
referenced port.  The files should be installed as samples and copied 
over if missing.  This is not a portupgrade bug.