]> git.e2factory.org Git - e2factory.git/commitdiff
Get rid of the duplicate e2-locate-project-root tool
authorTobias Ulmer <tu@emlix.com>
Wed, 1 Aug 2012 14:13:07 +0000 (16:13 +0200)
committerTobias Ulmer <tu@emlix.com>
Wed, 1 Aug 2012 14:13:07 +0000 (16:13 +0200)
It is required during make local, at which point we have a global
installation and can therefore use the global tool.

Signed-off-by: Tobias Ulmer <tu@emlix.com>
Makefile
global/e2-install-e2.lua.in
make.vars
scripts/e2-locate-project-root [deleted file]

index d14021e0aae48668d09b623eb8c9057de88d3e39..d0f7e8c48e779e7a0e6f5cecb2916edb676e3af0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -103,7 +103,7 @@ local: e2commit buildconfig.lua
        $(MAKE) -C extensions local
 
 install-local:
-       scripts/e2-locate-project-root
+       $(BINDIR)/e2-locate-project-root
        @echo removing old installation...
        rm -rf $(LOCALBINDIR)
        rm -rf $(LOCALLIBDIR)
index 54f66d50b50ca8a5e89a74cb23eb06a5c5187094..6e14f6c71caeef54fd5f82f3b51ef7f5f33b6005 100755 (executable)
@@ -30,8 +30,6 @@ require("e2lib")
 require("e2option")
 require("generic_git")
 
-install_prefix = buildconfig.PREFIX
-
 e2lib.init()
 
 e2option.documentation = [[
@@ -199,8 +197,8 @@ rc, re = e2lib.chdir(root .. "/.e2/e2")
 if not rc then
   e2lib.abort(e:cat(re))
 end
-local cmd = string.format("make PREFIX=%s local install-local",
-  e2lib.shquote(install_prefix))
+local cmd = string.format("make PREFIX=%s BINDIR=%s local install-local",
+  e2lib.shquote(buildconfig.PREFIX), e2lib.shquote(buildconfig.BINDIR))
 rc, re = e2lib.callcmd_capture(cmd)
 if rc ~= 0 then
   e2lib.abort(e:cat(re))
index f03894e7c1588eb829c5993a932f49c003fc51f1..795b779556b4920649e5f5355da9f389f0568b40 100644 (file)
--- a/make.vars
+++ b/make.vars
@@ -38,7 +38,7 @@ export DEFAULT_LOCAL_BRANCH DEFAULT_LOCAL_TAG
 
 DETECT_TOOL = $(TOPLEVEL)/scripts/detect_tool
 
-PROJECTDIR ?= $(shell cd $(TOPLEVEL);scripts/e2-locate-project-root 2>/dev/null)
+PROJECTDIR ?= $(shell cd $(TOPLEVEL) && $(BINDIR)/e2-locate-project-root 2>/dev/null)
 E2DATA = /mnt/e2data
 export E2DATA PROJECTDIR
 
diff --git a/scripts/e2-locate-project-root b/scripts/e2-locate-project-root
deleted file mode 100755 (executable)
index 5606c3d..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-export LC_ALL=C
-while [ '!' -d .e2 ] ; do
-       if [ "$PWD" = "/" ] ; then
-               echo >&2 \
-                   "e2-locate-project-root: Not in a project environment."
-               exit 1
-       fi
-       cd ..
-done
-echo $PWD