Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"It runs like _x, where _x is something unsavory" -- Prof. Romas Aleliunas, CS 435


devel / comp.unix.shell / Re: Let a soft symlinked directory work as if it is a physical one.

SubjectAuthor
* Let a soft symlinked directory work as if it is a physical one.hongy...@gmail.com
`* Re: Let a soft symlinked directory work as if it is a physical one.Andrew Smallshaw
 `- Re: Let a soft symlinked directory work as if it is a physical one.hongy...@gmail.com

1
Let a soft symlinked directory work as if it is a physical one.

<c9d6ebf1-e0c0-4959-9c1d-4beb04f8ad40n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4948&group=comp.unix.shell#4948

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:ac8:7d0a:: with SMTP id g10mr14053888qtb.635.1643618229842;
Mon, 31 Jan 2022 00:37:09 -0800 (PST)
X-Received: by 2002:a05:6214:2a85:: with SMTP id jr5mr15818491qvb.3.1643618229696;
Mon, 31 Jan 2022 00:37:09 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Mon, 31 Jan 2022 00:37:09 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=139.59.109.137; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 139.59.109.137
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c9d6ebf1-e0c0-4959-9c1d-4beb04f8ad40n@googlegroups.com>
Subject: Let a soft symlinked directory work as if it is a physical one.
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Mon, 31 Jan 2022 08:37:09 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 24
 by: hongy...@gmail.com - Mon, 31 Jan 2022 08:37 UTC

I try to compile thermo_pw according to guidance here [1]. This package needs to be placed in the root directory of QE package [2] when compiling, i.e., with the following directory hierachy:

qe-7.0/
| thermo_pw

If the thermo_pw directory above is a symbolic link to another location outside the QE package, the following compilation step issued from the symbolic link directory will fail as shown below:

$ make join_qe
if test -f main_Makefile ; then mv ../Makefile Makefile_qe ; \
mv main_Makefile ../Makefile ; fi
if test -f plugins_makefile ; then mv ../install/plugins_makefile \
plugins_makefile_qe ; mv plugins_makefile ../install ; fi
if test -f makedeps.sh ; then mv ../install/makedeps.sh \
makedeps.sh_qe ; mv makedeps.sh ../install/ ; fi
mv: cannot stat '../install/makedeps.sh': No such file or directory
mv: cannot move 'makedeps.sh' to '../install/': Not a directory
make: *** [Makefile:23: join_qe] Error 1

So, I want to know if there is a way to let a soft symlinked directory work as if it is a physical one.

[1] https://people.sissa.it/~dalcorso/thermo_pw/user_guide/node6.html
[2] https://github.com/QEF/q-e/releases/download/qe-7.0/qe-7.0-ReleasePack.tgz

Regards,
HZ

Re: Let a soft symlinked directory work as if it is a physical one.

<slrnsvg3hc.goi.andrews@otaku.sdf.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4949&group=comp.unix.shell#4949

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: andr...@sdf.org (Andrew Smallshaw)
Newsgroups: comp.unix.shell
Subject: Re: Let a soft symlinked directory work as if it is a physical one.
Date: Mon, 31 Jan 2022 16:28:30 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <slrnsvg3hc.goi.andrews@otaku.sdf.org>
References: <c9d6ebf1-e0c0-4959-9c1d-4beb04f8ad40n@googlegroups.com>
Injection-Date: Mon, 31 Jan 2022 16:28:30 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="e762c0c8f91089d0f215140b723db5f7";
logging-data="23169"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/FbTO+ssV2aNaYzcYsSibuZNyvkcxvpYU="
User-Agent: slrn/1.0.3 (Patched for libcanlock3) (NetBSD)
Cancel-Lock: sha1:EFgBjraYI6IW3arIHDV951IKmqw=
 by: Andrew Smallshaw - Mon, 31 Jan 2022 16:28 UTC

On 2022-01-31, hongy...@gmail.com <hongyi.zhao@gmail.com> wrote:
> I try to compile thermo_pw according to guidance here [1]. This
package needs to be placed in the root directory of QE package [2]
when compiling, i.e., with the following directory hierachy:
>
> qe-7.0/
> | thermo_pw
>
> If the thermo_pw directory above is a symbolic link to another
location outside the QE package, the following compilation step
issued from the symbolic link directory will fail as shown below:
>
> $ make join_qe
> if test -f main_Makefile ; then mv ../Makefile Makefile_qe ; \
> mv main_Makefile ../Makefile ; fi

Not going to work. .. will always refer to the physical parent
since it has to be unambiguous - this is one of the reasons you
can't hard link directories in the first place - the other is you
could eventuality end up with directories isolated from the root.
The trickery ksh and successors use to track the "logical" path is
purely internal to the shell, any external process will always
refer to the physical parent.

On possible workaround would be to create a new parent directory
containing the physical therm_pw directory and then symlinking the
_contents_ of qe-7.0/ into that. That may or may not work. I'd
expect most simple or well-structured projects not to depend on
backing up to the parent so I would hope you will be in luck, but
the easiest way to find out is simply to try it.

However, I would caution about the motivation for wanting to do
this in the first place. If you are expecting the original qe-7.0/
to be left in an unaltered condition you can't depend on that in
the general case, there is nothing to say the build products will
remain the same or even that source files are not altered. You
would hope so, but that is assuming thermo_pw is well-behaved. If
it is it makes no difference whather it is physically in qe-7.0/
or not. If it isn't the symlinks aren't going to help.

--
Andrew Smallshaw
andrews@sdf.org

Re: Let a soft symlinked directory work as if it is a physical one.

<20f1f50c-2c5b-47ac-8349-6e88136eb97en@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4950&group=comp.unix.shell#4950

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a05:6214:c4d:: with SMTP id r13mr20808554qvj.78.1643680933760;
Mon, 31 Jan 2022 18:02:13 -0800 (PST)
X-Received: by 2002:a05:6214:29ea:: with SMTP id jv10mr19963980qvb.75.1643680933573;
Mon, 31 Jan 2022 18:02:13 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Mon, 31 Jan 2022 18:02:13 -0800 (PST)
In-Reply-To: <slrnsvg3hc.goi.andrews@otaku.sdf.org>
Injection-Info: google-groups.googlegroups.com; posting-host=139.59.109.137; posting-account=kF0ZaAoAAACPbiK5gldhAyX5qTd3krV2
NNTP-Posting-Host: 139.59.109.137
References: <c9d6ebf1-e0c0-4959-9c1d-4beb04f8ad40n@googlegroups.com> <slrnsvg3hc.goi.andrews@otaku.sdf.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <20f1f50c-2c5b-47ac-8349-6e88136eb97en@googlegroups.com>
Subject: Re: Let a soft symlinked directory work as if it is a physical one.
From: hongyi.z...@gmail.com (hongy...@gmail.com)
Injection-Date: Tue, 01 Feb 2022 02:02:13 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 48
 by: hongy...@gmail.com - Tue, 1 Feb 2022 02:02 UTC

On Tuesday, February 1, 2022 at 12:28:35 AM UTC+8, Andrew Smallshaw wrote:
> On 2022-01-31, hongy...@gmail.com <hongy...@gmail.com> wrote:
> > I try to compile thermo_pw according to guidance here [1]. This
> package needs to be placed in the root directory of QE package [2]
> when compiling, i.e., with the following directory hierachy:
> >
> > qe-7.0/
> > | thermo_pw
> >
> > If the thermo_pw directory above is a symbolic link to another
> location outside the QE package, the following compilation step
> issued from the symbolic link directory will fail as shown below:
> >
> > $ make join_qe
> > if test -f main_Makefile ; then mv ../Makefile Makefile_qe ; \
> > mv main_Makefile ../Makefile ; fi
> Not going to work. .. will always refer to the physical parent
> since it has to be unambiguous - this is one of the reasons you
> can't hard link directories in the first place - the other is you
> could eventuality end up with directories isolated from the root.
> The trickery ksh and successors use to track the "logical" path is
> purely internal to the shell, any external process will always
> refer to the physical parent.
>
> On possible workaround would be to create a new parent directory
> containing the physical therm_pw directory and then symlinking the
> _contents_ of qe-7.0/ into that. That may or may not work. I'd
> expect most simple or well-structured projects not to depend on
> backing up to the parent so I would hope you will be in luck, but
> the easiest way to find out is simply to try it.
>
> However, I would caution about the motivation for wanting to do
> this in the first place. If you are expecting the original qe-7.0/
> to be left in an unaltered condition you can't depend on that in
> the general case, there is nothing to say the build products will
> remain the same or even that source files are not altered. You
> would hope so, but that is assuming thermo_pw is well-behaved. If
> it is it makes no difference whather it is physically in qe-7.0/
> or not. If it isn't the symlinks aren't going to help.

I've come up with another solution that uses the latest rsync [1] which supplies the '--mkpath' option:

$ tar zxvf qe-7.0-ReleasePack.tgz
$ git clone https://github.com/dalcorso/thermo_pw.git thermo_pw.git
$ rsync -avP --mkpath --delete thermo_pw.git/ ./qe-7.0/thermo_pw

[1] https://github.com/WayneD/rsync

HZ

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor