2167 illumos-userland needs support for git
authorAndrew Stormont <andrew.stormont@nexenta.com>
Thu, 23 Feb 2012 15:42:47 +0000
changeset 489 d476c1718ce0
parent 488 8e8c25bf32f7
child 490 0de5925f0c53
2167 illumos-userland needs support for git
make-rules/shared-macros.mk
--- a/make-rules/shared-macros.mk	Tue Feb 21 09:32:20 2012 +0000
+++ b/make-rules/shared-macros.mk	Thu Feb 23 15:42:47 2012 +0000
@@ -31,8 +31,14 @@
 
 export DOWNLOAD_SEARCH_PATH +=	$(ARCHIVE_MIRROR)
 
-# The workspace starts at the mercurial root
-export WS_TOP ?=		$(shell hg root)
+# The workspace starts at the mercurial/git root
+HG_ROOT = $(shell hg root 2>/dev/null)
+
+ifneq (,$(HG_ROOT))
+WS_TOP = $(HG_ROOT)
+else
+WS_TOP = $(shell dirname $(shell cd $(shell git rev-parse --git-dir) && pwd))
+endif
 
 # we want our pkg piplines to fail if there is an error
 # (like if pkgdepend fails in the middle of a pipe), but