Skip to content

Commit 82a2d6b

Browse files
committed
git-gui: Correctly install to /usr/bin on Cygwin
Mark Levedahl <[email protected]> noted that installation on Cygwin to /usr/bin can cause problems with the automatic guessing of our library location. The problem is that installation to /usr/bin means we actually have: /usr/bin = c:\cygwin\bin /usr/share = c:\cygwin\usr\share So git-gui guesses that its library should be found within the c:\cygwin\share directory, as that is where it should be relative to the script itself in c:\cygwin\bin. In my first version of this patch I tried to use `cygpath` to resolve /usr/bin and /usr/share to test that they were in the same relative locations, but that didn't work out correctly as we were actually testing /usr/share against itself, so it always was equal, and we always used relative paths. So my original solution was quite wrong. Mark suggested we just always disable relative behavior on Cygwin, because of the complexity of the mount mapping problem, so that's all I'm doing. Signed-off-by: Shawn O. Pearce <[email protected]>
1 parent 39fa2a9 commit 82a2d6b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
77
@$(SHELL_PATH) ./GIT-VERSION-GEN
88
-include GIT-VERSION-FILE
99

10+
uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
11+
1012
SCRIPT_SH = git-gui.sh
1113
GITGUI_BUILT_INS = git-citool
1214
ALL_PROGRAMS = $(GITGUI_BUILT_INS) $(patsubst %.sh,%,$(SCRIPT_SH))
@@ -58,8 +60,12 @@ exedir_SQ = $(subst ','\'',$(exedir))
5860

5961
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
6062
$(QUIET_GEN)rm -f $@ $@+ && \
63+
GITGUI_RELATIVE= && \
6164
if test '$(exedir_SQ)' = '$(libdir_SQ)'; then \
62-
GITGUI_RELATIVE=1; \
65+
if test "$(uname_O)" = Cygwin; \
66+
then GITGUI_RELATIVE= ; \
67+
else GITGUI_RELATIVE=1; \
68+
fi; \
6369
fi && \
6470
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
6571
-e 's|^exec wish "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' \

0 commit comments

Comments
 (0)