Fixing gem files permissions
Romain Tartière
romain at FreeBSD.org
Tue Jun 7 21:36:46 UTC 2011
On Tue, Jun 07, 2011 at 07:31:13PM +0100, Eric wrote:
> > From: Romain Tartière <romain at FreeBSD.org>
> > My current workaround is:
> >
> > ------------------------------8<---------------------------
> > post-install:
> > @${FIND} ${PREFIX}/${GEM_LIB_DIR} -type f -exec ${CHMOD} 444 '{}' ';'
> > ------------------------------8<---------------------------
> >
> > I am not really happy with this. Is there a better way to fix this?
>
> I don't think there is an easy place other than the post-install target
> where you can 'patch' gems since the other stages of the port build process
> do little for a gem, given it's mainly a wrapper for the gem installer
> itself.
>
> I remember had to do similar things with a couple of gems I use personally
> (can't remember if I've submitted those as ports yet). The only thing I'd
> say is to restrict your 'fix' to just those files your 'getopt-declare' gem
> installs rather than make all the contents of the Gem lib dir 444 and
> potentially cause a headache somewhere else. So something more like (I note
> from a quick glance in my own Gem libs that they tend to be root/wheel and
> 644)
AFAICS, ${GEM_LIB_DIR} expends to the gem directory:
| % make -V GEM_LIB_DIR
| lib/ruby/gems/1.8/gems/getopt-declare-1.29
BTW, I changed the mode from 444 to 644 as it is the permissions of
other gem files as you said.
> I'd also pop a comment in the Makefile so someone following knows why you've
> done it.
Yep!
> > I am not used with Ruby gems packaging, and I would like to be sure that
> > this is a problem that should be signaled upstream before acting: is it?
>
> I've never looked at the Gem internals to see how it determines file
> permissions of those files it installs, but given it *appears* to be a bug
> you'd do well to flag it to upstream and see what they say.
I'll do so.
Thanks!
Romain
--
Romain Tartière <romain at FreeBSD.org> http://people.FreeBSD.org/~romain/
pgp: 8234 9A78 E7C0 B807 0B59 80FF BA4D 1D95 5112 336F (ID: 0x5112336F)
(plain text =non-HTML= PGP/GPG encrypted/signed e-mail much appreciated)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 663 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ruby/attachments/20110607/185aeb93/attachment.pgp
More information about the freebsd-ruby
mailing list