• Re: [gentoo-dev] dosym function in binary package ebuilds

    From Arsen =?utf-8?B?QXJzZW5vdmnEhw==?=@21:1/5 to All on Fri Jul 22 17:00:22 2022
    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ć

    -----BEGIN PGP SIGNATURE-----

    iNUEABYKAH0WIQT+4rPRE/wAoxYtYGFSwpQwHqLEkwUCYtq7hl8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0RkVF MkIzRDExM0ZDMDBBMzE2MkQ2MDYxNTJDMjk0MzAxRUEyQzQ5MwAKCRBSwpQwHqLE k/C4AQDSS8eWyFOum4hW0v+837zFZWDX1v6Okx7leeSmYTfGaAD9FuUlEEaf57d7 FsoJKFNCZxj0Q/rLl7Y5AO0c3K9V4Qw=
    =/jcq
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Fabulous Zhang Zheng@21:1/5 to All on Fri Jul 22 17:00:01 2022
    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

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alexey Zapparov@21:1/5 to All on Fri Jul 22 22:50:01 2022
    `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



    <div dir="auto">`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.</div><br><div class="gmail_quote"><div dir="ltr"
    class="gmail_attr">On Fri, 22 Jul 2022, 16:56 Fabulous Zhang Zheng, &lt;<a href="mailto:zheng1181822466@gmail.com">zheng1181822466@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;
    padding-left:1ex"><div dir="ltr"><div>Good evening, dear list</div><div><br></div><div>Most binary package ebuilds have such a *dosym* statement in src_install(), take net-im/signal-desktop-bin as an example:</div><div><br></div><div>dosym ../../opt/
    Signal/${MY_PN} /usr/bin/${MY_PN}     (where the variable is signal-desktop)</div><div><br></div><div>*dosym* creates a symlink of the binary under opt at /usr/bin/ according to devmanaul.</div><br><div>I&#39;m confused about the &quot;../../&quot;,
    since S=&quot;${workdir}&quot;,  the correct way seems to be &quot;dosym  ./opt/Signal/xxx    /usr/bin/xxx&quot;</div><div><br></div><div>It&#39;s much appreciated if anyone could help   ; )<br></div><div><br></div><div><br></div><div>└──
    signal-desktop-bin-5.50.0<br>    ├── distdir<br>    │   └── signal-desktop_5.50.0_amd64.deb -&gt; /var/cache/distfiles/signal-desktop_5.50.0_amd64.deb<br>    ├── files -&gt; /var/db/repos/gentoo/net-im/signal-desktop-bin/files<
        ├── homedir<br>    ├── temp<br>    │   ├── build.log<br>    │   ├── eclass-debug.log<br>    │   ├── environment<br>    │   └── logging<br>    └── work<br>        ├──
    opt<br>        └── usr<br></div><div><br></div></div> </blockquote></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Fabulous Zhang Zheng@21:1/5 to All on Fri Jul 22 23:10:01 2022
    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



    <div dir="ltr"><div>Dear Alexey,</div><div><br></div><div>thanks a lot for your reply, now I get it.</div><div><br></div><div>The path in 1st argument is relative to 2nd argument, and what I thought before was that it&#39;s relative to S=&quot;${workdir}&
    quot;.</div><div><br></div><div>Best wishes<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Alexey Zapparov &lt;<a href="mailto:alexey@zapparov.com">alexey@zapparov.com</a>&gt; 于2022年7月23
    周六 04:50写道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">`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.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 22 Jul 2022, 16:56 Fabulous Zhang Zheng, &lt;<a href="mailto:
    zheng1181822466@gmail.com" target="_blank">zheng1181822466@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Good evening, dear
    list</div><div><br></div><div>Most binary package ebuilds have such a *dosym* statement in src_install(), take net-im/signal-desktop-bin as an example:</div><div><br></div><div>dosym ../../opt/Signal/${MY_PN} /usr/bin/${MY_PN}     (where the variable
    is signal-desktop)</div><div><br></div><div>*dosym* creates a symlink of the binary under opt at /usr/bin/ according to devmanaul.</div><br><div>I&#39;m confused about the &quot;../../&quot;, since S=&quot;${workdir}&quot;,  the correct way seems to be &
    quot;dosym  ./opt/Signal/xxx    /usr/bin/xxx&quot;</div><div><br></div><div>It&#39;s much appreciated if anyone could help   ; )<br></div><div><br></div><div><br></div><div>└── signal-desktop-bin-5.50.0<br>    ├── distdir<br>    │ 
      └── signal-desktop_5.50.0_amd64.deb -&gt; /var/cache/distfiles/signal-desktop_5.50.0_amd64.deb<br>    ├── files -&gt; /var/db/repos/gentoo/net-im/signal-desktop-bin/files<br>    ├── homedir<br>    ├── temp<br>    │  
    ├── build.log<br>    │   ├── eclass-debug.log<br>    │   ├── environment<br>    │   └── logging<br>    └── work<br>        ├── opt<br>        └── usr<br></div><div><br></div></div>
    </blockquote></div>
    </blockquote></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)