portmaster supports using sudo when doing port upgrades. However, this could be a problem when sudo itself is being updated, as when sudo is removed before installing the new package, the system will lose the ability of doing 'sudo'. It may be a good idea to make portmaster to do some special handling for security/sudo so that it can finish the updates without human intervention.
Auto-assigned to maintainer bdrewery@FreeBSD.org
I'm not really working on portmaster much. If you want to provide a patch against the github, I will merge it in. https://github.com/freebsd/portmaster
Assignee is no longer the maintainer.
simple answer portmaster -m USES=fakeroot sudo or portmaster -m USES=uidfix sudo
sorry, this was wrong and did not work.
PM has a new maintainer, reassign PR.
I agree that there is a problem if sudo is deleted while being required to reinstall it. One solution could be, to perform the deinstall and install steps within one sudo process (which must not be interrupted, or you'll end up on a system without sudo). It might also be possible to always link sudo to e.g. sudo~ before deinstalling a package and then use sudo~ for the installation of the new package (and delete it thereafter). I'll try to get something implemented along these lines, but cannot promise a date, since more urgent problems in portmaster have priority.