Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Feb 2014 19:24:42 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        freebsd-ports@freebsd.org
Subject:   Re: Changing ownership of a directory when using staging
Message-ID:  <5308F97A.3050405@infracaninophile.co.uk>
In-Reply-To: <20140222190540.GA9375@apnoea.adamw.org>
References:  <20140222190540.GA9375@apnoea.adamw.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--d14mTMGEwSu2NthHgwgI5hHABEspUcOgN
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 22/02/2014 19:05, Adam Weinberger wrote:
> How do I specify the owner/group and mode of a directory when using
> staging? It appears to automatically create every directory as
> root:wheel. Setting @user/@group in pkg-plist doesn't affect things wit=
h
> @exec mkdir.
>=20
> The only thing I can figure is:
> @exec install -d -m 730 -o user -g group %D/path/to/dir
>=20
> But that'll fail when installed by anyone except root, right?
>=20
> This problem breaks usability of a number of ports---especially
> web-based ones where specific directories need specific owners. Every
> time www/dokuwiki is upgraded or reinstalled, a half dozen directories
> have to be manually chown'd on the command line, for example.

I had this with www/rt42 with the ${LOCALBASE}/etc/rt directory --
here's the solution I used in pkg-plist:

@mode 0440
etc/rt42/RT_Config.pm
@unexec if cmp -s %D/etc/rt42/RT_SiteConfig.pm-dist
%D/etc/rt42/RT_SiteConfig.pm ; then rm -f %D/etc/rt42/RT_SiteConfig.pm; f=
i
etc/rt42/RT_SiteConfig.pm-dist
@exec [ -f %B/RT_SiteConfig.pm ] || cp -p %D/%F %B/RT_SiteConfig.pm
@mode
etc/rt42/acl.Oracle
etc/rt42/acl.Pg
etc/rt42/acl.mysql
etc/rt42/initialdata
etc/rt42/schema.Oracle
etc/rt42/schema.Pg
etc/rt42/schema.SQLite
etc/rt42/schema.mysql
@exec chmod 0750 %D/etc/rt42
@exec chgrp rt %D/etc/rt42
@group

Would be nicer to create the directory with the right ownership and mode
in the first place, then copy the files to it, but that doesn't seem to
work given what you can go with a plist.

	Cheers,

	Matthew



--=20
Dr Matthew J Seaman MA, D.Phil.

PGP: http://www.infracaninophile.co.uk/pgpkey
JID: matthew@infracaninophile.co.uk


--d14mTMGEwSu2NthHgwgI5hHABEspUcOgN
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.20 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQJ8BAEBCgBmBQJTCPmDXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NTNBNjhCOTEzQTRFNkNGM0UxRTEzMjZC
QjIzQUY1MThFMUE0MDEzAAoJELsjr1GOGkATpVYP/0521srXJ1F78I2oIMjeIHWJ
0CKqHhmd+f7N4nPv7ZQDvqgEZxHk2hP7LdZPY0Phwz+ei1zpxJZVtJ1HNt/8I6rb
0iXMfdeaxRD8hEDHJmUSgIqnCHANLDRGWQByPga+4XvRKdqtAfjg8g108XV7MjiY
+ysCFCd0R+mXd+c7Xo0ZWxA5lhXt9bQDigoPviIYpP7SksIXgy4gPUpjP7Qb4vkI
YHZ3tutzmjgU0hl4oZlxfxd17NksbxOgnUIP11K9OUwsu31+7/EmF6sxpI5ub6si
LgJpOKu58L0hqZ9qxz+heTFWaEGgZv3NcwaXCoYcdfwhZTVTp8/rLmZyZ6U6ENoK
no5xce51EmXU15bSiv7mJlQ/+MEUCPBW40qqu5wa7T0dRIw4hARFeVNwF6/QNQpc
3Pxk3jw+QlZ5ocd0nyqKsjVagCKvbx4B/sPfJzuazXc1P2NEHVhu58w5zI//0SIP
TPx0hMo9ZfP3RztNootVHGCxYiP34Jr8rGCif5zxJKvblIipHUVD5DDFEhqRODPq
2emjsWBa0J4tt1e3ZQaHlVtZyvFOLPs4IaqPBDxQf1UvXuxL/i++9b2ym/sytYr7
bx29Mjc+8uNLvpzpt5kdDSBH2RoukmQVGU5yPc0kRv8HlXctb+4QEAL7sPvB3bc8
WuphRq6UNoVHnuMb5X3S
=vYZf
-----END PGP SIGNATURE-----

--d14mTMGEwSu2NthHgwgI5hHABEspUcOgN--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5308F97A.3050405>