Skip to content

Commit

Permalink
Don't give mtree a uname or gname if non-root
Browse files Browse the repository at this point in the history
It can't enforce them in this case anyway, and some users are required
to use nonstandard group names that mtree would error on.

Closes: https://trac.macports.org/ticket/49501
Closes: #293
  • Loading branch information
jmroot committed Dec 5, 2023
1 parent 6b530bd commit 5fddde0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
8 changes: 8 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,7 @@ UNIVERSAL_ARCHS
startupitem_install
MPFRAMEWORKSDIR
MPAPPLICATIONSDIR
MTREE_UGNAME
DSTMODE
RUNUSR
DSTGRP
Expand Down Expand Up @@ -7013,6 +7014,13 @@ printf "%s\n" "$DSTMODE" >&6; }
fi


# Don't set uname or gname in .mtree files unless root
# https://trac.macports.org/ticket/49501
if test "$DSTUSR" = "root" ; then
MTREE_UGNAME="uname=root gname=$DSTGRP"
fi


# Check for default directories


Expand Down
7 changes: 7 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,13 @@ MP_CHECK_RUNUSER
MP_DIRECTORY_MODE
MP_SHARED_DIRECTORY

# Don't set uname or gname in .mtree files unless root
# https://trac.macports.org/ticket/49501
if test "$DSTUSR" = "root" ; then
MTREE_UGNAME="uname=root gname=$DSTGRP"
fi
AC_SUBST(MTREE_UGNAME)

# Check for default directories
MP_PATH_APPLICATIONS
MP_PATH_FRAMEWORKS
Expand Down
2 changes: 1 addition & 1 deletion doc/base.mtree.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# MacPorts filesystem hierarchy, for internal use only. Changes to this file will not stick across installations.
#

/set type=dir uname=@DSTUSR@ gname=@DSTGRP@ mode=@DSTMODE@
/set type=dir @MTREE_UGNAME@ mode=@DSTMODE@
.
man type=link link=share/man
..
Expand Down
2 changes: 1 addition & 1 deletion doc/prefix.mtree.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MacPorts filesystem hierarchy, for internal use only. Changes to this file will not stick across installations.

/set type=dir uname=@DSTUSR@ gname=@DSTGRP@ mode=@DSTMODE@
/set type=dir @MTREE_UGNAME@ mode=@DSTMODE@
.
bin
..
Expand Down

3 comments on commit 5fddde0

@ryandesign
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmroot Not sure why but as of this commit, install fails:

chmod: /opt/bblocal/var/buildworker/base/base-11_x86_64/opt/local/man: No such file or directory

and test fails:

could not create new link "/opt/bblocal/var/buildworker/base/build/src/macports1.0/tests/tmpdir/share/macports": target "/opt/bblocal/var/buildworker/base/base-11_x86_64/opt/local/share/macports" doesn't exist

@jmroot
Copy link
Member Author

@jmroot jmroot commented on 5fddde0 Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's odd, it succeeded on CI.

@jmroot
Copy link
Member Author

@jmroot jmroot commented on 5fddde0 Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, cd99281.

Please sign in to comment.