Bug 237061

Summary: port-mgmt/portmaster: Portmaster behaviour may depend on what is in the current working directory
Product: Ports & Packages Reporter: Philippe Michel <philippe.michel7>
Component: Individual Port(s)Assignee: Stefan Eßer <se>
Status: Closed FIXED    
Severity: Affects Only Me CC: ak, w.schwarzenfeld
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description Philippe Michel 2019-04-06 14:25:28 UTC
Starting portmaster in /sys/conf (by chance, the shell where I ran it had been changed to this directory for an earlier task) causes the following error :

# portmaster openjpeg

===>>> The ports directory (
make: stopped in /usr/src/sys/conf) does not seem to contain a ports tree
===>>> Aborting update

Apparently portmaster looks for some files in some places, with $cwd early in the directories search list and /sys/conf contains an homonym.
Comment 1 Walter Schwarzenfeld 2019-08-24 08:30:02 UTC
/usr/local/sbin/portmaster:

358  +       if [ "$PWD" = "/usr/src/sys/conf" ]; then
359  +               pm_cd $HOME
360  +      fi
Comment 2 commit-hook freebsd_committer freebsd_triage 2020-01-26 19:00:24 UTC
A commit references this bug:

Author: se
Date: Sun Jan 26 19:00:18 UTC 2020
New revision: 524228
URL: https://svnweb.freebsd.org/changeset/ports/524228

Log:
  Make portmaster fall back to other locations if invoked in, e.g., /sys/conf.

  PR:		237061
  Approved by:	antoine (implicit)

Changes:
  head/ports-mgmt/portmaster/Makefile
  head/ports-mgmt/portmaster/files/patch-portmaster