aboutsummaryrefslogtreecommitdiffstats
path: root/filesystem/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-11-18 23:23:40 +0100
committerMattias Andrée <maandree@kth.se>2023-11-18 23:23:40 +0100
commit0f1df0db903ba576fd17b08197d3066af7a61e5f (patch)
treea59c04307b1382257afa3c3512ec3abadf7e0e47 /filesystem/Makefile
parentUse losetup -d instead of --detach and add clean up (diff)
downloaddotfiles-0f1df0db903ba576fd17b08197d3066af7a61e5f.tar.gz
dotfiles-0f1df0db903ba576fd17b08197d3066af7a61e5f.tar.bz2
dotfiles-0f1df0db903ba576fd17b08197d3066af7a61e5f.tar.xz
A lot of changes
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'filesystem/Makefile')
-rw-r--r--filesystem/Makefile18
1 files changed, 12 insertions, 6 deletions
diff --git a/filesystem/Makefile b/filesystem/Makefile
index c726699..69433f5 100644
--- a/filesystem/Makefile
+++ b/filesystem/Makefile
@@ -1,5 +1,4 @@
.POSIX:
-include ../common.mk
HIDE =\
Templates\
@@ -14,14 +13,20 @@ HIDE =\
password.gpg\
mnt
+CACHE_REAL != (mount | sed -n 's|^[^ ]* on \('"$${HOME}"'/.cache\)\(/[^ ]*\)\? .*$$|\1|p' ; printf '%s\n' "$$HOME/.var/cache") | sed 1q
+CACHE_LINK != printf '%s\n' "$$HOME/.var/cache" "$$HOME/.cache" | grep -v '$(CACHE_REAL)'
+IF_VAR_CACHE_IS_REAL != if ! test "$(CACHE_REAL)" = "$$HOME/.var/cache"; then printf '@: \n'; fi
+IF_HOME_CACHE_IS_REAL != if ! test "$(CACHE_REAL)" = "$$HOME/.cache"; then printf '@: \n'; fi
+
install:
mkdir -p -- ~/.config
- mkdir -p -- ~/.var/cache/.thumbnails
+ mkdir -p -- $(CACHE_REAL)/.thumbnails
rm -rf -- ~/.config/.cache
- rm -rf -- ~/.cache
+ rm -rf -- $(CACHE_LINK)
rm -rf -- ~/.thumbnails
ln -sf -- ../.cache ~/.config/.cache
- ln -sf -- .var/cache ~/.cache
+ $(IF_VAR_CACHE_IS_REAL) ln -sf -- .var/cache ~/.cache
+ $(IF_HOME_CACHE_IS_REAL) ln -sf -- ../.cache ~/.var/cache
ln -sf -- .cache/.thumbnails ~/.thumbnails
mkdir -p -- ~/.var/opt
mkdir -p -- ~/.var/games
@@ -76,8 +81,11 @@ install:
fi
uninstall:
+ +! ../check-installed filesystem
+ +! ../check-installed base-files
-unlink -- ~/.config/user-dirs.dirs
-unlink -- ~/.config/.cache
+ -unlink -- ~/.var/cache
-unlink -- ~/.cache
-unlink -- ~/.thumbnails
-unlink -- ~/.spool
@@ -112,5 +120,3 @@ uninstall:
-for f in $(HIDE) cryptokey.gpg; do \
test ! -e ~/.hidden || grep -v '^'"$$f"'$$' < ~/.hidden | sponge ~/.hidden; \
done
-
-.PHONY: install uninstall