From c032d5d5287c407fd0aef39d8382a699fb11c5c5 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Sun, 5 Jun 2022 12:35:07 +0200 Subject: [PATCH] added extract_changed_files() --- update_helpers.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) mode change 100755 => 100644 update_helpers.sh diff --git a/update_helpers.sh b/update_helpers.sh old mode 100755 new mode 100644 index e69de29..5c130f8 --- a/update_helpers.sh +++ b/update_helpers.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# set -x + +source ./log_helpers.sh +source ./git_helpers.sh + +extract_changed_files () { + local func="${FUNCNAME[0]}" + local files=$(changed_files) + local updated_files="" + + if [ -z $files ]; then + log_crit "$func:${LINENO} no changed files!" + else + if grep -qE "update.conf" <<< $files ; then + updated_files="${updated_files} update.conf" + + if grep -qE "printer.conf" <<< $files ; then + updated_files="${updated_files} printer.conf" + fi + + if grep -qE "emp.conf" <<< $files ; then + updated_files="${updated_files} emp.conf" + fi + + if grep -qE "device.conf" <<< $files ; then + updated_files="${updated_files} device.conf" + fi + else + log_crit "$func:${LINENO} NO new revision of update.conf" + fi + fi + + log_debug "$func:${LINENO} new revisions for $updated_files" + printf "$updated_files" +} + +check_md5sum () { + local func="${FUNCNAME[0]}" + fn="/workspace/customer_281/szeged/1/1/etc/psa_config" + + +}