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

Re: [PATCH 1/2] Makefile: Use the same source directory for "ln -s" as for "ln" / "cp"

From
Sebastian Schuberth <sschuberth@gmail.com>
Date
Feb 5, 2015, 20:52 UTC
Message-ID
<CAHGBnuM0uTDxRB1NZm0fxe2yLs-QoU1J+Txb8_o7zVdYahAdow@mail.gmail.com>
In-Reply-To
<20150205204534.GE15326@peff.net>
On Thu, Feb 5, 2015 at 9:45 PM, Jeff King <peff@peff.net> wrote:
Show 20 quoted lines
>>  endif
>>  ········$(RM)·"$$execdir/$$p"·&&·\
>>  ········test·-z·"$(NO_INSTALL_HARDLINKS)$(NO_CROSS_DIRECTORY_HARDLINKS)"·&&·\
>>  ········ln·"$$bindir/$$p"·"$$execdir/$$p"·2>/dev/null·||·\
>> +········ln·-s·"../$$p"·"$$execdir/$$p"·2>/dev/null·||·\
>>  ········cp·"$$bindir/$$p"·"$$execdir/$$p"·||·exit;·\
>>  ······done;·\
>>  ····}·&&·\
>> --·
>>
>> does not seem to be correct in all cases.
>
> Ah, I see. Yeah, you'd have to calculate that relative path between
> $bindir and $execdir. We have C code already to do that (see
> relative_path() in path.c), so in theory you could build a wrapper
> during the build phase and then run:
>
>   ln -s $(./my-wrapper "$bindir" "$execdir")/$p $execdir/$p
>
> or something during the install phase.

Thanks for pointing out the C code to do that. But IMO creating and using such a wrapper is not worth the effort.

-- 
Sebastian Schuberth
Previous: Jeff KingNext: Kyle J. McKay
Message 8 of 11 in “Makefile: Use the same source directory for "ln -s" as for "ln" / "cp"”
  1. 1/2 Makefile: Use the same source directory for "ln -s" as for "ln" / "cp"Sebastian Schuberth, Feb 5, 2015
  2. Kyle J. McKayFeb 5, 2015
  3. Junio C HamanoFeb 5, 2015
  4. Sebastian SchuberthFeb 5, 2015
  5. Jeff KingFeb 5, 2015
  6. Sebastian SchuberthFeb 5, 2015
  7. Jeff KingFeb 5, 2015
  8. Sebastian SchuberthFeb 5, 2015
  9. Kyle J. McKayFeb 5, 2015
  10. Junio C HamanoFeb 5, 2015
  11. Kyle J. McKayFeb 5, 2015

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.