Thread (13 messages) flat view 13 messages, 3 authors, 2016-06-15
DORMANTno replies

[PATCH] git-gui: Adapt discovery of oguilib to execdir 'libexec/git-core'

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:45:06
Subsystem: the rest · Maintainer: Linus Torvalds

The new execdir has is two levels below the root directory, while
the old execdir 'bin' was only one level below.  This commit
adapts the discovery of oguilib that uses relative paths
accordingly. We determine whether we have the extra level in the same
way in which the Makefile defines sharedir, i.e. whether the last
directory part is 'git-core'.

Inspired-by: Steffen Prohaska [off-list ref]
Signed-off-by: Johannes Sixt <redacted>
---

Zitat von Steffen Prohaska [off-list ref]:
On Aug 3, 2008, at 11:35 AM, Johannes Sixt wrote:
quoted
I run git-gui effectivly with

  wish $prefix/libexec/git-core/git-gui

(and I have $PATH set up to contain $bindir, but not $gitexecdir),
and this
needs the original hunk with the three [file dirname ... ], because
$argv0
points to $prefix/libexec/git-core/git-gui.
The original hunk fixes the discovery of oguilib, i.e.
from $prefix/libexec/git-core/git-gui to $prefix/share/git-gui/lib

I didn't recognize that the the 'three [file dinames ...]' have
not been applied because I had this change already in 4msysgit
(and still have).  Apologies for not checking this more carefully.

quoted
I thought I understood what's going on, but I don't anymore.

Mybe the relative discovery of oguilib must be conditional on the
"git-core"
part as well, just like you discover sharedir?
Hmm... you are right.  If we want to maintain compatibility
with *both* directory layouts, obviously all computations
that depend on the layout need to be conditional on it.
Here is a patch that does just this.

-- Hannes

 git-gui/git-gui.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index fd3875a..fa08d49 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -52,7 +52,11 @@ catch {rename send {}} ; # What an evil concept...
 set oguilib {@@GITGUI_LIBDIR@@}
 set oguirel {@@GITGUI_RELATIVE@@}
 if {$oguirel eq {1}} {
-	set oguilib [file dirname [file dirname [file normalize $argv0]]]
+	set oguilib [file dirname [file normalize $argv0]]
+	if {[lindex [file split $oguilib] end] eq {git-core}} {
+		set oguilib [file dirname $oguilib]
+	}
+	set oguilib [file dirname $oguilib]
 	set oguilib [file join $oguilib share git-gui lib]
 	set oguimsg [file join $oguilib msgs]
 } elseif {[string match @@* $oguirel]} {
-- 
1.6.0.rc1.958.gce1ed
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help