From 0ba83d1c8aa8e7806c381916af4628305fcc64f2 Mon Sep 17 00:00:00 2001
From: Patrick Spek
Date: Wed, 8 Mar 2023 08:13:05 +0100
Subject: Rename file_rhash to dir_hash
---
lib/util.bash | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
(limited to 'lib/util.bash')
diff --git a/lib/util.bash b/lib/util.bash
index 604e3e5..f2cd4a7 100644
--- a/lib/util.bash
+++ b/lib/util.bash
@@ -56,6 +56,16 @@ die() {
exit "${code:-1}"
}
+# Recursively hash files in a directory, and hashing the output of all those
+# hashes again. This results in a single hash representing the state of files
+# in a directory. It can be used to check whether contents changed after
+# templating files in a given directory.
+dir_hash() {
+ find "$1" -type f -exec sha1sum {} \; \
+ | sha1sum \
+ | awk '{ print $1 }'
+}
+
# Fetch a file from an URL. Using this function introduces a dependency on curl.
fetch_http() {
local OPTIND
@@ -130,16 +140,6 @@ join_args() {
printf "%s" "$*"
}
-# Recursively hash files in a directory, and hashing the output of all those
-# hashes again. This results in a single hash representing the state of files
-# in a directory. It can be used to check whether contents changed after
-# templating files in a given directory.
-file_rhash() {
- find "$1" -type f -exec sha1sum {} \; \
- | sha1sum \
- | awk '{ print $1 }'
-}
-
file_template()
{
local file="$BASHTARD_ETCDIR/playbooks.d/$BASHTARD_PLAYBOOK/share/$1" ; shift
--
cgit v1.1