Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Sep 2006 20:17:29 -0700 (PDT)
From:      "Freddie Cash" <fcash@ocis.net>
To:        ports@freebsd.org
Subject:   Re: portmaster deletes failed ports
Message-ID:  <60494.24.71.118.34.1157599049.squirrel@webmail.sd73.bc.ca>
In-Reply-To: <op.tff6qjqvzq5pz4@sovaio.netoldies.com>
References:  <44FC4303.4050600@gmail.com> <200609042118.09134.list-freebsd-2004@morbius.sent.com> <44FC9527.6000802@gmail.com> <200609050048.57718.list-freebsd-2004@morbius.sent.com> <20060905104831.GF89080@leia.lambermont.dyndns.org> <44FDAF66.7090701@FreeBSD.org> <op.tff6qjqvzq5pz4@sovaio.netoldies.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, September 6, 2006 1:19 am, Bill Blue wrote:
> On Tue, 05 Sep 2006 10:09:58 -0700, Doug Barton <dougb@FreeBSD.org>
> wrote:
>> Hans Lambermont wrote:
>>> RW wrote:
>>>> I don't use portmaster myself, but I just took a look at the
>>>> script and, unless I'm missing something, it does appear that
>>>> this feature is missing from portmaster. There an option to
>>>> create backup packages, but nothing to automatically restore the
>>>> previous version if the install fails.

>>> I can confirm this. The auto-restore-backup would be a nice
>>> feature. Doug ?  ;-)

>> I'm extremely reluctant to start trying to think for the user. Down
>> that path lies madness.

Good.  Programs should do what the user tells them to, not try and
guess what the user might want and try to be overly helpful in doing
strange and mysterious things.  If the install fails, then error out
with a nice message.  Let the user decide what to do after that.

Perhaps making -b a default option would be useful so that there's
always something to fall back on.  But please don't try and
automatically fix things that may or may not be fixable.

> On Tue, 05 Sep 2006 14:47:03 -0700, Doug Barton <dougb@FreeBSD.org>
> wrote:
>>> The problem is that if unattended, you will not know if the port
>>> was deleted especially if you have a lot of output.
>> I should have added in my previous reply that your statement above
>> is not accurate. If the install fails, that invocation of portmaster
>> will fail, which will cause all/any parent portmaster processes
>> above it to fail as well. Thus, in the event that a port fails to
>> install, the user will be notified of it immediately, and no further
>> actions will be taken.

This is why blindly running -a is not recommended.  A good habit to
get into is to develop an upgrade procedure that does not include -a. 
Something along the lines of:
  - portsnap fetch update
  - portaudit -Fda
  - pkg_version -vl '<' > ports-with-updates
  - more ports-with-updates
  - more /usr/ports/UPDATING
  - portmaster -b port1 port2 port3 port4 ...
Just because a port update is available is not a good reason to
blindly upgrade every single installed port.

> If portmaster could detect ( as a result of errors that cause it to
> stop ) what the likely cause might be, couldn't it advise the user
> what to try?

A nice error message would be good, *if* it is possible to determine
what the "error" is.

> I could be wrong, but it seems as though what is causing at least
> some of the deletions, is the /var/db/pkg database/fields not being
> accurate to the system, which can happen for a variety of reasons.
> Should portmaster notice this type of discrepancy, couldn't it
> suggest to the user that running 'pkgdb -F' or equivalent would be a
> really good idea before continuing?

pkgdb -F will not help portmaster in any way shape or form.  pkgdb is
a portupgrade tool that reads the files under /var/db/pkg and creates
the /var/db/pkg/pkgdb.db file.  Only the portupgrade tools use that
files.

> Is the addition of a portmaster -resume option a possibility after
> whatever problem caused the stop had been fixed?  Running from
> scratch each time, even in unattended mode, still means you have to
> wade through config screens over and over.

I thought portmaster used config-recursive starting with 1.6 or
thereabouts, so you only go through the config screens once at the
start of the run.

> It's not a big deal for the seasoned FreeBSD admin, but there's a lot
> of us that are relatively new to port and pkg management in general
> and may not yet understand the subtle differences between using
> portmaster vs three or four other methods of updating.

And these are the people who should not be using -a.  :)  These are
the people that should be using -b at all times.  And these are the
people that should only be upgrading 1 or 2 ports at a time, after
doing a lot of reading beforehand.  :)

----
Freddie Cash
fcash@ocis.net




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?60494.24.71.118.34.1157599049.squirrel>