all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Ulrich Mueller <ulm@gentoo.org>, Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] Set also the group of installed files
Date: Thu, 21 Jun 2018 13:32:20 -0700	[thread overview]
Message-ID: <9ef9fe87-47bb-9c3b-3549-d058cfcde93b@cs.ucla.edu> (raw)
In-Reply-To: <23339.50144.819516.554832@a1i15.kph.uni-mainz.de>

[-- Attachment #1: Type: text/plain, Size: 456 bytes --]

On 06/21/2018 08:27 AM, Ulrich Mueller wrote:
> Also it should fall back to the current behaviour if "id" errors
> out for some reason.

Yes, that sort of thing should work. Thanks for the patch. I tweaked it 
a bit to make it more robust if 'id' is missing or exits with nonzero 
status or if the shell doesn't grok $(...) or the installation process 
is running without a password or group entry so the -n option fails (!), 
and installed the attached.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Set-group-when-installing-too.patch --]
[-- Type: text/x-patch; name="0001-Set-group-when-installing-too.patch", Size: 1399 bytes --]

From 6b8a9891a197512b76abd04e80f444b6885d2943 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu, 21 Jun 2018 13:29:15 -0700
Subject: [PATCH] Set group when installing, too
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

From a patch by Ulrich Mueller in:
https://lists.gnu.org/r/emacs-devel/2018-06/msg00687.html
* Makefile.in (set_installuser): Also set the group, in order
to match install(1) behavior.  Also, don’t clutter stderr
with a diagnostic if ‘id’ is missing.
---
 Makefile.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 52d44d9708..4d7627ba09 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -516,9 +516,11 @@ INSTALL_ARCH_INDEP_EXTRA =
 ## https://lists.gnu.org/r/emacs-devel/2007-10/msg01672.html
 ## Needs to be the user running install, so configure can't set it.
 set_installuser=for installuser in $${LOGNAME} $${USERNAME} $${USER} \
-	  `id -un 2> /dev/null`; do \
+	  `(id -u) 2> /dev/null`; do \
 	  [ -n "$${installuser}" ] && break ; \
-	done
+	done; \
+	installgroup=`(id -g) 2>/dev/null` && [ -n "$$installgroup" ] && \
+	  installuser=$$installuser:$$installgroup
 
 ### Install the files that are machine-independent.
 ### Most of them come straight from the distribution; the exception is
-- 
2.17.1


      reply	other threads:[~2018-06-21 20:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-21 14:31 [PATCH] Set also the group of installed files Ulrich Mueller
2018-06-21 14:53 ` Eli Zaretskii
2018-06-21 15:27   ` Ulrich Mueller
2018-06-21 20:32     ` Paul Eggert [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ef9fe87-47bb-9c3b-3549-d058cfcde93b@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=ulm@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.