Hoa Nguyen has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/38655 )

Change subject: scons: Fix the scons script failing to install git hooks
......................................................................

scons: Fix the scons script failing to install git hooks

A recent change https://gem5-review.googlesource.com/c/public/gem5/+/38616
removed the 'root' environment variable, while the git hooks installation
script relies on the variable. This commit addresses this problem.

Change-Id: I2d27861794021a6a60ef8668461e4127cb1db261
Signed-off-by: Hoa Nguyen <hoangu...@ucdavis.edu>
---
M site_scons/site_tools/git.py
1 file changed, 4 insertions(+), 3 deletions(-)



diff --git a/site_scons/site_tools/git.py b/site_scons/site_tools/git.py
index c5b2d5d..e528fa7 100644
--- a/site_scons/site_tools/git.py
+++ b/site_scons/site_tools/git.py
@@ -53,6 +53,7 @@
 Press enter to continue, or ctrl-c to abort: """

 def install_style_hooks(env):
+    root_dir = env.Dir("#")
     try:
         gitdir = env.Dir(readCommand(
             ["git", "rev-parse", "--git-dir"]).strip("\n"))
@@ -85,7 +86,7 @@

         # Use a relative symlink if the hooks live in the source directory,
         # and the hooks directory is not a symlink to an absolute path.
-        if hook.is_under(env.root) and not abs_symlink_hooks:
+        if hook.is_under(root_dir) and not abs_symlink_hooks:
             script_path = os.path.relpath(
                 os.path.realpath(script.get_abspath()),
                 os.path.realpath(hook.Dir(".").get_abspath()))
@@ -108,8 +109,8 @@
         print("Input exception, exiting scons.\n")
         sys.exit(1)

-    git_style_script = env.root.Dir("util").File("git-pre-commit.py")
-    git_msg_script = env.root.Dir("ext").File("git-commit-msg")
+    git_style_script = env.Dir("#util").File("git-pre-commit.py")
+    git_msg_script = env.Dir("#ext").File("git-commit-msg")

     hook_install("pre-commit", git_style_script)
     hook_install("commit-msg", git_msg_script)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/38655
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I2d27861794021a6a60ef8668461e4127cb1db261
Gerrit-Change-Number: 38655
Gerrit-PatchSet: 1
Gerrit-Owner: Hoa Nguyen <hoangu...@ucdavis.edu>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to