From 1506abc995479ad6b3ce8e0ba5201fa2639bf13c Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Tue, 18 Jun 2019 11:55:49 -0400 Subject: changes to make the updater suitable for running from cron --- Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 285897c..36c1cee 100755 --- a/Makefile +++ b/Makefile @@ -57,7 +57,15 @@ global_symlink=$(bindir)/firefox install_targets = $(symlink) $(global_symlink) $(desktop_file) $(alternatives) .PHONY: install beta nightly stable $(install_targets) +ifndef UPDATE +# 'sudo make UPDATE=y' is suitable to run from cron (no output if nothing +# changed upstream) install: $(install_targets) +else +maybe_symlink := $(if $(shell [ "$$(readlink $(symlink))" != "$(notdir $(destdir))" ] && echo y),$(symlink)) +install: $(maybe_symlink) + @: +endif $(global_symlink): mkdir -p $(dir $@) @@ -74,7 +82,7 @@ ifdef ROOT_INSTALL endif $(symlink): $(destdir) - cd $(dir $@) && ln -sf $(notdir $(destdir)) $(notdir $@) + ln -srnf $(destdir) $@ beta nightly stable: install @@ -82,7 +90,7 @@ $(destdir): $(tarball) mkdir -p $(tempdir) tar -C $(tempdir) --strip-components=1 -jxf $< mv -T $(tempdir) $(destdir) - rm $(tarball) || true + @rm $(tarball) || true .INTERMEDIATE: $(tarball) -- cgit v1.2.3