portmaster deletes failed ports

B Briggs rcbdyndns at bellsouth.net
Tue Sep 5 19:21:56 UTC 2006

Doug Barton 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.
> It's easy enough to 'echo BACKUP=yes >> ~/.portmasterrc' (or
> /etc/portmaster.rc) and then do the restore yourself if it's a port that you
> consider mission critical. If you're going to add that to the rc file, I
> suggest you also do 'mkdir -p /usr/ports/packages/All' and that way you'll
> always know where your backups are.
> hth,
> Doug

Doug, I'm sorry, I love your script, but I my thoughts are that you need 
to rethink this.

The problem is that if unattended, you will not know if the port was 
deleted especially if you have a lot of output. This can lead to a lot 
of other problems. I've looked at the script, and it seems that you 
could break it down into (something like) these steps:

make (check return code, if it doesn't build, report error) and continue 
script as normal.
pkg_create -b original_package_name pathto/whereveryou_wanttobackit_up)
make deinstall
make install clean (if it returns OK, delete the backed up package, 
otherwise, use pkg_add from the backup)

I've probably missed some intermediate steps, but I like portmaster much 
better than portupgrade, and I hope you take the time to consider this.
B Briggs

More information about the freebsd-ports mailing list