Commit 655e2ed7 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm print: add filesize verb, add get_filesize function

parent 58751587
......@@ -513,6 +513,9 @@ epm_print()
"constructname")
construct_name "$@"
;;
"filesize")
get_filesize "$@"
;;
"info")
export EPMVERSION
$DISTRVENDOR "$@"
......
......@@ -724,6 +724,16 @@ regexp_subst()
sed -i -r -e "$expression" "$@"
}
get_filesize()
{
if stat -f%z "$1" >/dev/null 2>&1; then
stat -f%z "$1"
else
# coreutils
stat -c%s "$1"
fi
}
# TODO: why we can't use epm directly?
try_assure_exists()
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment