#2722: GetComponents places KadathThorn inside repos/KadathThorn instead of Cactus/repos/KadathThorn
Reporter:Zach Etienne
Status:new
Milestone:
Version:
Type:bug
Priority:major
Component:

Comment (by Roland Haas):

Grr. The issue is very confusing. It boils down to how cd acts. One would assume that it just passes its given path to the os’s cwd call. But no. That is not what is does. It tries to first contract the string (acts on .../). To get reproducible behaviour one must pass the -P option to a (POSIX confirming) cd command. See https://unix.stackexchange.com/a/55715 and https://pubs.opengroup.org/onlinepubs/9699919799/utilities/cd.html Otherwise (depending on the shell that actually provides sh) one can end up with:

$ ls Cactus/arrangements/Fuka/KadathThorn/src/fuka/../../../../repos/KadathThorn/src/fuka/
foo
$ cd Cactus/arrangements/Fuka/KadathThorn/src/fuka/../../../../repos/KadathThorn/src/fuka/
sh: 23: cd: can't cd to Cactus/arrangements/Fuka/KadathThorn/src/fuka/../../../../repos/KadathThorn/src/fuka/
$ cd -P Cactus/arrangements/Fuka/KadathThorn/src/fuka/../../../../repos/KadathThorn/src/fuka/
$ ls
foo

Not sure how to fix this without changing GetComponents code. I am somewhat reluctant to change GetComponent’s code to add an (obscure?) option to its cd which then eg BSD cd on OSX does not support…

--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2722/getcomponents-places-kadaththorn-inside