root may or maynot be a symlink

This commit is contained in:
2025-08-06 12:57:36 -04:00
parent 7b9fb215b9
commit 71e35ef5f5
3 changed files with 6 additions and 6 deletions

View File

@@ -27,7 +27,7 @@ tmpfiles: ## Run this after editing files under tmpfiles.d
.PHONY: save-perms .PHONY: save-perms
save-perms: ## Saves the file permissions to ./acl. Run this after adding new files with correct permissions save-perms: ## Saves the file permissions to ./acl. Run this after adding new files with correct permissions
getfacl --recursive `readlink root` | ./makepac/sort_acl.sh > acl getfacl --recursive $(shell basename $(shell readlink -f root)) | ./makepac/sort_acl.sh > acl
.PHONY: set-perms .PHONY: set-perms
set-perms: ## Restores permissions of all files from ./acl set-perms: ## Restores permissions of all files from ./acl
@@ -35,8 +35,8 @@ set-perms: ## Restores permissions of all files from ./acl
.PHONY: user-perms .PHONY: user-perms
user-perms: ## Grant running user all permissions. Need for git operations. Does not get copied to real filesystem user-perms: ## Grant running user all permissions. Need for git operations. Does not get copied to real filesystem
find `readlink root` -type d | xargs sudo setfacl -m "u:${USER}:rwx" find $(shell basename $(shell readlink -f root)) -type d | xargs sudo setfacl -m "u:${USER}:rwx"
find `readlink root` -type f | xargs sudo setfacl -m "u:${USER}:r" find $(shell basename $(shell readlink -f root)) -type f | xargs sudo setfacl -m "u:${USER}:r"
.PHONY: skel .PHONY: skel
skel: ## Creates common directories needed skel: ## Creates common directories needed

View File

@@ -10,8 +10,8 @@ Initial setup
mkdir myfiles mkdir myfiles
cd myfiles cd myfiles
git init git init
git submodule add https://gitlab.com/balki/makepac' git submodule add https://gitlab.com/balki/makepac
echo "include makepac/Makefile" > Makefile' echo "include makepac/Makefile" > Makefile
sudo apt install acl sudo apt install acl
make skel make skel
git add . git add .

View File

@@ -1,6 +1,6 @@
#!/usr/bin/bash #!/usr/bin/bash
root=$(readlink root) root=$(basename $(readlink -f root))
all_files() { all_files() {
find "$root" -type f,l find "$root" -type f,l