diff --git a/debian/kali-themes.postinst b/debian/kali-themes.postinst index d98e6cd9..20cafee9 100644 --- a/debian/kali-themes.postinst +++ b/debian/kali-themes.postinst @@ -35,8 +35,8 @@ FILES_TO_DIVERT=" install_all() { local opt=$1 - for file in $FILES_TO_DIVERT - do + local file= + for file in $FILES_TO_DIVERT; do install_config_file "$file" "$opt" done } @@ -45,18 +45,19 @@ install_config_file() { local file=$1 local opt=$2 local orig_file="/usr/share/kali-themes$file" - if [ "$opt" = "force" ] || ([ ! -e $file ] && [ -e $orig_file ]); then + if [ "$opt" = "force" ] || ([ ! -e "$file" ] && [ -e "$orig_file" ]); then echo "Installing $orig_file as $file" - mkdir -p $(dirname $file) - cp $orig_file $file + mkdir -p "$(dirname "$file")" + cp "$orig_file" "$file" fi } remove_config_file() { - rm -f $1 + local file=$1 + rm -f "$file" dpkg-divert --rename --package kali-themes \ - --divert "$1.original" \ - --remove "$1" + --divert "$file.original" \ + --remove "$file" } if [ "$1" = "configure" ]; then diff --git a/debian/kali-themes.postrm b/debian/kali-themes.postrm index 3b15794b..47434abc 100644 --- a/debian/kali-themes.postrm +++ b/debian/kali-themes.postrm @@ -34,7 +34,7 @@ FILES_TO_DIVERT=" " # END FILES_TO_DIVERT drop_diversion() { - local file="$1" + local file=$1 dpkg-divert --rename --package kali-themes \ --divert "$file.original" \ --remove "$file" diff --git a/debian/kali-themes.preinst b/debian/kali-themes.preinst index 0ae5992d..7b719738 100644 --- a/debian/kali-themes.preinst +++ b/debian/kali-themes.preinst @@ -34,8 +34,8 @@ FILES_TO_DIVERT=" " # END FILES_TO_DIVERT setup_diversion() { - local file="$1" - divert_opts="--rename" + local file=$1 + local divert_opts="--rename" if [ -e "$file" ]; then if dpkg --search "$file" >/dev/null 2>&1; then # Keep original file to avoid spurious dpkg prompt