portmaster deletes failed ports

Freddie Cash fcash at ocis.net
Thu Sep 7 03:17:32 UTC 2006

On Wed, September 6, 2006 1:19 am, Bill Blue wrote:
> On Tue, 05 Sep 2006 10:09:58 -0700, Doug Barton <dougb at 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 at 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

> 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 at ocis.net

More information about the freebsd-ports mailing list