]> Sergey Matveev's repositories - zsh-autoenv.git/commit
Automatically upgrade v1 hashes (SHA-1) to v2 (`cksum`) (#55)
authorRob Speed <speed.rob@gmail.com>
Tue, 10 Jan 2017 11:07:39 +0000 (06:07 -0500)
committerDaniel Hahler <github@thequod.de>
Tue, 10 Jan 2017 11:07:39 +0000 (12:07 +0100)
commitdfb56485055edafbb5ca901c0e65c47a13c62ff5
tree1249ca7b8e1410129b7116fc0866b0ea43b041bf
parent398b6f4f547a6656a830055236c644fc94577ac0
Automatically upgrade v1 hashes (SHA-1) to v2 (`cksum`) (#55)

A new parameter is added to `_autoenv_hash_pair` to specify the version, defaulting to the latest (2). It outputs a `cksum`-based hash for version 2 and `shasum`-based for version 1.
Moves logic to check for an entry in `$AUTOENV_AUTH_FILE` into its own function (`_autoenv_authorized_pair`), as it may need to be called twice.
Modifies `_autoenv_authorized_env_file` to check for v1 entries when v2 fails.

Fixes #53. Alternative implementation to #54.
autoenv.zsh
tests/_autoenv_utils.t
tests/setup.zsh
tests/upgrade_hash.t [new file with mode: 0644]