]> git.phdru.name Git - git-scripts.git/commitdiff
Add `fix-permissions-repos`
authorOleg Broytman <phd@phdru.name>
Mon, 6 Jan 2025 01:10:07 +0000 (04:10 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 6 Jan 2025 01:10:07 +0000 (04:10 +0300)
fix-permissions-repos [new file with mode: 0755]
pull-usrlocalsrc

diff --git a/fix-permissions-repos b/fix-permissions-repos
new file mode 100755 (executable)
index 0000000..b8e01ca
--- /dev/null
@@ -0,0 +1,15 @@
+#! /bin/sh
+
+prog_dir="`dirname \"$0\"`" &&
+
+cat "$prog_dir"/locate-all.list |
+    grep -v "^$HOME/Internet/WWW/htdocs/git.phdru.name/" |
+while read d; do
+    echo "----- $d -----"; cd "$d" &&
+    if test -d "$d/.git"; then cd "$d/.git"; fi && # bare repo
+    chmod -R u=rwX,go= . &&
+    find objects -type f -exec chmod u=r,go= '{}' \+
+done &&
+
+cd "$HOME/Internet/WWW/htdocs/git.phdru.name/" &&
+pwd && exec chmod -R u=rwX,go=rX .
index c7159ada349311b42b2170e494c4c84c7621f9dd..4b524d793a7641ceb9a55076fd6cb0655c95ff9d 100755 (executable)
@@ -6,7 +6,7 @@ has_remote() {
 
 prog_dir="`dirname \"$0\"`" &&
 
-cat "$prog_dir"/locate-all.list | grep -F /usr/local/src |
+cat "$prog_dir"/locate-all.list | grep "^/usr/local/src/" |
 while read d; do
    echo "----- $d -----"; cd "$d" &&
    if has_remote upstream && has_remote origin; then