aboutsummaryrefslogtreecommitdiffstats
path: root/filesystem/Makefile
diff options
context:
space:
mode:
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