Skip to content

The existing version fails on symlinks#41

Open
struckma wants to merge 1 commit intoDaehwanKimLab:masterfrom
struckma:patch-1
Open

The existing version fails on symlinks#41
struckma wants to merge 1 commit intoDaehwanKimLab:masterfrom
struckma:patch-1

Conversation

@struckma
Copy link

Great tool, thank you! However, I would like to propose a patch, because we have a small problem with relative symlinks for the current tophat2.sh start script:

readlink returns the plain content of the symlink, which may be a relative path resolved from the directory, the link lives in, for example "../Cellar/tophat/2.1.1_1/bin/tophat2" in case of the brew system (homebrew or linuxbrew). The relative path is handled different by the existing tophat2.sh-script than by a shell resolving a symlink. The shell would resolve it relatively to the link's directory, the original tophat2.sh script tries to resolve it relatively to the current working directory, which usually fails. The proposed change will take care of this issue and set DIR to the real directory tophat2.sh lives in.
For Linux only, the readlink command supports a "-f" parameter making it return the canonical path, but this is non-standard and won't work e.g. on a Mac.

I have tested my patch on Ubuntu 16.04 with linuxbrew and will test it on a current Mac OS X El Capitan, as soon as possible (currently, there seems to be some network problem with homebrew).

I would really be thankful, if you could consider my change, because we heavily use the brew system and would have to patch after each update otherwise. Thank you,

Stephan

Great tool, thank you! However, I would like to propose a patch, because we have a small problem with relative symlinks for the current tophat2.sh start script:

readlink returns the plain content of the symlink, which may be a relative path resolved from the directory, the link lives in, for example "../Cellar/tophat/2.1.1_1/bin/tophat2" in case of the brew system (homebrew or linuxbrew). The relative path is handled different by the existing tophat2.sh-script than by a shell resolving a symlink. The shell would resolve it relatively to the link's directory, the original tophat2.sh script tries to resolve it relatively to the current working directory, which usually fails. The proposed change will take care of this issue and set DIR to the real directory tophat2.sh lives in.
For Linux only, the readlink command supports a "-f" parameter making it return the canonical path, but this is non-standard and won't work e.g. on a Mac.

I have tested my patch on Ubuntu 16.04 with linuxbrew and will test it on a current Mac OS X El Capitan, as soon as possible (currently, there seems to be some network problem with homebrew).

I would really be thankful, if you could consider my change, because we heavily use the brew system and would have to patch after each update otherwise. Thank you,

Stephan
@struckma
Copy link
Author

Ok, now I could test it on OS X: Results: The error does not occur on this platform, but the modification anyway works -- and the bug on Ubuntu linuxbrew has been fixed. I don't have any Cygwin ready to test, so, sorry, cannot test that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant