From 462dab713e9e1809ff714450497d7b7aa4e02854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Bar=C4=87?= Date: Sat, 19 Dec 2020 20:45:31 +0100 Subject: [PATCH] src/clean-md5-cache: new script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maciej Barć --- src/clean-md5-cache | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 src/clean-md5-cache diff --git a/src/clean-md5-cache b/src/clean-md5-cache new file mode 100755 index 0000000..3956882 --- /dev/null +++ b/src/clean-md5-cache @@ -0,0 +1,22 @@ +#!/bin/sh + + +# Clean md5-cache from the overlay directory + + +trap 'exit 128' INT +export PATH + + +cache="$(git rev-parse --show-cdup)metadata/md5-cache" + + +if [ -d "${cache}" ] +then + if ! rm -fr "${cache}" + then + sudo rm -fr "${cache}" || exit 1 + fi +else + echo "No pre-generated md5-cache found in ${cache}" +fi