summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2020-06-18 11:24:48 -0400
committerJoey Hess2020-06-18 11:27:22 -0400
commita2b47d3a3c8d64ccf7b1444a4608b88bd470aff6 (patch)
tree61e4d033cc008a4e5111e719390855a30ec2bd8c
parent745784f61bdd678e20b1b18743f18d458836a802 (diff)
tail the dist-newstyle find
Unfortunately builds for previous versions can linger in there. Which may be a cruft accumulation problem generally, but for now I don't want it to fail if more than one is found. Assuming that the last item in the find will be the newest. This commit was sponsored by Brock Spratlen on Patreon.
-rw-r--r--Makefile2
-rw-r--r--src/Propellor/Bootstrap.hs2
2 files changed, 2 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index b5d5708b..8f0414fe 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ DATE := $(shell dpkg-parsechangelog 2>/dev/null | grep Date | cut -d " " -f2-)
build: tags propellor.1 configured
$(CABAL) build
@if [ -d dist-newstyle ]; then \
- ln -sf $$(find dist-newstyle/ -executable -type f | grep 'build/propellor-config/propellor-config$$') propellor; \
+ ln -sf $$(find dist-newstyle/ -executable -type f | grep 'build/propellor-config/propellor-config$$' | tail -n1) propellor; \
else \
ln -sf dist/build/propellor-config/propellor-config propellor; \
fi
diff --git a/src/Propellor/Bootstrap.hs b/src/Propellor/Bootstrap.hs
index 0fef92f1..84a26ee3 100644
--- a/src/Propellor/Bootstrap.hs
+++ b/src/Propellor/Bootstrap.hs
@@ -83,7 +83,7 @@ buildCommand bs = intercalate " && " (go (getBuilder bs))
, "cabal build -j1 propellor-config"
, intercalate "; "
[ "if [ -d dist-newstyle ]"
- , "then ln -sf $(find dist-newstyle/ -executable -type f | grep 'build/propellor-config/propellor-config$') propellor"
+ , "then ln -sf $(find dist-newstyle/ -executable -type f | grep 'build/propellor-config/propellor-config$' | tail -n1) propellor"
, "else ln -sf dist/build/propellor-config/propellor-config propellor"
, "fi"
]