diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 22 |
1 files changed, 13 insertions, 9 deletions
@@ -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 |