Bug 197805

Summary: ports-mgmt/portmaster: Special handling of sudo
Product: Ports & Packages Reporter: Xin LI <delphij>
Component: Individual Port(s)Assignee: Stefan Eßer <se>
Status: Open ---    
Severity: Affects Some People CC: se, w.schwarzenfeld
Priority: --- Keywords: feature, needs-patch, needs-qa
Version: Latest   
Hardware: Any   
OS: Any   

Description Xin LI freebsd_committer 2015-02-18 20:30:03 UTC
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.
Comment 1 Bugzilla Automation freebsd_committer 2015-02-18 20:30:03 UTC
Auto-assigned to maintainer bdrewery@FreeBSD.org
Comment 2 Bryan Drewery freebsd_committer 2015-02-18 20:53:06 UTC
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
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2015-04-25 16:09:31 UTC
Assignee is no longer the maintainer.
Comment 4 w.schwarzenfeld 2016-02-09 01:02:10 UTC
simple answer

portmaster -m USES=fakeroot sudo  or
portmaster -m USES=uidfix sudo
Comment 5 w.schwarzenfeld 2016-02-09 01:41:07 UTC
sorry, this was wrong and did not work.
Comment 6 John Marino freebsd_committer 2016-02-10 18:47:20 UTC
PM has a new maintainer, reassign PR.
Comment 7 Stefan Eßer freebsd_committer 2017-12-18 16:56:06 UTC
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.