Bug in UpdateFromUpstream.sh

Not sure exactly where the bug lies, but I just triggered a bug trying to use UpdateFromUpstream.sh.

Essentially, it seems to be triggered if your CWD when you execute the script has a symlink as part of the path, in my case:

~/projects/src/ITK/Modules/ThirdParty/MINC
#projects is a symlink

This broke UpdateFromUpstream.sh in such a way that it couldn’t merge properly and ended up modifying the top-level CMakeLists.txt.

If instead I de-referenced the symlink so my CWD was real:

> cd $(realpath .)
#now in /data/chamal/projects/gabriel/src/ITK/Modules/ThirdParty/MINC

All is well.

@gdevenyi good detective work :male_detective:

Does adding the realpath invocation here:

fix the issue?

Yup, replacing pwd with realpath . fixes it.

Note: I’m not sure realpath is by default available on all systems.

Great.

Please, test this patch, which uses perl to work on Linux and macOS:

http://review.source.kitware.com/#/c/23637

Updating from upstream is not done frequently, and it does not have to work on as many operating systems as normal ITK.

1 Like