summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2019-06-18 11:55:49 -0400
committerAndrew Cady <d@jerkface.net>2019-06-18 11:55:49 -0400
commit1506abc995479ad6b3ce8e0ba5201fa2639bf13c (patch)
tree3fcfe2a6965bac0112c51126fe7254db333776b9
parenta3ab1ef1a1e0b390fdbbe2534cd66a62f4c47279 (diff)
changes to make the updater suitable for running from cron
-rwxr-xr-xMakefile12
1 files changed, 10 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 285897c..36c1cee 100755
--- a/Makefile
+++ b/Makefile
@@ -57,7 +57,15 @@ global_symlink=$(bindir)/firefox
57 57
58install_targets = $(symlink) $(global_symlink) $(desktop_file) $(alternatives) 58install_targets = $(symlink) $(global_symlink) $(desktop_file) $(alternatives)
59.PHONY: install beta nightly stable $(install_targets) 59.PHONY: install beta nightly stable $(install_targets)
60ifndef UPDATE
61# 'sudo make UPDATE=y' is suitable to run from cron (no output if nothing
62# changed upstream)
60install: $(install_targets) 63install: $(install_targets)
64else
65maybe_symlink := $(if $(shell [ "$$(readlink $(symlink))" != "$(notdir $(destdir))" ] && echo y),$(symlink))
66install: $(maybe_symlink)
67 @:
68endif
61 69
62$(global_symlink): 70$(global_symlink):
63 mkdir -p $(dir $@) 71 mkdir -p $(dir $@)
@@ -74,7 +82,7 @@ ifdef ROOT_INSTALL
74endif 82endif
75 83
76$(symlink): $(destdir) 84$(symlink): $(destdir)
77 cd $(dir $@) && ln -sf $(notdir $(destdir)) $(notdir $@) 85 ln -srnf $(destdir) $@
78 86
79beta nightly stable: install 87beta nightly stable: install
80 88
@@ -82,7 +90,7 @@ $(destdir): $(tarball)
82 mkdir -p $(tempdir) 90 mkdir -p $(tempdir)
83 tar -C $(tempdir) --strip-components=1 -jxf $< 91 tar -C $(tempdir) --strip-components=1 -jxf $<
84 mv -T $(tempdir) $(destdir) 92 mv -T $(tempdir) $(destdir)
85 rm $(tarball) || true 93 @rm $(tarball) || true
86 94
87.INTERMEDIATE: $(tarball) 95.INTERMEDIATE: $(tarball)
88 96