public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] dosym function in binary package ebuilds
@ 2022-07-22 14:56 Fabulous Zhang Zheng
  2022-07-22 15:00 ` Arsen Arsenović
  2022-07-22 20:49 ` Alexey Zapparov
  0 siblings, 2 replies; 4+ messages in thread
From: Fabulous Zhang Zheng @ 2022-07-22 14:56 UTC (permalink / raw
  To: gentoo-dev

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

Good evening, dear list

Most binary package ebuilds have such a *dosym* statement in src_install(),
take net-im/signal-desktop-bin as an example:

dosym ../../opt/Signal/${MY_PN} /usr/bin/${MY_PN}     (where the variable
is signal-desktop)

*dosym* creates a symlink of the binary under opt at /usr/bin/ according to
devmanaul.

I'm confused about the "../../", since S="${workdir}",  the correct way
seems to be "dosym  ./opt/Signal/xxx    /usr/bin/xxx"

It's much appreciated if anyone could help   ; )


└── signal-desktop-bin-5.50.0
    ├── distdir
    │   └── signal-desktop_5.50.0_amd64.deb ->
/var/cache/distfiles/signal-desktop_5.50.0_amd64.deb
    ├── files -> /var/db/repos/gentoo/net-im/signal-desktop-bin/files
    ├── homedir
    ├── temp
    │   ├── build.log
    │   ├── eclass-debug.log
    │   ├── environment
    │   └── logging
    └── work
        ├── opt
        └── usr

[-- Attachment #2: Type: text/html, Size: 1312 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] dosym function in binary package ebuilds
  2022-07-22 14:56 [gentoo-dev] dosym function in binary package ebuilds Fabulous Zhang Zheng
@ 2022-07-22 15:00 ` Arsen Arsenović
  2022-07-22 20:49 ` Alexey Zapparov
  1 sibling, 0 replies; 4+ messages in thread
From: Arsen Arsenović @ 2022-07-22 15:00 UTC (permalink / raw
  To: gentoo-dev

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

Hi,

> I'm confused about the "../../", since S="${workdir}",  the correct
> way seems to be "dosym  ./opt/Signal/xxx    /usr/bin/xxx"

This is just how name resolution works on UNIX (see also: namei). If you 
start at /usr/bin/xxx, take it's parent (/usr/bin/), and then follow 
components of the link (../../opt/Signal/${MY_PN}) you get
/usr/bin/../../opt/Signal/${MY_PN}, collapsing those two parents 
(assuming they're also not links), you're left with /opt/Signal/${PN}. 
This is done so that these links act correct in roots (if one just did, 
e.g. /opt/Signal/${MY_PN}, and you were in a root, it'd refer to the 
hosts Signal install).

Hope that helps,
-- 
Arsen Arsenović

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 358 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] dosym function in binary package ebuilds
  2022-07-22 14:56 [gentoo-dev] dosym function in binary package ebuilds Fabulous Zhang Zheng
  2022-07-22 15:00 ` Arsen Arsenović
@ 2022-07-22 20:49 ` Alexey Zapparov
  2022-07-22 21:06   ` Fabulous Zhang Zheng
  1 sibling, 1 reply; 4+ messages in thread
From: Alexey Zapparov @ 2022-07-22 20:49 UTC (permalink / raw
  To: gentoo-dev

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

`dosym target link_name` creates a symlink. Under the hood it calls `ln`.
First argument may be either absolute path or relative to link_name.
Conventionally relative targets are used.

On Fri, 22 Jul 2022, 16:56 Fabulous Zhang Zheng, <zheng1181822466@gmail.com>
wrote:

> Good evening, dear list
>
> Most binary package ebuilds have such a *dosym* statement in
> src_install(), take net-im/signal-desktop-bin as an example:
>
> dosym ../../opt/Signal/${MY_PN} /usr/bin/${MY_PN}     (where the variable
> is signal-desktop)
>
> *dosym* creates a symlink of the binary under opt at /usr/bin/ according
> to devmanaul.
>
> I'm confused about the "../../", since S="${workdir}",  the correct way
> seems to be "dosym  ./opt/Signal/xxx    /usr/bin/xxx"
>
> It's much appreciated if anyone could help   ; )
>
>
> └── signal-desktop-bin-5.50.0
>     ├── distdir
>     │   └── signal-desktop_5.50.0_amd64.deb ->
> /var/cache/distfiles/signal-desktop_5.50.0_amd64.deb
>     ├── files -> /var/db/repos/gentoo/net-im/signal-desktop-bin/files
>     ├── homedir
>     ├── temp
>     │   ├── build.log
>     │   ├── eclass-debug.log
>     │   ├── environment
>     │   └── logging
>     └── work
>         ├── opt
>         └── usr
>
>

[-- Attachment #2: Type: text/html, Size: 1850 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] dosym function in binary package ebuilds
  2022-07-22 20:49 ` Alexey Zapparov
@ 2022-07-22 21:06   ` Fabulous Zhang Zheng
  0 siblings, 0 replies; 4+ messages in thread
From: Fabulous Zhang Zheng @ 2022-07-22 21:06 UTC (permalink / raw
  To: gentoo-dev

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

Dear Alexey,

thanks a lot for your reply, now I get it.

The path in 1st argument is relative to 2nd argument, and what I thought
before was that it's relative to S="${workdir}".

Best wishes



Alexey Zapparov <alexey@zapparov.com> 于2022年7月23日周六 04:50写道:

> `dosym target link_name` creates a symlink. Under the hood it calls `ln`.
> First argument may be either absolute path or relative to link_name.
> Conventionally relative targets are used.
>
> On Fri, 22 Jul 2022, 16:56 Fabulous Zhang Zheng, <
> zheng1181822466@gmail.com> wrote:
>
>> Good evening, dear list
>>
>> Most binary package ebuilds have such a *dosym* statement in
>> src_install(), take net-im/signal-desktop-bin as an example:
>>
>> dosym ../../opt/Signal/${MY_PN} /usr/bin/${MY_PN}     (where the variable
>> is signal-desktop)
>>
>> *dosym* creates a symlink of the binary under opt at /usr/bin/ according
>> to devmanaul.
>>
>> I'm confused about the "../../", since S="${workdir}",  the correct way
>> seems to be "dosym  ./opt/Signal/xxx    /usr/bin/xxx"
>>
>> It's much appreciated if anyone could help   ; )
>>
>>
>> └── signal-desktop-bin-5.50.0
>>     ├── distdir
>>     │   └── signal-desktop_5.50.0_amd64.deb ->
>> /var/cache/distfiles/signal-desktop_5.50.0_amd64.deb
>>     ├── files -> /var/db/repos/gentoo/net-im/signal-desktop-bin/files
>>     ├── homedir
>>     ├── temp
>>     │   ├── build.log
>>     │   ├── eclass-debug.log
>>     │   ├── environment
>>     │   └── logging
>>     └── work
>>         ├── opt
>>         └── usr
>>
>>

[-- Attachment #2: Type: text/html, Size: 2569 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-07-22 21:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-22 14:56 [gentoo-dev] dosym function in binary package ebuilds Fabulous Zhang Zheng
2022-07-22 15:00 ` Arsen Arsenović
2022-07-22 20:49 ` Alexey Zapparov
2022-07-22 21:06   ` Fabulous Zhang Zheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox