diff --git a/.appveyor.yml b/.appveyor.yml index cb2203cbc..ca3ffc621 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -41,10 +41,13 @@ install: #- dir # install latest stack release -# - curl -skL -ostack.zip http://www.stackage.org/stack/windows-x86_64 -# - 7z x stack.zip stack.exe -# - copy stack.exe stack-release.exe -# - stack --version +#- curl -skL -ostack.zip http://www.stackage.org/stack/windows-x86_64 +#- 7z x stack.zip stack.exe + +# install latest stack prerelease +- curl -skLO https://github.com/commercialhaskell/stack/releases/download/v1.9.0.1/stack-1.9.0.1-windows-x86_64.tar.gz +- 7z x stack-1.9.0.1-windows-x86_64.tar.gz -so | 7z e -si -ttar stack-1.9.0.1-windows-x86_64/stack.exe -aoa +- stack --version # install latest stack 4125-cabal-style-build-tools branch # - set PATH=C:\Users\appveyor\AppData\Roaming\local\bin;%PATH% @@ -53,24 +56,25 @@ install: # - copy C:\Users\appveyor\AppData\Roaming\local\bin\stack.exe stack.exe # install latest stack master -- set PATH=C:\Users\appveyor\AppData\Roaming\local\bin;%PATH% +#- set PATH=C:\Users\appveyor\AppData\Roaming\local\bin;%PATH% # show the stack-installed binares that were restored from cache, can vary by instance -- dir C:\Users\appveyor\AppData\Roaming\local\bin +#- dir C:\Users\appveyor\AppData\Roaming\local\bin # - stack-release upgrade --git #- copy C:\Users\appveyor\AppData\Roaming\local\bin\stack.exe C:\Users\appveyor\AppData\Roaming\local\bin\stack-master.exe # - copy C:\Users\appveyor\AppData\Roaming\local\bin\stack.exe stack.exe -- stack --version +#- stack --version #- dir # # install ghc #- stack setup -# use ghc 8.2 to avoid a hledger-web -> network/stack build issue on windows, -# network 2.7.0.1 should work around it when released +# use ghc 8.2 to avoid hledger-web -> network/stack/ghc/windows build issue # https://github.com/haskell/network/issues/313 # https://github.com/commercialhaskell/stack/issues/3944 -- stack --stack-yaml=stack-ghc8.2.yaml setup +# network 2.7.0.1 is supposed to work around it +- stack setup --stack-yaml=stack-ghc8.2.yaml +#- stack setup #- set PATH=C:\Users\appveyor\AppData\Roaming\local\bin;%PATH% #- stack install shelltestrunner @@ -79,9 +83,13 @@ install: # hledger-ui's vty dep isn't available on windows # hledger-api not tried recently build_script: -#- stack build --test --copy-bins --local-bin-path=. hledger hledger-web -- stack build --test --copy-bins --local-bin-path=. hledger hledger-web --stack-yaml=stack-ghc8.2.yaml +# use network 2.7.0.1+ to avoid https://github.com/haskell/network/issues/313 +#- stack build --test --copy-bins --local-bin-path=. hledger hledger-web network-2.7.0.2 +# use ghc 8.2 to avoid hledger-web -> network/stack/ghc/windows build issue +# don't run test suites to avoid easytest/windows utf8 issue +- stack build --copy-bins --local-bin-path=. hledger hledger-web --stack-yaml=stack-ghc8.2.yaml - 7z a -tzip hledger.zip hledger.exe hledger-web.exe + #- hledger-install/hledger-install.sh #- make stacktest diff --git a/.version b/.version index 096015870..e3920ffa9 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -1.11 +1.11.99 diff --git a/Shake.hs b/Shake.hs index cb702354b..1dd60c115 100755 --- a/Shake.hs +++ b/Shake.hs @@ -138,7 +138,7 @@ main = do webmanpages = ["site" > manpageNameToUri m <.> "md" | m <- manpageNames] -- versions of documentation (excluding 0.27) - docversions = [ "1.0" , "1.1" , "1.2" , "1.3" , "1.4" , "1.5" , "1.9", "1.10" ] + docversions = [ "1.0" , "1.1" , "1.2" , "1.3" , "1.4" , "1.5" , "1.9", "1.10", "1.11" ] -- manuals rendered to html by pandoc webhtmlpages diff --git a/doc/ANNOUNCE b/doc/ANNOUNCE index 5f53aa8c2..655121331 100644 --- a/doc/ANNOUNCE +++ b/doc/ANNOUNCE @@ -1,73 +1,65 @@ -hledger (http://hledger.org) is a friendly, robust, cross-platform -program for tracking money, time or other commodities, using -double-entry accounting, simple plain text file formats, and -command-line, curses or web UIs. +hledger is a robust, cross-platform "plain text accounting" tool, for +tracking money, time, stocks, cryptocurrencies or any other commodity, +using double-entry accounting, private or shared plain text files, +revision control, and command-line, curses or web UIs. -I'm very pleased to announce hledger 1.10, including work by release -contributors: - -Alex Chen, -Everett Hildenbrandt, -Jakub Zárybnický, -Nolan Darilek, -Dmitry Astapov, -Jacob Weisz, -Peter Simons, -Stephen Morgan, -Pavlo Kerestey, -Trevor Riles, -Léo Gaspard, -Mykola Orliuk, -Wad, -Nana Amfo. - -You'll note this is not 2.0 as previously planned - we will spend a -bit more time on that. The next major release is expected to be on -2018/09/30. - -Please see http://hledger.org/release-notes#hledger-1.10 for the changes -(as soon as I can get to those; until then, the package changelogs): - -http://hackage.haskell.org/package/hledger-1.10/changelog -http://hackage.haskell.org/package/hledger-ui-1.10/changelog -http://hackage.haskell.org/package/hledger-web-1.10/changelog -http://hackage.haskell.org/package/hledger-api-1.10/changelog -http://hackage.haskell.org/package/hledger-lib-1.10/changelog +I'm pleased to announce the on-schedule release of hledger 1.12. +Thanks to release contributors: A, B. +What's new +---------- -How to get started: -------------------- +hledger 1.12 -See http://hledger.org/download for all install methods. +- -One of the easiest is the hledger-install script, which requires only -bash and will build and install the hledger tools in $HOME/.local/bin/: +- -$ curl -O https://raw.githubusercontent.com/simonmichael/hledger/master/hledger-install/hledger-install.sh -$ less hledger-install.sh # do security review +Full release notes are at http://hledger.org/release-notes.html#hledger-1.12 + + +Install +------- + +All install methods are described at http://hledger.org/download . +You can download windows binaries, or use a package manager, though in +some cases these will install an older hledger version. + +You can build the latest hledger packages with stack: + +$ stack install --resolver=lts-12 cassava-megaparsec-1.0.0 hledger-lib-1.11 + hledger-1.11 [hledger-ui-1.11] [hledger-web-1.11] [hledger-api-1.11] + +or with cabal: + +$ cabal update && cabal install hledger-1.11 [hledger-ui-1.11] + [hledger-web-1.11] [hledger-api-1.11] + +If you don't have stack or cabal, or if you are having trouble, +on systems with bash installed (mac, linux, unix-like windows..) +hledger-install.sh is an easy and reliable way to get the latest hledger: + +$ curl -s https://raw.githubusercontent.com/simonmichael/hledger/master/hledger-install/hledger-install.sh > hledger-install.sh +$ less hledger-install.sh # satisfy yourself that the script is safe $ bash hledger-install.sh -or (insecure; add -x flag to bash to see commands that were run): -$ curl https://raw.githubusercontent.com/simonmichael/hledger/master/hledger-install/hledger-install.sh | bash +Getting started +--------------- -After installation, ensure $HOME/.local/bin is in your $PATH, and try some commands: - -$ hledger -h # quick help -$ hledger help # list built-in manuals -$ hledger add # record some transactions +$ hledger add # record some transactions, with guidance +$ hledger print # show recorded transactions +$ hledger balance # show totals by account +$ hledger -h # show quick help $ hledger # list available commands +$ hledger help # list built-in manuals -Next, I encourage you to at least skim the tutorials and docs at -http://hledger.org. - -Say hello and ask questions in the #hledger IRC channel on Freenode: -http://irc.hledger.org. - -New users and contributors are always welcome! Give feedback, report -bugs, send pull requests, write, evangelise, help sustain us by donating. +To get oriented, see the tutorials and manuals at http://hledger.org . +To get help, say hello and ask questions in the #hledger IRC channel +on Freenode, accessible at http://irc.hledger.org . +New users and all forms of help are always welcome! -Best! +Best, -Simon diff --git a/doc/CHANGES b/doc/CHANGES deleted file mode 100644 index 68e818b61..000000000 --- a/doc/CHANGES +++ /dev/null @@ -1,129 +0,0 @@ -Project-wide changes in the hledger project. -See also the package change logs. - - -# 1.1 (2016/12/31) and newer: -project changes are now kept at http://hledger.org/release-notes . - -# 1.0.1 (2016/10/27) - -- change log/release note fixes - - -# 1.0 (2016/10/26) - -## misc - -- added GHC 8 support, dropped GHC 7.6 and 7.8 support. - - GHC 7.8 support could be restored with small code changes and a maintainer. - -- a cabal.project file has been added (Moritz Kiefer) - -- use hpack for maintaining cabal files (#371). - - Instead of editing cabal files directly, we now edit the less - verbose and less redundant package.yaml files and let stack (or - hpack) update the cabal files. We commit both the .yaml and - .cabal files. - -- clean up some old cabal flags - -- tools/simplebench has been spun off as the quickbench package. - -- add Appveyor CI builds, provide up-to-date binaries for Windows - -- extra: add a bunch of CSV rules examples - -## docs - -- the website is simpler, clearer, and more mobile-friendly. - - Docs are now collected on a single page and organised by type: getting started, reference, more. - -- reference docs have been split into one manual for each executable and file format. - - This helps with maintenance and packaging and also should make it - easier to see what's available and to read just what you need. - -- manuals are now provided in html, plain text, man and info formats - - generated from the same source by a new Shake-based docs build system. (#292) - -- versioned manuals are provided on the website, covering recent releases and the latest dev version (#385, #387) - -- manuals are built in to the hledger executables, allowing easy offline reading on all platforms. - - PROG -h shows PROG's command-line usage - PROG --help shows PROG's manual (fixed width) - PROG --man shows PROG's manual with man (formatted/paged) - PROG --info shows PROG's manual with info (hypertext) - hledger help [TOPIC] shows any manual - hledger man [TOPIC] shows any manual with man - hledger info [TOPIC] shows any manual with info - -- the general and reporting options are now listed in all executable manuals. - - We assume any of them which are unsupported are harmlessly ignored. - -- demo.hledger.org is using beancount's example journal. - - This is the somewhat realistic example journal from the beancount - project, tweaked for hledger. - -- minor copyedits (jungle-boogie) - -## cli - -- parsing multiple input files is now robust. - - When multiple -f options are provided, we now parse each file - individually rather than just concatenating them, so they can - have different formats (#320). Note this also means that - directives (like \`Y\` or \`alias\`) no longer carry over from one - file to the next. - -- -I has been added as the short flag for --ignore-assertions - - (this is different from Ledger's CLI, but useful for hledger-ui). - -- parsing an argument-less --debug option is more robust - - - -0.27 (2015/10/31) - -- The site is now built with hakyll-std, a generic hakyll script. - -- The hledger cabal files are now generated from package.yaml files by - hpack, in principle, removing a lot of error-prone duplication and - boilerplate. (In practice, both files are being updated manually - for the moment, until hpack supports flags and conditional blocks.) - -- Time/allocation and heap profiling is working again, and easier: - - - `make quickprof-CMD` generates a profile for CMD, which runs - against one of the sample journals. (CMD must be one word, - enclosing in double quotes isn't working here for some reason). - - - `make quickheap-CMD` generates a heap profile for CMD, in - hledgerprof.ps, and tries to open it in a viewer (currently the - mac-friendly "open" executable, so you may need to adjust this in - the makefile). As with quickprof, CMD must be one word and runs - against one of the sample journals. - - - `make hledgerprof` builds the hledgerprof executable used for - time/allocation profiling. `make hledgercov` builds the hledgercov - executable used for coverage reports. - -- Travis CI now tests the build on each github push and announces - status changes by email and on #hledger. - -- hledger once again has a HCAR entry. - -- Each hledger package now includes one or more man pages, generated - from markdown by the mighty pandoc. Currently there are six: one - for each main executable and each input file format. Currently these - somewhat duplicate the manual on the website; this will be resolved - somehow. - diff --git a/doc/lib.m4 b/doc/lib.m4 index ea7f7a336..80c078f28 100644 --- a/doc/lib.m4 +++ b/doc/lib.m4 @@ -8,7 +8,7 @@ m4_define({{_webcombined_}}, m4_ifdef({{WEB && COMBINED}},{{$1}}) )m4_dnl m4_dnl m4_define({{_author_}}, {{}})m4_dnl m4_define({{_monthyear_}}, {{September 2018}})m4_dnl -m4_define({{_version_}}, {{1.10.99}})m4_dnl +m4_define({{_version_}}, {{1.11.99}})m4_dnl m4_dnl m4_dnl Links to dev and recent release versions of a manual. m4_dnl $1 is the manual's web slug: hledger, hledger-ui, journal, csv etc. diff --git a/hledger-api/CHANGES b/hledger-api/CHANGES index fbe5b1c3e..0f421974a 100644 --- a/hledger-api/CHANGES +++ b/hledger-api/CHANGES @@ -1,6 +1,11 @@ User-visible changes in hledger-api. See also hledger, hledger-lib. +# 1.11.1 (2018/10/06) + +* use hledger 1.11.1 + + # 1.11 (2018/9/30) * use hledger 1.11 diff --git a/hledger-api/hledger-api.1 b/hledger-api/hledger-api.1 index 0d4801786..eb752ebb2 100644 --- a/hledger-api/hledger-api.1 +++ b/hledger-api/hledger-api.1 @@ -1,5 +1,5 @@ -.TH "hledger\-api" "1" "September 2018" "hledger\-api 1.10.99" "hledger User Manuals" +.TH "hledger\-api" "1" "September 2018" "hledger\-api 1.11.99" "hledger User Manuals" diff --git a/hledger-api/hledger-api.cabal b/hledger-api/hledger-api.cabal index bb1b0768d..4dfd0f60f 100644 --- a/hledger-api/hledger-api.cabal +++ b/hledger-api/hledger-api.cabal @@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack -- --- hash: 7f5a11be3e9db0d4fcebb5b663ee988461de6d815042a7785f9076e083dde205 +-- hash: 79786a2effbdf3258e88ee988c7cbbab5951550bac768bab7cbd1c9080fd198d name: hledger-api -version: 1.11 +version: 1.11.99 synopsis: Web API server for the hledger accounting tool description: This is a simple web API server for hledger data. It comes with a series of simple client-side web app examples. @@ -45,7 +45,7 @@ executable hledger-api other-modules: Paths_hledger_api ghc-options: -threaded - cpp-options: -DVERSION="1.11" + cpp-options: -DVERSION="1.11.99" build-depends: Decimal , aeson @@ -55,8 +55,8 @@ executable hledger-api , data-default >=0.5 , docopt , either - , hledger >=1.11 && <1.12 - , hledger-lib >=1.11 && <1.12 + , hledger >=1.11.99 && <1.12 + , hledger-lib >=1.11.99 && <1.12 , microlens >=0.4 , microlens-platform >=0.2.3.1 , safe diff --git a/hledger-api/hledger-api.hs b/hledger-api/hledger-api.hs index db910dfdc..87368cb7f 100644 --- a/hledger-api/hledger-api.hs +++ b/hledger-api/hledger-api.hs @@ -37,12 +37,12 @@ import Text.Printf import Hledger.Query import Hledger.Cli hiding (Reader, version) -hledgerApiVersion="1.11" +hledgerApiVersion="1.11.99" -- https://github.com/docopt/docopt.hs#readme doc :: Docopt doc = [docopt| -hledger-api 1.11 +hledger-api 1.11.99 Serves hledger data and reports as a JSON web API. diff --git a/hledger-api/hledger-api.info b/hledger-api/hledger-api.info index 175617437..8ab16d99c 100644 --- a/hledger-api/hledger-api.info +++ b/hledger-api/hledger-api.info @@ -3,7 +3,7 @@ This is hledger-api.info, produced by makeinfo version 6.5 from stdin. File: hledger-api.info, Node: Top, Next: OPTIONS, Up: (dir) -hledger-api(1) hledger-api 1.10.99 +hledger-api(1) hledger-api 1.11.99 ********************************** hledger-api is a simple web API server, intended to support client-side diff --git a/hledger-api/hledger-api.txt b/hledger-api/hledger-api.txt index 0f6ac6917..434e766f5 100644 --- a/hledger-api/hledger-api.txt +++ b/hledger-api/hledger-api.txt @@ -117,4 +117,4 @@ SEE ALSO -hledger-api 1.10.99 September 2018 hledger-api(1) +hledger-api 1.11.99 September 2018 hledger-api(1) diff --git a/hledger-api/package.yaml b/hledger-api/package.yaml index 672a757af..3fa57319a 100644 --- a/hledger-api/package.yaml +++ b/hledger-api/package.yaml @@ -1,5 +1,5 @@ name: hledger-api -version: '1.11' +version: '1.11.99' synopsis: Web API server for the hledger accounting tool description: | This is a simple web API server for hledger data. @@ -32,8 +32,8 @@ extra-source-files: #data-files: dependencies: -- hledger-lib >=1.11 && <1.12 -- hledger >=1.11 && <1.12 +- hledger-lib >=1.11.99 && <1.12 +- hledger >=1.11.99 && <1.12 - base >=4.8 && <4.12 - aeson - bytestring @@ -58,4 +58,4 @@ executables: hledger-api: main: hledger-api.hs ghc-options: -threaded - cpp-options: -DVERSION="1.11" + cpp-options: -DVERSION="1.11.99" diff --git a/hledger-install/hledger-install.sh b/hledger-install/hledger-install.sh index f4a025612..2c6e3c223 100755 --- a/hledger-install/hledger-install.sh +++ b/hledger-install/hledger-install.sh @@ -50,7 +50,7 @@ HERE HLEDGER_INSTALL_TOOL=hledger-install.sh # this script's version -HLEDGER_INSTALL_VERSION=20181001 +HLEDGER_INSTALL_VERSION=20181006 # stackage version to install from when using stack # You can specify a different stackage version here, or comment out @@ -77,7 +77,7 @@ hledger-interest \ " # latest hledger package versions, update often: -HLEDGER_VERSION=1.11 +HLEDGER_VERSION=1.11.1 HLEDGER_LIB_VERSION=$HLEDGER_VERSION HLEDGER_UI_VERSION=$HLEDGER_VERSION HLEDGER_WEB_VERSION=$HLEDGER_VERSION @@ -768,15 +768,58 @@ trap cleanup_temp_dir EXIT # hledger routines +# Compare dotted number version strings, based on https://stackoverflow.com/a/4025065/84401. +# cmpver A B's exit status *and* output is +# 0 for A ~= B (1 is equivalent to 1.0, 1.0.0 etc.) +# 1 for A > B +# 2 for A < B. +cmpver () { + if [[ $1 == $2 ]] + then + echo 0; return 0 + fi + local IFS=. + local i ver1=($1) ver2=($2) + # fill empty fields in ver1 with zeros + for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)) + do + ver1[i]=0 + done + for ((i=0; i<${#ver1[@]}; i++)) + do + if [[ -z ${ver2[i]} ]] + then + # fill empty fields in ver2 with zeros + ver2[i]=0 + fi + if ((10#${ver1[i]} > 10#${ver2[i]})) + then + echo 1; return 1 + fi + if ((10#${ver1[i]} < 10#${ver2[i]})) + then + echo 2; return 2 + fi + done + echo 0; return 0 +} + # install stack or a newer version of stack if needed, # or always with --force-install-stack, -# in $HOME/.local/bin +# in $HOME/.local/bin. +# After installing, check that a new-enough stack is now the first in $PATH, +# and if it's not, exit with a warning advising the user to remove the old one. ensure_stack() { if ! has_good_stack || [[ "$FORCE_INSTALL_STACK" == "true" ]] ; then echo "Installing stack" do_os + if ! has_good_stack ; then + echo "Error: an older stack ($(cmd_version stack)) is first in \$PATH, shadowing the new version." + echo "Please delete or rename $(which stack) and run hledger-install again." + exit 1 + fi fi - echo "using stack $(stack --version)" + echo "Using stack $(stack --version)" } # get a sed command that supports EREs @@ -791,10 +834,10 @@ cmd_location() { command -v "$1" } -# Get the given command's version, ie the first number in its --version output, +# Get the given command's version, ie the first number in the first line of its --version output, # or empty string if there's a problem. cmd_version() { - (command "$1" --version 2>/dev/null | grep -E '[0-9]' | $SED -e 's/[^0-9]*([0-9][0-9.]*).*/\1/') || "" + (command "$1" --version 2>/dev/null | head -n1 | grep -E '[0-9]' | $SED -e 's/[^0-9]*([0-9][0-9.]*).*/\1/') || "" } # Check whether the given command exists with given version @@ -811,9 +854,9 @@ print_cmd_version() { fi } -# Show the current installation status of the hledger packages and install tools. +# Show the current installation status of the hledger packages. print_installed_versions() { - for cmd in $HLEDGER_MAIN_TOOLS $HLEDGER_OTHER_TOOLS $HLEDGER_INSTALL_TOOL stack cabal ; do print_cmd_version "$cmd"; done + for cmd in $HLEDGER_MAIN_TOOLS $HLEDGER_OTHER_TOOLS $HLEDGER_INSTALL_TOOL ; do print_cmd_version "$cmd"; done } # Run a command, but first log it with "Trying" prepended. @@ -827,29 +870,21 @@ quietly_run() { "$@" 2>/dev/null || true } -# Try to install the executables of the given package(s) to $HOME/.local/bin, -# trying several methods, generally from quickest to most reliable, continuing on failure. -# Current the installation methods are: -# - if stack is not installed and cabal is, try cabal install -# - otherwise install stack if needed and try stack install with specific resolver and ghc -# For the stack method, it's necessary to provide not only the package(s) you want to -# install but also all dependencies which are not in the specified stackage $RESOLVER. +# Try to install the executables of the given haskell package(s) and versions, +# using stack or cabal, logging the commands, continuing on failure. +# It's assumed that either a new-enough stack or cabal-install is already installed. +# stack is preferred. +# For stack, you must specify the package(s) you want to install, plus any additional +# dependency packages which are not in the stackage $RESOLVER configured above. try_install() { - (cd # ensure we install at user level, not in some project's stack/cabal setup - # cabal and not stack installed ? use cabal - (! has_cmd stack && has_cmd cabal && ( - echo "no stack installed, cabal $(cabal --numeric-version) installed; trying cabal install" && # cf cabal update step - try_info cabal install "$@" --verbose="$CABAL_VERBOSITY" ) - ) || - # use stack, installing it if missing or too old - (ensure_stack && ( - #(try_info stack install --install-ghc "$@" --verbosity=$STACK_VERBOSITY ) || # existing resolver - (try_info stack install --install-ghc $RESOLVER "$@" --verbosity="$STACK_VERBOSITY" ) # specific resolver - ) - ) || - # or give up - echo "Failed to install $@" - ) + cd # ensure we install at user level, not in some project's stack/cabal setup + if has_cmd stack ; then + try_info stack install --install-ghc $RESOLVER "$@" --verbosity="$STACK_VERBOSITY" + elif has_cmd cabal ; then + try_info cabal install "$@" --verbose="$CABAL_VERBOSITY" + else + echo "Failed to install $@" + fi } # start @@ -911,7 +946,49 @@ fi echo "hledger-install.sh $HLEDGER_INSTALL_VERSION $(date)" +# show system info +echo +echo "System info:" +quietly_run uname -rsv +quietly_run lsb_release -a + +# show current installed hledger packages +echo +echo "Install status before:" +print_installed_versions + +if [[ $STATUSFLAG ]] ; then + exit 0 +fi + +# explain the planned install method +echo +echo "Install method:" +# if stack is installed, use stack +# || [[ "$FORCE_INSTALL_STACK" == "true" ]] #--force-install-stack +if has_stack ; then + echo "stack $(cmd_version stack) is installed, using stack to install hledger in $HOME/.local/bin" + # if it's too old, explain that we'll be installing the latest + if ! has_good_stack ; then + echo "Note: stack $(cmd_version stack) is too old, a newer version will be installed" + fi + # install stack now (or if new enough, just print its precise version) + ensure_stack +# else if cabal is installed, use cabal +elif has_cmd cabal ; then + echo "no stack installed, cabal $(cabal --numeric-version) installed; using cabal to install hledger in $HOME/.cabal/bin" + echo Using $(cabal --version) # unquoted to squash cabal version to one line + # run cabal update to make sure it knows about latest packages + try_info cabal update +# else use stack +else + echo "no stack or cabal installed; stack will be installed and used to install hledger in $HOME/.local/bin" + # install stack now + ensure_stack +fi + # ensure ~/.local/bin/ in PATH +# TODO should check ~/.cabal/bin if using cabal if ! on_path "$HOME_LOCAL_BIN" ; then echo "WARNING: this script installs hledger (and perhaps stack) in '$HOME_LOCAL_BIN'" echo " but this directory is not in your PATH. Adding it temporarily. To run" @@ -921,63 +998,9 @@ if ! on_path "$HOME_LOCAL_BIN" ; then export PATH=$HOME_LOCAL_BIN:$PATH fi -# show system info -echo "System info:" -quietly_run uname -rsv -quietly_run lsb_release -a - -# show current installed hledger packages -echo "Install status before:" -print_installed_versions - -if [[ $STATUSFLAG ]] ; then - exit 0 -fi - -# if we'll be using cabal, run cabal update once at the start -(! has_cmd stack && has_cmd cabal && - echo "no stack installed, cabal $(cabal --numeric-version) installed; trying cabal update" && # cf try-install() - try_info cabal update -) - -# Compare dotted number version strings, based on https://stackoverflow.com/a/4025065/84401. -# cmpver A B's exit status *and* output is -# 0 for A ~= B (1 is equivalent to 1.0, 1.0.0 etc.) -# 1 for A > B -# 2 for A < B. -cmpver () { - if [[ $1 == $2 ]] - then - echo 0; return 0 - fi - local IFS=. - local i ver1=($1) ver2=($2) - # fill empty fields in ver1 with zeros - for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)) - do - ver1[i]=0 - done - for ((i=0; i<${#ver1[@]}; i++)) - do - if [[ -z ${ver2[i]} ]] - then - # fill empty fields in ver2 with zeros - ver2[i]=0 - fi - if ((10#${ver1[i]} > 10#${ver2[i]})) - then - echo 1; return 1 - fi - if ((10#${ver1[i]} < 10#${ver2[i]})) - then - echo 2; return 2 - fi - done - echo 0; return 0 -} - # try installing each package that needs installing, in turn -echo ---------- +echo +echo Installing hledger packages: if [[ $(cmpver "$(cmd_version hledger 2>/dev/null)" $HLEDGER_VERSION) = 2 ]]; then echo Installing hledger @@ -1003,7 +1026,7 @@ if [[ $(cmpver "$(cmd_version hledger-api 2>/dev/null)" $HLEDGER_API_VERSION) = try_install hledger-api-$HLEDGER_API_VERSION hledger-$HLEDGER_VERSION hledger-lib-$HLEDGER_LIB_VERSION $EXTRA_DEPS echo fi -exit + # Third-party addons. We sometimes build these with an older version # of hledger[-lib], if their bounds have not been updated yet. if [[ $(cmpver "$(cmd_version hledger-diff 2>/dev/null)" $HLEDGER_DIFF_VERSION) = 2 ]]; then @@ -1024,14 +1047,14 @@ if [[ $(cmpver "$(cmd_version hledger-interest 2>/dev/null)" $HLEDGER_INTEREST_V echo fi -echo ---------- - # show new installation status +echo echo "Install status after:" print_installed_versions # warn if $HOME/.local/bin isn't in $PATH check_home_local_bin_on_path +# TODO if we installed with cabal, we should check $HOME/.cabal/bin instead # TODO # check/require ghc-8.0.2+/lts-8+ on osx sierra+ diff --git a/hledger-lib/CHANGES b/hledger-lib/CHANGES index c175ba6ad..4f50096fa 100644 --- a/hledger-lib/CHANGES +++ b/hledger-lib/CHANGES @@ -2,6 +2,12 @@ API-ish changes in the hledger-lib package. Most user-visible changes are noted in the hledger changelog, instead. +# 1.11.1 (2018/10/06) + +* add, lib: fix wrong transaction rendering in balance assertion errors + and when using the add command + + # 1.11 (2018/9/30) * compilation now works when locale is unset (#849) diff --git a/hledger-lib/Hledger/Data/Journal.hs b/hledger-lib/Hledger/Data/Journal.hs index 41e04cdaf..ed6a2069c 100644 --- a/hledger-lib/Hledger/Data/Journal.hs +++ b/hledger-lib/Hledger/Data/Journal.hs @@ -554,7 +554,7 @@ checkBalanceAssertion p@Posting{ pbalanceassertion = Just (ass,_)} amt (case ptransaction p of Nothing -> ":" -- shouldn't happen Just t -> printf " in %s:\nin transaction:\n%s" - (showGenericSourcePos pos) (chomp $ show t) :: String + (showGenericSourcePos pos) (chomp $ showTransaction t) :: String where pos = snd $ fromJust $ pbalanceassertion p) (showPostingLine p) (showDate $ postingDate p) diff --git a/hledger-lib/Hledger/Read/JournalReader.hs b/hledger-lib/Hledger/Read/JournalReader.hs index 06dc034d1..4d87779fa 100644 --- a/hledger-lib/Hledger/Read/JournalReader.hs +++ b/hledger-lib/Hledger/Read/JournalReader.hs @@ -627,7 +627,7 @@ tests_JournalReader = tests "JournalReader" [ ,ptpostings = [] } - -- TODO #807 + -- TODO some weaknesses in periodic transaction parsing, https://github.com/simonmichael/hledger/pull/807#issuecomment-396994403 ,_test "more period text in description after two spaces" $ expectParseEq periodictransactionp "~ monthly from 2018/6 In 2019 we will change this\n" nullperiodictransaction { diff --git a/hledger-lib/hledger-lib.cabal b/hledger-lib/hledger-lib.cabal index 59f934a10..26e4135d7 100644 --- a/hledger-lib/hledger-lib.cabal +++ b/hledger-lib/hledger-lib.cabal @@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack -- --- hash: ec4f3b835e224318ad3608ab36126e3e07d3c54075f648eba27476bb51db15f4 +-- hash: 22a6817292c6f2d53f935ce939331bea06b956c94b4e391d198760704ec294b3 name: hledger-lib -version: 1.11 +version: 1.11.99 synopsis: Core data types, parsers and functionality for the hledger accounting tools description: This is a reusable library containing hledger's core functionality. . diff --git a/hledger-lib/hledger_csv.5 b/hledger-lib/hledger_csv.5 index 179b4dcb7..0817888d2 100644 --- a/hledger-lib/hledger_csv.5 +++ b/hledger-lib/hledger_csv.5 @@ -1,5 +1,5 @@ -.TH "hledger_csv" "5" "September 2018" "hledger 1.10.99" "hledger User Manuals" +.TH "hledger_csv" "5" "September 2018" "hledger 1.11.99" "hledger User Manuals" diff --git a/hledger-lib/hledger_csv.info b/hledger-lib/hledger_csv.info index 1ec870696..72613adc7 100644 --- a/hledger-lib/hledger_csv.info +++ b/hledger-lib/hledger_csv.info @@ -3,7 +3,7 @@ This is hledger_csv.info, produced by makeinfo version 6.5 from stdin. File: hledger_csv.info, Node: Top, Next: CSV RULES, Up: (dir) -hledger_csv(5) hledger 1.10.99 +hledger_csv(5) hledger 1.11.99 ****************************** hledger can read CSV (comma-separated value) files as if they were diff --git a/hledger-lib/hledger_csv.txt b/hledger-lib/hledger_csv.txt index ac7d0f294..74c48acd1 100644 --- a/hledger-lib/hledger_csv.txt +++ b/hledger-lib/hledger_csv.txt @@ -249,4 +249,4 @@ SEE ALSO -hledger 1.10.99 September 2018 hledger_csv(5) +hledger 1.11.99 September 2018 hledger_csv(5) diff --git a/hledger-lib/hledger_journal.5 b/hledger-lib/hledger_journal.5 index 27bb92c41..81c438800 100644 --- a/hledger-lib/hledger_journal.5 +++ b/hledger-lib/hledger_journal.5 @@ -1,6 +1,6 @@ .\"t -.TH "hledger_journal" "5" "September 2018" "hledger 1.10.99" "hledger User Manuals" +.TH "hledger_journal" "5" "September 2018" "hledger 1.11.99" "hledger User Manuals" diff --git a/hledger-lib/hledger_journal.info b/hledger-lib/hledger_journal.info index 8a2b2c3f3..d955c71ed 100644 --- a/hledger-lib/hledger_journal.info +++ b/hledger-lib/hledger_journal.info @@ -4,7 +4,7 @@ stdin. File: hledger_journal.info, Node: Top, Next: FILE FORMAT, Up: (dir) -hledger_journal(5) hledger 1.10.99 +hledger_journal(5) hledger 1.11.99 ********************************** hledger's usual data source is a plain text file containing journal diff --git a/hledger-lib/hledger_journal.txt b/hledger-lib/hledger_journal.txt index 9e50ee426..a39fd97c1 100644 --- a/hledger-lib/hledger_journal.txt +++ b/hledger-lib/hledger_journal.txt @@ -1151,4 +1151,4 @@ SEE ALSO -hledger 1.10.99 September 2018 hledger_journal(5) +hledger 1.11.99 September 2018 hledger_journal(5) diff --git a/hledger-lib/hledger_timeclock.5 b/hledger-lib/hledger_timeclock.5 index 97323e2bf..a49e3c1b5 100644 --- a/hledger-lib/hledger_timeclock.5 +++ b/hledger-lib/hledger_timeclock.5 @@ -1,5 +1,5 @@ -.TH "hledger_timeclock" "5" "September 2018" "hledger 1.10.99" "hledger User Manuals" +.TH "hledger_timeclock" "5" "September 2018" "hledger 1.11.99" "hledger User Manuals" diff --git a/hledger-lib/hledger_timeclock.info b/hledger-lib/hledger_timeclock.info index 384d7935e..ae84922f1 100644 --- a/hledger-lib/hledger_timeclock.info +++ b/hledger-lib/hledger_timeclock.info @@ -4,7 +4,7 @@ stdin. File: hledger_timeclock.info, Node: Top, Up: (dir) -hledger_timeclock(5) hledger 1.10.99 +hledger_timeclock(5) hledger 1.11.99 ************************************ hledger can read timeclock files. As with Ledger, these are (a subset diff --git a/hledger-lib/hledger_timeclock.txt b/hledger-lib/hledger_timeclock.txt index 4f0ae8304..fc0e218de 100644 --- a/hledger-lib/hledger_timeclock.txt +++ b/hledger-lib/hledger_timeclock.txt @@ -77,4 +77,4 @@ SEE ALSO -hledger 1.10.99 September 2018 hledger_timeclock(5) +hledger 1.11.99 September 2018 hledger_timeclock(5) diff --git a/hledger-lib/hledger_timedot.5 b/hledger-lib/hledger_timedot.5 index a4bd8f928..763a2d891 100644 --- a/hledger-lib/hledger_timedot.5 +++ b/hledger-lib/hledger_timedot.5 @@ -1,5 +1,5 @@ -.TH "hledger_timedot" "5" "September 2018" "hledger 1.10.99" "hledger User Manuals" +.TH "hledger_timedot" "5" "September 2018" "hledger 1.11.99" "hledger User Manuals" diff --git a/hledger-lib/hledger_timedot.info b/hledger-lib/hledger_timedot.info index 71c44d193..e0438472f 100644 --- a/hledger-lib/hledger_timedot.info +++ b/hledger-lib/hledger_timedot.info @@ -4,7 +4,7 @@ stdin. File: hledger_timedot.info, Node: Top, Next: FILE FORMAT, Up: (dir) -hledger_timedot(5) hledger 1.10.99 +hledger_timedot(5) hledger 1.11.99 ********************************** Timedot is a plain text format for logging dated, categorised quantities diff --git a/hledger-lib/hledger_timedot.txt b/hledger-lib/hledger_timedot.txt index 28173a978..ce334b4d0 100644 --- a/hledger-lib/hledger_timedot.txt +++ b/hledger-lib/hledger_timedot.txt @@ -124,4 +124,4 @@ SEE ALSO -hledger 1.10.99 September 2018 hledger_timedot(5) +hledger 1.11.99 September 2018 hledger_timedot(5) diff --git a/hledger-lib/package.yaml b/hledger-lib/package.yaml index f097fa3a4..65f61bf90 100644 --- a/hledger-lib/package.yaml +++ b/hledger-lib/package.yaml @@ -1,5 +1,5 @@ name: hledger-lib -version: '1.11' +version: '1.11.99' synopsis: Core data types, parsers and functionality for the hledger accounting tools description: | This is a reusable library containing hledger's core functionality. diff --git a/hledger-ui/CHANGES b/hledger-ui/CHANGES index ba4220d91..77665231d 100644 --- a/hledger-ui/CHANGES +++ b/hledger-ui/CHANGES @@ -1,6 +1,11 @@ User-visible changes in hledger-ui. See also hledger, hledger-lib. +# 1.11.1 (2018/10/06) + +* use hledger 1.11.1 + + # 1.11 (2018/9/30) * use hledger 1.11 diff --git a/hledger-ui/hledger-ui.1 b/hledger-ui/hledger-ui.1 index 1c340b5a5..9d2d9ba48 100644 --- a/hledger-ui/hledger-ui.1 +++ b/hledger-ui/hledger-ui.1 @@ -1,5 +1,5 @@ -.TH "hledger\-ui" "1" "September 2018" "hledger\-ui 1.10.99" "hledger User Manuals" +.TH "hledger\-ui" "1" "September 2018" "hledger\-ui 1.11.99" "hledger User Manuals" diff --git a/hledger-ui/hledger-ui.cabal b/hledger-ui/hledger-ui.cabal index f8da776cc..e5d4ae20f 100644 --- a/hledger-ui/hledger-ui.cabal +++ b/hledger-ui/hledger-ui.cabal @@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack -- --- hash: 61b73ed221f9d6964b622e7b8ea40259e9c82efd8b28dadc89d6a643ea947b94 +-- hash: fb0ef2467dcf115f1fc7a6f9d7781ec6912e7545a52921968067666c1747fff4 name: hledger-ui -version: 1.11 +version: 1.11.99 synopsis: Curses-style user interface for the hledger accounting tool description: This is hledger's curses-style interface. It is simpler and more convenient for browsing data than the command-line interface, @@ -63,7 +63,7 @@ executable hledger-ui hs-source-dirs: ./. ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans - cpp-options: -DVERSION="1.11" + cpp-options: -DVERSION="1.11.99" build-depends: ansi-terminal >=0.6.2.3 , async @@ -75,8 +75,8 @@ executable hledger-ui , directory , filepath , fsnotify >=0.2.1.2 && <0.4 - , hledger >=1.11 && <1.12 - , hledger-lib >=1.11 && <1.12 + , hledger >=1.11.99 && <1.12 + , hledger-lib >=1.11.99 && <1.12 , megaparsec >=7.0.0 && <8 , microlens >=0.4 , microlens-platform >=0.2.3.1 diff --git a/hledger-ui/hledger-ui.info b/hledger-ui/hledger-ui.info index 1c35213c3..3527cab60 100644 --- a/hledger-ui/hledger-ui.info +++ b/hledger-ui/hledger-ui.info @@ -3,7 +3,7 @@ This is hledger-ui.info, produced by makeinfo version 6.5 from stdin. File: hledger-ui.info, Node: Top, Next: OPTIONS, Up: (dir) -hledger-ui(1) hledger-ui 1.10.99 +hledger-ui(1) hledger-ui 1.11.99 ******************************** hledger-ui is hledger's curses-style interface, providing an efficient diff --git a/hledger-ui/hledger-ui.txt b/hledger-ui/hledger-ui.txt index 012b3100d..5ea7cee25 100644 --- a/hledger-ui/hledger-ui.txt +++ b/hledger-ui/hledger-ui.txt @@ -387,4 +387,4 @@ SEE ALSO -hledger-ui 1.10.99 September 2018 hledger-ui(1) +hledger-ui 1.11.99 September 2018 hledger-ui(1) diff --git a/hledger-ui/package.yaml b/hledger-ui/package.yaml index fb8177576..f0c6f2438 100644 --- a/hledger-ui/package.yaml +++ b/hledger-ui/package.yaml @@ -1,5 +1,5 @@ name : hledger-ui -version : '1.11' +version : '1.11.99' synopsis : Curses-style user interface for the hledger accounting tool description : | This is hledger's curses-style interface. @@ -37,11 +37,11 @@ flags: manual: false default: true -cpp-options: -DVERSION="1.11" +cpp-options: -DVERSION="1.11.99" dependencies: -- hledger >=1.11 && <1.12 -- hledger-lib >=1.11 && <1.12 +- hledger >=1.11.99 && <1.12 +- hledger-lib >=1.11.99 && <1.12 - ansi-terminal >=0.6.2.3 - async - base >=4.8 && <4.12 diff --git a/hledger-web/CHANGES b/hledger-web/CHANGES index 87a5118f9..936c03029 100644 --- a/hledger-web/CHANGES +++ b/hledger-web/CHANGES @@ -1,6 +1,11 @@ User-visible changes in hledger-web. See also hledger, hledger-lib. +# 1.11.1 (2018/10/06) + +* use hledger 1.11.1 + + # 1.11 (2018/9/30) * use hledger 1.11 diff --git a/hledger-web/hledger-web.1 b/hledger-web/hledger-web.1 index 6adcad3bd..bca94ba94 100644 --- a/hledger-web/hledger-web.1 +++ b/hledger-web/hledger-web.1 @@ -1,5 +1,5 @@ -.TH "hledger\-web" "1" "September 2018" "hledger\-web 1.10.99" "hledger User Manuals" +.TH "hledger\-web" "1" "September 2018" "hledger\-web 1.11.99" "hledger User Manuals" diff --git a/hledger-web/hledger-web.cabal b/hledger-web/hledger-web.cabal index e92fdb6f1..b02326fb4 100644 --- a/hledger-web/hledger-web.cabal +++ b/hledger-web/hledger-web.cabal @@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack -- --- hash: 60eb9cb226968eed42b507637364f5960aa6b6fb91dff8a46fcbd40295780df6 +-- hash: 443e668fdd64fb57d1d9488224df0bc6ee4e796bcc75f81655a92850ff809d34 name: hledger-web -version: 1.11 +version: 1.11.99 synopsis: Web interface for the hledger accounting tool description: This is hledger's web interface. It provides a more user-friendly and collaborative UI than the @@ -149,7 +149,7 @@ library hs-source-dirs: ./. ghc-options: -Wall -fwarn-tabs - cpp-options: -DVERSION="1.11" + cpp-options: -DVERSION="1.11.99" build-depends: base >=4.8 && <4.12 , blaze-html @@ -164,8 +164,8 @@ library , directory , filepath , hjsmin - , hledger >=1.11 && <1.12 - , hledger-lib >=1.11 && <1.12 + , hledger >=1.11.99 && <1.12 + , hledger-lib >=1.11.99 && <1.12 , http-client , http-conduit , json @@ -201,7 +201,7 @@ executable hledger-web hs-source-dirs: app ghc-options: -Wall -fwarn-tabs - cpp-options: -DVERSION="1.11" + cpp-options: -DVERSION="1.11.99" build-depends: base , hledger-web diff --git a/hledger-web/hledger-web.info b/hledger-web/hledger-web.info index 4bf941bee..eb49f2d0b 100644 --- a/hledger-web/hledger-web.info +++ b/hledger-web/hledger-web.info @@ -3,7 +3,7 @@ This is hledger-web.info, produced by makeinfo version 6.5 from stdin. File: hledger-web.info, Node: Top, Next: OPTIONS, Up: (dir) -hledger-web(1) hledger-web 1.10.99 +hledger-web(1) hledger-web 1.11.99 ********************************** hledger-web is hledger's web interface. It starts a simple web diff --git a/hledger-web/hledger-web.txt b/hledger-web/hledger-web.txt index 7f02985d1..986fcb1bf 100644 --- a/hledger-web/hledger-web.txt +++ b/hledger-web/hledger-web.txt @@ -251,4 +251,4 @@ SEE ALSO -hledger-web 1.10.99 September 2018 hledger-web(1) +hledger-web 1.11.99 September 2018 hledger-web(1) diff --git a/hledger-web/package.yaml b/hledger-web/package.yaml index 8a4939eb6..4adcca759 100644 --- a/hledger-web/package.yaml +++ b/hledger-web/package.yaml @@ -1,5 +1,5 @@ name: hledger-web -version: '1.11' +version: '1.11.99' synopsis: Web interface for the hledger accounting tool description: | This is hledger's web interface. @@ -77,7 +77,7 @@ when: library: source-dirs: . - cpp-options: -DVERSION="1.11" + cpp-options: -DVERSION="1.11.99" exposed-modules: - Hledger.Web - Hledger.Web.Application @@ -96,8 +96,8 @@ library: - Hledger.Web.Widget.AddForm - Hledger.Web.Widget.Common dependencies: - - hledger-lib >=1.11 && <1.12 - - hledger >=1.11 && <1.12 + - hledger-lib >=1.11.99 && <1.12 + - hledger >=1.11.99 && <1.12 - base >=4.8 && <4.12 - blaze-html - blaze-markup @@ -143,7 +143,7 @@ executables: hledger-web: source-dirs: app main: main.hs - cpp-options: -DVERSION="1.11" + cpp-options: -DVERSION="1.11.99" dependencies: - base - hledger-web @@ -161,7 +161,7 @@ executables: # test: # source-dirs: tests # main: main.hs -# cpp-options: -DVERSION="1.11" +# cpp-options: -DVERSION="1.11.99" # dependencies: # - base # - hledger-web diff --git a/hledger/CHANGES b/hledger/CHANGES index c1f3c3ea7..57c8cc4cf 100644 --- a/hledger/CHANGES +++ b/hledger/CHANGES @@ -1,6 +1,12 @@ User-visible changes in the hledger command line tool. +# 1.11.1 (2018/10/06) + +* fix wrong transaction rendering in balance assertion errors and when + using the add command + + # 1.11 (2018/9/30) * The default display order of accounts is now influenced by @@ -584,6 +590,83 @@ Allow megaparsec 5.2 (#503) - stack-ify extra/hledger-rewrite.hs +## misc + +- added GHC 8 support, dropped GHC 7.6 and 7.8 support. + + GHC 7.8 support could be restored with small code changes and a maintainer. + +- a cabal.project file has been added (Moritz Kiefer) + +- use hpack for maintaining cabal files (#371). + + Instead of editing cabal files directly, we now edit the less + verbose and less redundant package.yaml files and let stack (or + hpack) update the cabal files. We commit both the .yaml and + .cabal files. + +- clean up some old cabal flags + +- tools/simplebench has been spun off as the quickbench package. + +- add Appveyor CI builds, provide up-to-date binaries for Windows + +- extra: add a bunch of CSV rules examples + +## docs + +- the website is simpler, clearer, and more mobile-friendly. + + Docs are now collected on a single page and organised by type: getting started, reference, more. + +- reference docs have been split into one manual for each executable and file format. + + This helps with maintenance and packaging and also should make it + easier to see what's available and to read just what you need. + +- manuals are now provided in html, plain text, man and info formats + + generated from the same source by a new Shake-based docs build system. (#292) + +- versioned manuals are provided on the website, covering recent releases and the latest dev version (#385, #387) + +- manuals are built in to the hledger executables, allowing easy offline reading on all platforms. + + PROG -h shows PROG's command-line usage + PROG --help shows PROG's manual (fixed width) + PROG --man shows PROG's manual with man (formatted/paged) + PROG --info shows PROG's manual with info (hypertext) + hledger help [TOPIC] shows any manual + hledger man [TOPIC] shows any manual with man + hledger info [TOPIC] shows any manual with info + +- the general and reporting options are now listed in all executable manuals. + + We assume any of them which are unsupported are harmlessly ignored. + +- demo.hledger.org is using beancount's example journal. + + This is the somewhat realistic example journal from the beancount + project, tweaked for hledger. + +- minor copyedits (jungle-boogie) + +## cli + +- parsing multiple input files is now robust. + + When multiple -f options are provided, we now parse each file + individually rather than just concatenating them, so they can + have different formats (#320). Note this also means that + directives (like \`Y\` or \`alias\`) no longer carry over from one + file to the next. + +- -I has been added as the short flag for --ignore-assertions + + (this is different from Ledger's CLI, but useful for hledger-ui). + +- parsing an argument-less --debug option is more robust + @@ -598,9 +681,42 @@ Account aliases: Documentation: -- The hledger packages now have man pages, based on the current user - manual, thanks to the mighty pandoc (#282). +- Each hledger package now includes one or more man pages, generated + from markdown by the mighty pandoc. Currently there are six: one + for each main executable and each input file format. Currently these + somewhat duplicate the manual on the website; this will be resolved + somehow. (#282). +- The site is now built with hakyll-std, a generic hakyll script. + +- hledger once again has a HCAR entry. + +Tools: + +- The hledger cabal files are now generated from package.yaml files by + hpack, in principle, removing a lot of error-prone duplication and + boilerplate. (In practice, both files are being updated manually + for the moment, until hpack supports flags and conditional blocks.) + +- Time/allocation and heap profiling is working again, and easier: + + - `make quickprof-CMD` generates a profile for CMD, which runs + against one of the sample journals. (CMD must be one word, + enclosing in double quotes isn't working here for some reason). + + - `make quickheap-CMD` generates a heap profile for CMD, in + hledgerprof.ps, and tries to open it in a viewer (currently the + mac-friendly "open" executable, so you may need to adjust this in + the makefile). As with quickprof, CMD must be one word and runs + against one of the sample journals. + + - `make hledgerprof` builds the hledgerprof executable used for + time/allocation profiling. `make hledgercov` builds the hledgercov + executable used for coverage reports. + +- Travis CI now tests the build on each github push and announces + status changes by email and on #hledger. + Journal format: - Dates must now begin with a digit (not /, eg). diff --git a/hledger/Hledger/Cli/Commands.hs b/hledger/Hledger/Cli/Commands.hs index 9e0bb4118..68d10e7d6 100644 --- a/hledger/Hledger/Cli/Commands.hs +++ b/hledger/Hledger/Cli/Commands.hs @@ -244,6 +244,10 @@ FLAGS testcmd :: CliOpts -> Journal -> IO () testcmd opts _undefined = do let args = words' $ query_ $ reportopts_ opts + -- workaround for https://github.com/joelburget/easytest/issues/11 +-- import System.IO (hSetEncoding, stdout, stderr, utf8) +-- hSetEncoding stdout utf8 +-- hSetEncoding stderr utf8 e <- runEasytests args $ EasyTest.tests [tests_Hledger, tests_Commands] if e then exitFailure else exitSuccess diff --git a/hledger/Hledger/Cli/Commands/Add.hs b/hledger/Hledger/Cli/Commands/Add.hs index 032010625..bb75737dc 100644 --- a/hledger/Hledger/Cli/Commands/Add.hs +++ b/hledger/Hledger/Cli/Commands/Add.hs @@ -141,7 +141,7 @@ getAndAddTransactions es@EntryState{..} = (do confirmedTransactionWizard es@EntryState{..} = do t <- transactionWizard es -- liftIO $ hPrintf stderr {- "Transaction entered:\n%s" -} (show t) - output $ show t + output $ showTransaction t y <- let def = "y" in retryMsg "Please enter y or n." $ parser ((fmap ('y' ==)) . headMay . map toLower . strip) $ @@ -155,7 +155,7 @@ transactionWizard es@EntryState{..} = do let es1@EntryState{esArgs=args1} = es{esArgs=drop 1 esArgs, esDefDate=date} (desc,comment) <- descriptionAndCommentWizard es1 let mbaset = similarTransaction es1 desc - when (isJust mbaset) $ liftIO $ hPrintf stderr "Using this similar transaction for defaults:\n%s" (show $ fromJust mbaset) + when (isJust mbaset) $ liftIO $ hPrintf stderr "Using this similar transaction for defaults:\n%s" (showTransaction $ fromJust mbaset) let es2 = es1{esArgs=drop 1 args1, esSimilarTransaction=mbaset} balancedPostingsWizard = do ps <- postingsWizard es2{esPostings=[]} @@ -379,7 +379,7 @@ journalAddTransaction j@Journal{jtxns=ts} opts t = do -- unelided shows all amounts explicitly, in case there's a price, cf #283 when (debug_ opts > 0) $ do putStrLn $ printf "\nAdded transaction to %s:" f - putStrLn =<< registerFromString (show t) + putStrLn =<< registerFromString (showTransaction t) return j{jtxns=ts++[t]} -- | Append a string, typically one or more transactions, to a journal diff --git a/hledger/hledger.1 b/hledger/hledger.1 index 215dd6aaf..2d95aa4b6 100644 --- a/hledger/hledger.1 +++ b/hledger/hledger.1 @@ -1,6 +1,6 @@ .\"t -.TH "hledger" "1" "September 2018" "hledger 1.10.99" "hledger User Manuals" +.TH "hledger" "1" "September 2018" "hledger 1.11.99" "hledger User Manuals" diff --git a/hledger/hledger.cabal b/hledger/hledger.cabal index 1234a42bc..d32629977 100644 --- a/hledger/hledger.cabal +++ b/hledger/hledger.cabal @@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack -- --- hash: e89846e17f78017f83d440cb2fcfe10caba2b0c4c6a61195b4faffcdd2b7a100 +-- hash: 78515e93d6f08be6d098bdd697b951a1577e4e71c6b24ad64cf69916d3af191c name: hledger -version: 1.11 +version: 1.11.99 synopsis: Command-line interface for the hledger accounting tool description: This is hledger's command-line interface. Its basic function is to read a plain text file describing @@ -111,7 +111,7 @@ library other-modules: Paths_hledger ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans -optP-Wno-nonportable-include-path - cpp-options: -DVERSION="1.11" + cpp-options: -DVERSION="1.11.99" build-depends: Decimal , Diff @@ -129,7 +129,7 @@ library , hashable >=1.2.4 , haskeline >=0.6 , here - , hledger-lib >=1.11 && <1.12 + , hledger-lib >=1.11.99 && <1.12 , lucid , megaparsec >=7.0.0 && <8 , mtl @@ -164,7 +164,7 @@ executable hledger hs-source-dirs: app ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans -optP-Wno-nonportable-include-path - cpp-options: -DVERSION="1.11" + cpp-options: -DVERSION="1.11.99" build-depends: Decimal , ansi-terminal >=0.6.2.3 @@ -181,7 +181,7 @@ executable hledger , haskeline >=0.6 , here , hledger - , hledger-lib >=1.11 && <1.12 + , hledger-lib >=1.11.99 && <1.12 , megaparsec >=7.0.0 && <8 , mtl , mtl-compat @@ -218,7 +218,7 @@ test-suite test hs-source-dirs: test ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans -optP-Wno-nonportable-include-path - cpp-options: -DVERSION="1.11" + cpp-options: -DVERSION="1.11.99" build-depends: Decimal , ansi-terminal >=0.6.2.3 @@ -235,7 +235,7 @@ test-suite test , haskeline >=0.6 , here , hledger - , hledger-lib >=1.11 && <1.12 + , hledger-lib >=1.11.99 && <1.12 , megaparsec >=7.0.0 && <8 , mtl , mtl-compat @@ -289,7 +289,7 @@ benchmark bench , haskeline >=0.6 , here , hledger - , hledger-lib >=1.11 && <1.12 + , hledger-lib >=1.11.99 && <1.12 , html , megaparsec >=7.0.0 && <8 , mtl diff --git a/hledger/hledger.info b/hledger/hledger.info index e809e2cd6..71c22fb19 100644 --- a/hledger/hledger.info +++ b/hledger/hledger.info @@ -3,7 +3,7 @@ This is hledger.info, produced by makeinfo version 6.5 from stdin. File: hledger.info, Node: Top, Next: EXAMPLES, Up: (dir) -hledger(1) hledger 1.10.99 +hledger(1) hledger 1.11.99 ************************** This is hledger's command-line interface (there are also curses and web diff --git a/hledger/hledger.txt b/hledger/hledger.txt index 3770d23c5..8181e3975 100644 --- a/hledger/hledger.txt +++ b/hledger/hledger.txt @@ -2230,4 +2230,4 @@ SEE ALSO -hledger 1.10.99 September 2018 hledger(1) +hledger 1.11.99 September 2018 hledger(1) diff --git a/hledger/package.yaml b/hledger/package.yaml index c3f2441da..692f15132 100644 --- a/hledger/package.yaml +++ b/hledger/package.yaml @@ -1,5 +1,5 @@ name: hledger -version: '1.11' +version: '1.11.99' synopsis: Command-line interface for the hledger accounting tool description: | This is hledger's command-line interface. @@ -78,7 +78,7 @@ ghc-options: - -optP-Wno-nonportable-include-path dependencies: -- hledger-lib >=1.11 && <1.12 +- hledger-lib >=1.11.99 && <1.12 - ansi-terminal >=0.6.2.3 - base >=4.8 && <4.12 - base-compat-batteries >=0.10.1 && <0.11 @@ -121,7 +121,7 @@ when: - terminfo library: - cpp-options: -DVERSION="1.11" + cpp-options: -DVERSION="1.11.99" exposed-modules: - Hledger.Cli - Hledger.Cli.Main @@ -163,7 +163,7 @@ executables: hledger: source-dirs: app main: hledger-cli.hs - cpp-options: -DVERSION="1.11" + cpp-options: -DVERSION="1.11.99" when: - condition: flag(threaded) ghc-options: -threaded @@ -174,7 +174,7 @@ tests: test: source-dirs: test main: test.hs - cpp-options: -DVERSION="1.11" + cpp-options: -DVERSION="1.11.99" dependencies: - hledger - test-framework diff --git a/site/doc/1.11/csv.md b/site/doc/1.11/csv.md index df864b054..f2f5d34a2 100644 --- a/site/doc/1.11/csv.md +++ b/site/doc/1.11/csv.md @@ -1,6 +1,6 @@ # csv format -This doc is for version **1.10.99** (dev). []{.docversions} +This doc is for version **1.11** (dev). []{.docversions} \$toc\$ diff --git a/site/doc/1.11/hledger-api.md b/site/doc/1.11/hledger-api.md index 4758b54de..29893ec72 100644 --- a/site/doc/1.11/hledger-api.md +++ b/site/doc/1.11/hledger-api.md @@ -1,6 +1,6 @@ # hledger-api -This doc is for version **1.10.99** (dev). []{.docversions} +This doc is for version **1.11** (dev). []{.docversions} \$toc\$ diff --git a/site/doc/1.11/hledger-ui.md b/site/doc/1.11/hledger-ui.md index 8283e72a9..13269c994 100644 --- a/site/doc/1.11/hledger-ui.md +++ b/site/doc/1.11/hledger-ui.md @@ -1,6 +1,6 @@ # hledger-ui -This doc is for version **1.10.99** (dev). []{.docversions} +This doc is for version **1.11** (dev). []{.docversions} \$toc\$ diff --git a/site/doc/1.11/hledger-web.md b/site/doc/1.11/hledger-web.md index c880cb5dc..32735f81b 100644 --- a/site/doc/1.11/hledger-web.md +++ b/site/doc/1.11/hledger-web.md @@ -1,6 +1,6 @@ # hledger-web -This doc is for version **1.10.99** (dev). []{.docversions} +This doc is for version **1.11** (dev). []{.docversions} \$toc\$ diff --git a/site/doc/1.11/hledger.md b/site/doc/1.11/hledger.md index aef0a151b..30ed1a428 100644 --- a/site/doc/1.11/hledger.md +++ b/site/doc/1.11/hledger.md @@ -1,6 +1,6 @@ # hledger -This doc is for version **1.10.99** (dev). []{.docversions} +This doc is for version **1.11** (dev). []{.docversions} \$toc\$ diff --git a/site/doc/1.11/images/.DS_Store b/site/doc/1.11/images/.DS_Store deleted file mode 100644 index 98ecda7b9..000000000 Binary files a/site/doc/1.11/images/.DS_Store and /dev/null differ diff --git a/site/doc/1.11/images/hledger-web/.DS_Store b/site/doc/1.11/images/hledger-web/.DS_Store deleted file mode 100644 index 830538401..000000000 Binary files a/site/doc/1.11/images/hledger-web/.DS_Store and /dev/null differ diff --git a/site/doc/1.11/journal.md b/site/doc/1.11/journal.md index 477da729e..c4794c5cd 100644 --- a/site/doc/1.11/journal.md +++ b/site/doc/1.11/journal.md @@ -1,6 +1,6 @@ # journal format -This doc is for version **1.10.99** (dev). []{.docversions} +This doc is for version **1.11** (dev). []{.docversions} \$toc\$ @@ -234,9 +234,9 @@ toggle transaction status with C-c C-e, or posting status with C-c C-c. What "uncleared", "pending", and "cleared" actually mean is up to you. Here's one suggestion: - ------------------------------------------------------------------------- + ------------------------------------------------------------------------ status meaning - ----------- ------------------------------------------------------------- + ----------- ------------------------------------------------------------ uncleared recorded but not yet reconciled; needs review pending tentatively reconciled (if needed, eg during a big @@ -244,7 +244,7 @@ Here's one suggestion: cleared complete, reconciled as far as possible, and considered correct - ------------------------------------------------------------------------- + ------------------------------------------------------------------------ With this scheme, you would use `-PC` to see the current balance at your bank, `-U` to see things which will probably hit your bank soon (like diff --git a/site/doc/1.11/manual.md b/site/doc/1.11/manual.md index df08ae4e0..f1445ace0 100644 --- a/site/doc/1.11/manual.md +++ b/site/doc/1.11/manual.md @@ -2,7 +2,7 @@ ## hledger -This doc is for version **1.10.99** (dev). []{.docversions} +This doc is for version **1.11** (dev). []{.docversions} ### NAME @@ -2435,7 +2435,7 @@ accepts `fr_FR.UTF8`, mac osx requires exactly `fr_FR.UTF-8`). ## hledger-ui -This doc is for version **1.10.99** (dev). []{.docversions} +This doc is for version **1.11** (dev). []{.docversions} ### NAME @@ -2847,7 +2847,7 @@ program is restarted. ## hledger-web -This doc is for version **1.10.99** (dev). []{.docversions} +This doc is for version **1.11** (dev). []{.docversions} ### NAME @@ -3100,7 +3100,7 @@ Does not work well on small screens. ## hledger-api -This doc is for version **1.10.99** (dev). []{.docversions} +This doc is for version **1.11** (dev). []{.docversions} ### NAME @@ -3202,7 +3202,7 @@ awkward. ## journal format -This doc is for version **1.10.99** (dev). []{.docversions} +This doc is for version **1.11** (dev). []{.docversions} ### NAME @@ -4515,7 +4515,7 @@ https://twitter.com/LedgerTips/status/501767602067472384 ## csv format -This doc is for version **1.10.99** (dev). []{.docversions} +This doc is for version **1.11** (dev). []{.docversions} ### NAME @@ -4789,7 +4789,7 @@ rules file will be used for all the CSV files being read. ## timeclock format -This doc is for version **1.10.99** (dev). []{.docversions} +This doc is for version **1.11** (dev). []{.docversions} ### NAME @@ -4858,7 +4858,7 @@ To generate time logs, ie to clock in and clock out, you could: ## timedot format -This doc is for version **1.10.99** (dev). []{.docversions} +This doc is for version **1.11** (dev). []{.docversions} ### NAME diff --git a/site/doc/1.11/timeclock.md b/site/doc/1.11/timeclock.md index 026e7e4f7..c57db6d43 100644 --- a/site/doc/1.11/timeclock.md +++ b/site/doc/1.11/timeclock.md @@ -1,6 +1,6 @@ # timeclock format -This doc is for version **1.10.99** (dev). []{.docversions} +This doc is for version **1.11** (dev). []{.docversions} \$toc\$ diff --git a/site/doc/1.11/timedot.md b/site/doc/1.11/timedot.md index 508ca2b75..1b8c837ef 100644 --- a/site/doc/1.11/timedot.md +++ b/site/doc/1.11/timedot.md @@ -1,6 +1,6 @@ # timedot format -This doc is for version **1.10.99** (dev). []{.docversions} +This doc is for version **1.11** (dev). []{.docversions} \$toc\$ diff --git a/site/download.md b/site/download.md index 01a843e28..71d78cb93 100644 --- a/site/download.md +++ b/site/download.md @@ -1,14 +1,21 @@ -\$toc\$ - # Download -Adventurer, choose your path! No, really it's quite easy. Often. Do you want to.. +There are several ways to install hledger: + +a. [Download the binary or system package for your platform](#a.-download-a-binary-or-system-package) (quick install, often not up to date) +b. [Build the latest release with hledger-install](#b.-build-the-latest-release) + or [with stack](#b2.-with-stack) + or [with cabal](#b3.-with-cabal) (slow install, up to date) +c. [Build the development version with stack or cabal](#c.-build-the-development-version) (slow install, super-fresh) + + -## a. download a binary/system package +## a. Download a binary or system package for your platform -hledger binaries or system packages are quickest to install, -but they can be [out of date](https://repology.org/metapackage/hledger/badges) or incomplete. -(Please help your local packagers with this!). +Binaries or system packages are quickest to install, but they can be outdated or incomplete. -| -|----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -| Windows: | [1.10](https://ci.appveyor.com/api/buildjobs/5n63x22wvd4j24ee/artifacts/hledger.zip) or [latest nightly dev build](https://ci.appveyor.com/api/projects/simonmichael/hledger/artifacts/hledger.zip?branch=master) ([no hledger-ui](https://github.com/jtdaugherty/vty/pull/1#issuecomment-297143444), [doesn't work on old windows ?](https://github.com/simonmichael/hledger/issues/774), [unusually many files in PATH causing hangs](https://github.com/simonmichael/hledger/issues/791), [appveyor builds have been failing again](https://github.com/simonmichael/hledger/issues/832) ) -| Mac: | **`brew install hledger`** ([only hledger CLI](https://github.com/simonmichael/hledger/issues/321#issuecomment-179920520)) -| Arch Linux: | **`pacman -S hledger`** -| Debian, Ubuntu: | **`sudo apt install hledger hledger-ui hledger-web`** -| Fedora, RHEL: | **`sudo dnf install hledger`** -| Gentoo: | **`sudo layman -a haskell && sudo emerge hledger hledger-ui hledger-web`** -| Void Linux: | **`xbps-install -S hledger hledger-ui hledger-web hledger-api`** -| OpenBSD: | Third-party binaries: [OpenBSD6.3/amd64](https://s3.amazonaws.com/openbsd-hledger/index.html). Ports tree entries: [https://github.com/jasperla/openbsd-wip/pull/104](https://github.com/jasperla/openbsd-wip/pull/104) -| NixOS: | **`nix-env -iA nixpkgs.haskellPackages.hledger nixpkgs.haskellPackages.hledger-ui nixpkgs.haskellPackages.hledger-web`** ([problems with hledger-ui on MacOS ?](https://github.com/simonmichael/hledger/issues/613)) -| Sandstorm: | **[hledger-web Sandstorm app](https://apps.sandstorm.io/app/8x12h6p0x0nrzk73hfq6zh2jxtgyzzcty7qsatkg7jfg2mzw5n90) -> demo** - a hledger-web server in 3 clicks ([features needed](https://github.com/simonmichael/hledger/issues/425)) +**Available binaries / system packages:** +