[X2Go-Commits] [maintenancescripts] 01/01: git/misc/update-repository-posixacls: handle symlinks correctly.

git-admin at x2go.org git-admin at x2go.org
Mon Mar 9 06:17:15 CET 2015


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository maintenancescripts.

commit 4414e792ced6bb59554cd871f88076a8e5ac8290
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Mon Mar 9 06:17:09 2015 +0100

    git/misc/update-repository-posixacls: handle symlinks correctly.
---
 git/misc/update-repository-posixacls |   40 ++++++++++++++++++++++++----------
 1 file changed, 28 insertions(+), 12 deletions(-)

diff --git a/git/misc/update-repository-posixacls b/git/misc/update-repository-posixacls
index 3e65482..561c812 100755
--- a/git/misc/update-repository-posixacls
+++ b/git/misc/update-repository-posixacls
@@ -12,34 +12,50 @@ pushd "${PACKAGE}.git"
 # hooks
 [ -f hooks/post-receive.tmp ] && {
   if ! [ -e hooks/post-receive ] || ! [ -L hooks/post-receive ]; then
-    cp hooks/post-receive.tmp hooks/post-receive
-    chmod 0755 hooks/post-receive
-    rm hooks/post-receive.tmp
+    if [ -L hooks/post-receive.tmp ]; then
+      mv hooks/post-receive.tmp hooks/post-receive
+    else
+      cp hooks/post-receive.tmp hooks/post-receive
+      chmod 0755 hooks/post-receive
+      rm hooks/post-receive.tmp
+    fi
   fi
 }
 
 [ -f hooks/update.tmp ] && {
   if ! [ -e hooks/update ] || ! [ -L hooks/update ]; then
-    cp hooks/update.tmp hooks/update
-    chmod 0755 hooks/update
-    rm hooks/update.tmp
+    if [ -L hooks/update ]; then
+      mv hooks/update.tmp hooks/update
+    else
+      cp hooks/update.tmp hooks/update
+      chmod 0755 hooks/update
+      rm hooks/update.tmp
+    fi
   fi
 }
 
 # ACLs
 [ -f info/allowed-users.tmp ] && {
   if ! [ -e info/allowed-users ] || ! [ -L info/allowed-users ]; then
-    cp info/allowed-users.tmp info/allowed-users
-    chmod 0640 info/allowed-users
-    rm info/allowed-users.tmp
+    if [ -L info/allowed-users.tmp ]; then
+      mv info/allowed-users.tmp info/allowed-users
+    else
+      cp info/allowed-users.tmp info/allowed-users
+      chmod 0640 info/allowed-users
+      rm info/allowed-users.tmp
+    fi
   fi
 }
 
 [ -f info/allowed-groups.tmp ] && {
   if ! [ -e info/allowed-groups ] || ! [ -L info/allowed-groups ]; then
-    cp info/allowed-groups.tmp info/allowed-groups
-    chmod 0640 info/allowed-groups
-    rm info/allowed-groups.tmp
+    if [ -L info/allowed-groups.tmp ]; then
+      mv info/allowed-groups.tmp info/allowed-groups
+    else
+      cp info/allowed-groups.tmp info/allowed-groups
+      chmod 0640 info/allowed-groups
+      rm info/allowed-groups.tmp
+    fi
   fi
 }
 

--
Alioth's /srv/git/code.x2go.org/maintenancescripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/maintenancescripts.git


More information about the x2go-commits mailing list