mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-07 21:15:19 +03:00
tools: make uninstall, reduces noise when testing
Tries to unregister all three hledger packages from the user's package db (not cabal sandbox aware).
This commit is contained in:
parent
33499a9957
commit
4ec9bc4c53
9
Makefile
9
Makefile
@ -26,6 +26,7 @@ PRINT=lpr
|
||||
|
||||
GHC=ghc
|
||||
GHCI=ghci
|
||||
GHCPKG=ghc-pkg
|
||||
HADDOCK=haddock
|
||||
CABAL=cabal
|
||||
CABALINSTALL=cabal install -w $(GHC)
|
||||
@ -198,6 +199,14 @@ installdeps:
|
||||
installdeps-force:
|
||||
$(CABALINSTALL) $(patsubst %,./%,$(PACKAGES)) $(EXTRAINSTALLARGS) --enable-tests --only-dependencies --allow-newer --force-reinstalls
|
||||
|
||||
# unregister all packages, assuming they are defined lowest-dependency first
|
||||
# avoids some reinstall noise when repeatedly doing make install
|
||||
uninstall:
|
||||
-for p in $(call reverse,$(PACKAGES)); do $(GHCPKG) unregister $$p; done
|
||||
|
||||
# utility function
|
||||
reverse = $(if $(wordlist 2,2,$(1)),$(call reverse,$(wordlist 2,$(words $(1)),$(1))) $(firstword $(1)),$(1))
|
||||
|
||||
# run a cabal command in all hledger package dirs
|
||||
allcabal%:
|
||||
for p in $(PACKAGES); do (echo doing cabal $* in $$p; cd $$p; cabal $*; echo); done
|
||||
|
Loading…
Reference in New Issue
Block a user