[gem5-dev] Change in public/gem5[master]: scons: Detect and remove broken git hook symlinks.

2017-03-26 Thread Gabe Black (Gerrit)
Gabe Black has submitted this change and it was merged. (  
https://gem5-review.googlesource.com/2540 )


Change subject: scons: Detect and remove broken git hook symlinks.
..

scons: Detect and remove broken git hook symlinks.

When installing a git hook, it's possible for the hook to not "exist" if  
it's
actually a symlink which points to a file that doesn't exist. Trying to  
create

a new symlink in its place without first removing the old one causes a build
failure in these cases.

If the hook doesn't "exist" but is still a link, that means it's actually a
broken link and should be deleted by the hook installation function before  
any

new symlink is created.

Change-Id: I59aa51feb5bd74ca33e51e89cde2ceabeb41bd76
Reviewed-on: https://gem5-review.googlesource.com/2540
Reviewed-by: Jason Lowe-Power 
Reviewed-by: Andreas Sandberg 
Maintainer: Andreas Sandberg 
---
M SConstruct
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Andreas Sandberg: Looks good to me, approved; Looks good to me, approved



diff --git a/SConstruct b/SConstruct
index b4ab0bf..4593fdd 100755
--- a/SConstruct
+++ b/SConstruct
@@ -393,6 +393,10 @@
 print "Warning: Can't install %s, hook already exists." %  
hook_name

 return

+if hook.islink():
+print "Warning: Removing broken symlink for hook %s." %  
hook_name

+os.unlink(hook.get_abspath())
+
 if not git_hooks.exists():
 mkdir(git_hooks.get_abspath())


--
To view, visit https://gem5-review.googlesource.com/2540
To unsubscribe, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I59aa51feb5bd74ca33e51e89cde2ceabeb41bd76
Gerrit-Change-Number: 2540
Gerrit-PatchSet: 2
Gerrit-Owner: Gabe Black 
Gerrit-Reviewer: Andreas Sandberg 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Jason Lowe-Power 
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

[gem5-dev] Change in public/gem5[master]: scons: Detect and remove broken git hook symlinks.

2017-03-25 Thread Gabe Black (Gerrit)
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/2540



Change subject: scons: Detect and remove broken git hook symlinks.
..

scons: Detect and remove broken git hook symlinks.

When installing a git hook, it's possible for the hook to not "exist" if  
it's
actually a symlink which points to a file that doesn't exist. Trying to  
create

a new symlink in its place without first removing the old one causes a build
failure in these cases.

If the hook doesn't "exist" but is still a link, that means it's actually a
broken link and should be deleted by the hook installation function before  
any

new symlink is created.

Change-Id: I59aa51feb5bd74ca33e51e89cde2ceabeb41bd76
---
M SConstruct
1 file changed, 4 insertions(+), 0 deletions(-)



diff --git a/SConstruct b/SConstruct
index b4ab0bf..4593fdd 100755
--- a/SConstruct
+++ b/SConstruct
@@ -393,6 +393,10 @@
 print "Warning: Can't install %s, hook already exists." %  
hook_name

 return

+if hook.islink():
+print "Warning: Removing broken symlink for hook %s." %  
hook_name

+os.unlink(hook.get_abspath())
+
 if not git_hooks.exists():
 mkdir(git_hooks.get_abspath())


--
To view, visit https://gem5-review.googlesource.com/2540
To unsubscribe, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I59aa51feb5bd74ca33e51e89cde2ceabeb41bd76
Gerrit-Change-Number: 2540
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
___
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev