infra/codestorage/hg-repo-sync

Paddy 2015-11-12 Parent:c8b4b952488a

4:32a993adf753 tip Browse Files

Fix nested repository permissions. For repositories nested inside folders, fix the permissions on the folders so we can create other repositories inside them. Before, we only fixed the permissions on the repositories themselves; now we also fix the root directory that holds the repository.

pull.sh

     1.1 --- a/pull.sh	Wed Oct 14 23:04:31 2015 -0700
     1.2 +++ b/pull.sh	Thu Nov 12 21:31:15 2015 -0800
     1.3 @@ -46,6 +46,14 @@
     1.4  	fi
     1.5  	chgrp -R 2000 /mounted/repos${target}
     1.6  	chmod -R 0770 /mounted/repos${target}
     1.7 +	if [[ "$target" == *\/* ]]
     1.8 +	then
     1.9 +		stripped_target=${target#*/}
    1.10 +		stripped_target=${stripped_target%%/*}
    1.11 +		echo "Changing ownership of /mounted/repos/${stripped_target}"
    1.12 +		chgrp -R 2000 /mounted/repos/${stripped_target}
    1.13 +		chmod -R 0770 /mounted/repos/${stripped_target}
    1.14 +	fi
    1.15  done
    1.16  
    1.17  echo "Cleaning up..."