git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Install builtins with the user and group of the installing personality

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Feb 23, 2009, 17:00 UTC
Message-ID
<49A2D644.6040106@viscovery.net>
In-Reply-To
<20090223155042.14806.qmail@518da7eef5d9e4.315fe32.mid.smarden.org>
Gerrit Pape schrieb:
Show 26 quoted lines
> If 'make install' was run with sufficient privileges, then the installed
> builtins in gitexecdir, which are either hardlinked, symlinked, or copied,
> would receive the user and group of whoever built git.  With this commit the
> git-add program is installed using $(INSTALL), and subsequently linked or
> copied to the other builtins.
> 
> Signed-off-by: Gerrit Pape <pape@smarden.org>
> ---
>  Makefile |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index b040a96..7401603 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1467,9 +1467,7 @@ ifneq (,$X)
>  endif
>  	bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
>  	execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
> -	{ $(RM) "$$execdir/git-add$X" && \
> -		ln git-add$X "$$execdir/git-add$X" 2>/dev/null || \
> -		cp git-add$X "$$execdir/git-add$X"; } && \
> +	$(INSTALL) git-add$X "$$execdir" && \
>  	{ for p in $(filter-out git-add$X,$(BUILT_INS)); do \
>  		$(RM) "$$execdir/$$p" && \
>  		ln "$$execdir/git-add$X" "$$execdir/$$p" 2>/dev/null || \
I think the intent of the lines that you removed was actually this:
diff --git a/Makefile b/Makefile
index 27b9569..97087c3 100644
--- a/Makefile
+++ b/Makefile
@@ -1471,8 +1471,8 @@ endif
 	bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
 	execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
 	{ $(RM) "$$execdir/git-add$X" && \
-		ln git-add$X "$$execdir/git-add$X" 2>/dev/null || \
-		cp git-add$X "$$execdir/git-add$X"; } && \
+		ln "$$bindir/git$X" "$$execdir/git-add$X" 2>/dev/null || \
+		cp "$$bindir/git$X" "$$execdir/git-add$X"; } && \
 	{ for p in $(filter-out git-add$X,$(BUILT_INS)); do \
 		$(RM) "$$execdir/$$p" && \
 		ln "$$execdir/git-add$X" "$$execdir/$$p" 2>/dev/null || \

-- Hannes
Previous: Gerrit PapeNext: Gerrit Pape
Message 2 of 4 in “Install builtins with the user and group of the installing personality”
  1. Install builtins with the user and group of the installing personalityGerrit Pape, Feb 23, 2009
  2. Johannes SixtFeb 23, 2009
  3. Install builtins with the user and group of the installing personalityGerrit Pape, Feb 24, 2009
  4. Junio C HamanoFeb 25, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.