aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 13 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 1c80c03..f543b59 100644
--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,20 @@
.POSIX:
update:
- +@for PKG in *; do \
- if test -d "$${PKG}"; then \
- if ./check-installed "$${PKG}" 2>/dev/null; then \
- if ! ./check-installed "$$(readlink -- "$${PKG}")" 2>/dev/null; then \
- printf -- '\033[1mcd %s && %s install\033[m\n' "$${PKG}" '$(MAKE)'; \
- (cd -- "$${PKG}" && $(MAKE) install); \
+ +@for PKGDIR in *; do \
+ if test -d "$${PKGDIR}"; then \
+ PKG="$$(printf '%s@\n' "$${PKGDIR}" | cut -d @ -f 1)"; \
+ HOST="$$(printf '%s@\n' "$${PKGDIR}" | cut -d @ -f 2 | tr A-Z a-z)"; \
+ if test -z "$${HOST}" || test "$${HOST}" = "$$(hostname | tr A-Z a-z)"; then \
+ if ./check-installed "$${PKG}" 2>/dev/null; then \
+ if ! ./check-installed "$$(readlink -- "$${PKG}")" 2>/dev/null; then \
+ printf -- '\033[1mcd %s && %s install\033[m\n' "$${PKGDIR}" '$(MAKE)'; \
+ (cd -- "$${PKGDIR}" && $(MAKE) install); \
+ fi; \
+ else\
+ printf -- '\033[1mcd %s && %s uninstall\033[m\n' "$${PKGDIR}" '$(MAKE)'; \
+ (cd -- "$${PKGDIR}" && $(MAKE) uninstall || :); \
fi; \
- else\
- printf -- '\033[1mcd %s && %s uninstall\033[m\n' "$${PKG}" '$(MAKE)'; \
- (cd -- "$${PKG}" && $(MAKE) uninstall || :); \
fi; \
fi; \
done