From 50764b07fcf176e736ae72184cf47c47f2581552 Mon Sep 17 00:00:00 2001 From: Tobias Klaus Date: Sun, 1 Dec 2019 01:05:21 +0100 Subject: [PATCH] add md5 as checksum algorithm for stat module --- src/stat.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stat.lua b/src/stat.lua index a32b18d..fbad49e 100644 --- a/src/stat.lua +++ b/src/stat.lua @@ -36,7 +36,7 @@ function main(arg) , follow = { default=false, type='bool' } , get_md5 = { default=true, type='bool'} , get_checksum = { default=true, type='bool' } - , checksum_algorithm = { default='sha1', type='str', choices={'sha1'}, aliases={'checksum_algo', 'checksum'}} + , checksum_algorithm = { default='sha1', type='str', choices={'sha1', 'md5'}, aliases={'checksum_algo', 'checksum'}} } ) @@ -111,7 +111,7 @@ function main(arg) end if 0 ~= d['isreg'] and get_checksum and 0 == unistd.access(path, "r") then - local chksums = { sha1=File.sha1 } + local chksums = { sha1=File.sha1, md5=File.md5 } d['checksum'] = chksums[p['checksum_algorithm']](module, path) end