Compare commits
4 Commits
gitgui-0.7
...
gitgui-0.7
Author | SHA1 | Date | |
---|---|---|---|
ea75ee3598 | |||
3d5793bf52 | |||
306fc12462 | |||
b9e7efb8b5 |
31
Makefile
31
Makefile
@ -11,6 +11,7 @@ SCRIPT_SH = git-gui.sh
|
|||||||
GITGUI_BUILT_INS = git-citool
|
GITGUI_BUILT_INS = git-citool
|
||||||
ALL_PROGRAMS = $(GITGUI_BUILT_INS) $(patsubst %.sh,%,$(SCRIPT_SH))
|
ALL_PROGRAMS = $(GITGUI_BUILT_INS) $(patsubst %.sh,%,$(SCRIPT_SH))
|
||||||
ALL_LIBFILES = $(wildcard lib/*.tcl)
|
ALL_LIBFILES = $(wildcard lib/*.tcl)
|
||||||
|
PRELOAD_FILES = lib/class.tcl
|
||||||
|
|
||||||
ifndef SHELL_PATH
|
ifndef SHELL_PATH
|
||||||
SHELL_PATH = /bin/sh
|
SHELL_PATH = /bin/sh
|
||||||
@ -21,7 +22,7 @@ ifndef gitexecdir
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef sharedir
|
ifndef sharedir
|
||||||
sharedir := $(dir $(gitexecdir))/share
|
sharedir := $(dir $(gitexecdir))share
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef INSTALL
|
ifndef INSTALL
|
||||||
@ -32,6 +33,7 @@ ifndef V
|
|||||||
QUIET_GEN = @echo ' ' GEN $@;
|
QUIET_GEN = @echo ' ' GEN $@;
|
||||||
QUIET_BUILT_IN = @echo ' ' BUILTIN $@;
|
QUIET_BUILT_IN = @echo ' ' BUILTIN $@;
|
||||||
QUIET_INDEX = @echo ' ' INDEX $(dir $@);
|
QUIET_INDEX = @echo ' ' INDEX $(dir $@);
|
||||||
|
QUIET_2DEVNULL = 2>/dev/null
|
||||||
endif
|
endif
|
||||||
|
|
||||||
TCL_PATH ?= tclsh
|
TCL_PATH ?= tclsh
|
||||||
@ -45,17 +47,25 @@ endif
|
|||||||
DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
|
DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
|
||||||
gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
|
gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
|
||||||
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
|
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
|
||||||
|
TCL_PATH_SQ = $(subst ','\'',$(TCL_PATH))
|
||||||
TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
|
TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
|
||||||
|
|
||||||
libdir ?= $(sharedir)/git-gui/lib
|
libdir ?= $(sharedir)/git-gui/lib
|
||||||
libdir_SQ = $(subst ','\'',$(libdir))
|
libdir_SQ = $(subst ','\'',$(libdir))
|
||||||
|
|
||||||
|
exedir = $(dir $(gitexecdir))share/git-gui/lib
|
||||||
|
exedir_SQ = $(subst ','\'',$(exedir))
|
||||||
|
|
||||||
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
|
$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
|
||||||
$(QUIET_GEN)rm -f $@ $@+ && \
|
$(QUIET_GEN)rm -f $@ $@+ && \
|
||||||
|
if test '$(exedir_SQ)' = '$(libdir_SQ)'; then \
|
||||||
|
GITGUI_RELATIVE=1; \
|
||||||
|
fi && \
|
||||||
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
|
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
|
||||||
-e 's|^exec wish "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' \
|
-e 's|^exec wish "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' \
|
||||||
-e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
|
-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 >$@+ && \
|
$@.sh >$@+ && \
|
||||||
chmod +x $@+ && \
|
chmod +x $@+ && \
|
||||||
mv $@+ $@
|
mv $@+ $@
|
||||||
@ -64,17 +74,28 @@ $(GITGUI_BUILT_INS): git-gui
|
|||||||
$(QUIET_BUILT_IN)rm -f $@ && ln git-gui $@
|
$(QUIET_BUILT_IN)rm -f $@ && ln git-gui $@
|
||||||
|
|
||||||
lib/tclIndex: $(ALL_LIBFILES)
|
lib/tclIndex: $(ALL_LIBFILES)
|
||||||
$(QUIET_INDEX)echo \
|
$(QUIET_INDEX)if echo \
|
||||||
source lib/class.tcl \; \
|
$(foreach p,$(PRELOAD_FILES),source $p\;) \
|
||||||
auto_mkindex lib '*.tcl' \
|
auto_mkindex lib '*.tcl' \
|
||||||
| $(TCL_PATH)
|
| $(TCL_PATH) $(QUIET_2DEVNULL); then : ok; \
|
||||||
|
else \
|
||||||
|
echo 1>&2 " * $(TCL_PATH) failed; using unoptimized loading"; \
|
||||||
|
rm -f $@ ; \
|
||||||
|
echo '# Autogenerated by git-gui Makefile' >$@ && \
|
||||||
|
echo >>$@ && \
|
||||||
|
$(foreach p,$(PRELOAD_FILES) $(ALL_LIBFILES),echo '$(subst lib/,,$p)' >>$@ &&) \
|
||||||
|
echo >>$@ ; \
|
||||||
|
fi
|
||||||
|
|
||||||
# These can record GITGUI_VERSION
|
# These can record GITGUI_VERSION
|
||||||
$(patsubst %.sh,%,$(SCRIPT_SH)): GIT-VERSION-FILE GIT-GUI-VARS
|
$(patsubst %.sh,%,$(SCRIPT_SH)): GIT-VERSION-FILE GIT-GUI-VARS
|
||||||
|
lib/tclIndex: GIT-GUI-VARS
|
||||||
|
|
||||||
TRACK_VARS = \
|
TRACK_VARS = \
|
||||||
$(subst ','\'',SHELL_PATH='$(SHELL_PATH_SQ)') \
|
$(subst ','\'',SHELL_PATH='$(SHELL_PATH_SQ)') \
|
||||||
|
$(subst ','\'',TCL_PATH='$(TCL_PATH_SQ)') \
|
||||||
$(subst ','\'',TCLTK_PATH='$(TCLTK_PATH_SQ)') \
|
$(subst ','\'',TCLTK_PATH='$(TCLTK_PATH_SQ)') \
|
||||||
|
$(subst ','\'',gitexecdir='$(gitexecdir_SQ)') \
|
||||||
$(subst ','\'',libdir='$(libdir_SQ)') \
|
$(subst ','\'',libdir='$(libdir_SQ)') \
|
||||||
#end TRACK_VARS
|
#end TRACK_VARS
|
||||||
|
|
||||||
|
44
git-gui.sh
44
git-gui.sh
@ -25,10 +25,41 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA}
|
|||||||
## configure our library
|
## configure our library
|
||||||
|
|
||||||
set oguilib {@@GITGUI_LIBDIR@@}
|
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 oguilib [file join [file dirname [file normalize $argv0]] lib]
|
||||||
}
|
}
|
||||||
set auto_path [concat [list $oguilib] $auto_path]
|
set idx [file join $oguilib tclIndex]
|
||||||
|
catch {
|
||||||
|
set fd [open $idx r]
|
||||||
|
if {[gets $fd] eq {# Autogenerated by git-gui Makefile}} {
|
||||||
|
set idx [list]
|
||||||
|
while {[gets $fd n] >= 0} {
|
||||||
|
if {$n ne {} && ![string match #* $n]} {
|
||||||
|
lappend idx $n
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
set idx {}
|
||||||
|
}
|
||||||
|
close $fd
|
||||||
|
}
|
||||||
|
if {$idx ne {}} {
|
||||||
|
set loaded [list]
|
||||||
|
foreach p $idx {
|
||||||
|
if {[lsearch -exact $loaded $p] >= 0} continue
|
||||||
|
puts $p
|
||||||
|
source [file join $oguilib $p]
|
||||||
|
lappend loaded $p
|
||||||
|
}
|
||||||
|
unset loaded p
|
||||||
|
} else {
|
||||||
|
set auto_path [concat [list $oguilib] $auto_path]
|
||||||
|
}
|
||||||
|
unset -nocomplain oguilib oguirel idx fd
|
||||||
|
|
||||||
if {![catch {set _verbose $env(GITGUI_VERBOSE)}]} {
|
if {![catch {set _verbose $env(GITGUI_VERBOSE)}]} {
|
||||||
unset _verbose
|
unset _verbose
|
||||||
@ -1179,15 +1210,12 @@ foreach class {Button Checkbutton Entry Label
|
|||||||
}
|
}
|
||||||
unset class
|
unset class
|
||||||
|
|
||||||
if {[is_Windows]} {
|
if {[is_MacOSX]} {
|
||||||
set M1B Control
|
|
||||||
set M1T Ctrl
|
|
||||||
} elseif {[is_MacOSX]} {
|
|
||||||
set M1B M1
|
set M1B M1
|
||||||
set M1T Cmd
|
set M1T Cmd
|
||||||
} else {
|
} else {
|
||||||
set M1B M1
|
set M1B Control
|
||||||
set M1T M1
|
set M1T Ctrl
|
||||||
}
|
}
|
||||||
|
|
||||||
proc apply_config {} {
|
proc apply_config {} {
|
||||||
|
Reference in New Issue
Block a user