summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-05-29 03:23:10 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-05-29 03:23:10 (GMT)
commitc63a3ad2c1d6f86cd7989055a133e06055239317 (patch)
tree6f7a8d02c0f5677b9d79d14f7a59655fc4400eab
parent59d10247e444b752a993cf4aa2e0665bc633d32f (diff)
parentea75ee3598ab6f8d0828f8cc6ec3d4a5f8d66813 (diff)
downloadgit-c63a3ad2c1d6f86cd7989055a133e06055239317.zip
git-c63a3ad2c1d6f86cd7989055a133e06055239317.tar.gz
git-c63a3ad2c1d6f86cd7989055a133e06055239317.tar.bz2
Merge branch 'maint' of git://repo.or.cz/git-gui into maint
* 'maint' of git://repo.or.cz/git-gui: git-gui: Guess our share/git-gui/lib path at runtime if possible Correct key bindings to Control-<foo> git-gui: Tighten internal pattern match for lib/ directory
-rw-r--r--git-gui/Makefile12
-rwxr-xr-xgit-gui/git-gui.sh17
2 files changed, 19 insertions, 10 deletions
diff --git a/git-gui/Makefile b/git-gui/Makefile
index ee56421..3de0de1 100644
--- a/git-gui/Makefile
+++ b/git-gui/Makefile
@@ -22,7 +22,7 @@ ifndef gitexecdir
endif
ifndef sharedir
- sharedir := $(dir $(gitexecdir))/share
+ sharedir := $(dir $(gitexecdir))share
endif
ifndef INSTALL
@@ -53,12 +53,19 @@ TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
libdir ?= $(sharedir)/git-gui/lib
libdir_SQ = $(subst ','\'',$(libdir))
+exedir = $(dir $(gitexecdir))share/git-gui/lib
+exedir_SQ = $(subst ','\'',$(exedir))
+
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
$(QUIET_GEN)rm -f $@ $@+ && \
+ if test '$(exedir_SQ)' = '$(libdir_SQ)'; then \
+ GITGUI_RELATIVE=1; \
+ fi && \
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-e 's|^exec wish "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' \
-e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
- -e 's|@@GITGUI_LIBDIR@@|$(libdir_SQ)|' \
+ -e 's|@@GITGUI_RELATIVE@@|'$$GITGUI_RELATIVE'|' \
+ -e $$GITGUI_RELATIVE's|@@GITGUI_LIBDIR@@|$(libdir_SQ)|' \
$@.sh >$@+ && \
chmod +x $@+ && \
mv $@+ $@
@@ -88,6 +95,7 @@ TRACK_VARS = \
$(subst ','\'',SHELL_PATH='$(SHELL_PATH_SQ)') \
$(subst ','\'',TCL_PATH='$(TCL_PATH_SQ)') \
$(subst ','\'',TCLTK_PATH='$(TCLTK_PATH_SQ)') \
+ $(subst ','\'',gitexecdir='$(gitexecdir_SQ)') \
$(subst ','\'',libdir='$(libdir_SQ)') \
#end TRACK_VARS
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 0a471a5..dba5851 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -25,7 +25,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA}
## configure our library
set oguilib {@@GITGUI_LIBDIR@@}
-if {[string match @@* $oguilib]} {
+set oguirel {@@GITGUI_RELATIVE@@}
+if {$oguirel eq {1}} {
+ set oguilib [file dirname [file dirname [file normalize $argv0]]]
+ set oguilib [file join $oguilib share git-gui lib]
+} elseif {[string match @@* $oguirel]} {
set oguilib [file join [file dirname [file normalize $argv0]] lib]
}
set idx [file join $oguilib tclIndex]
@@ -55,7 +59,7 @@ if {$idx ne {}} {
} else {
set auto_path [concat [list $oguilib] $auto_path]
}
-unset -nocomplain fd idx
+unset -nocomplain oguilib oguirel idx fd
if {![catch {set _verbose $env(GITGUI_VERBOSE)}]} {
unset _verbose
@@ -1206,15 +1210,12 @@ foreach class {Button Checkbutton Entry Label
}
unset class
-if {[is_Windows]} {
- set M1B Control
- set M1T Ctrl
-} elseif {[is_MacOSX]} {
+if {[is_MacOSX]} {
set M1B M1
set M1T Cmd
} else {
- set M1B M1
- set M1T M1
+ set M1B Control
+ set M1T Ctrl
}
proc apply_config {} {