Skip to content

Commit

Permalink
No space after redirection operators
Browse files Browse the repository at this point in the history
  • Loading branch information
sideeffect42 committed Feb 7, 2025
1 parent fe4a407 commit c5298d6
Show file tree
Hide file tree
Showing 46 changed files with 117 additions and 123 deletions.
4 changes: 2 additions & 2 deletions type/__acl/gencode-remote
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ then
esac

echo "${setfacl_exec} -x \"${remove}\" \"${acl_path}\""
echo "removed '${remove}'" >> "${__messages_out:?}"
echo "removed '${remove}'" >>"${__messages_out:?}"
done
fi

Expand All @@ -136,6 +136,6 @@ do
echo "setting default ACL in ${os} is currently not supported" >&2
else
echo "${setfacl_exec} -m \"${acl}\" \"${acl_path}\""
echo "added '${acl}'" >> "${__messages_out:?}"
echo "added '${acl}'" >>"${__messages_out:?}"
fi
done
4 changes: 2 additions & 2 deletions type/__apt_default_release/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ in
(ubuntu|debian|devuan)
__file /etc/apt/apt.conf.d/99-default-release \
--owner root --group root --mode 644 \
--source - << DONE
--source - <<DONE
APT::Default-Release "${release}";
DONE
;;
(*)
: "${__type:?}" # make shellcheck happy
cat >&2 << DONE
cat >&2 <<DONE
The developer of this type (${__type##*/}) did not think your operating system
(${os}) would have any use for it. If you think otherwise please submit a patch.
DONE
Expand Down
12 changes: 6 additions & 6 deletions type/__apt_key/gencode-remote
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ in
then
if grep -Eq "^__(file|download)${keyfile}" "${__messages_in:?}"
then
echo "added '${keyid}'" >> "${__messages_out:?}"
echo "added '${keyid}'" >>"${__messages_out:?}"
fi
exit 0
elif [ "${state_is}" = 'present' ]
Expand All @@ -55,7 +55,7 @@ in
# can get stuck if keyserver is not responding.
# exporting env var and not exit 1,
# because we need to clean up and kill dirmngr.
cat << EOF
cat <<EOF
gpgtmphome="\$(mktemp -d)"
Expand All @@ -66,7 +66,7 @@ if timeout 30s \\
then
gpg --homedir "\${gpgtmphome}" \\
--export "${keyid}" \\
> "${keyfile}"
>"${keyfile}"
else
export GPG_GOT_STUCK=1
fi
Expand All @@ -87,7 +87,7 @@ EOF
echo "apt-key adv --keyserver \"${keyserver}\" --recv-keys \"${keyid}\""
fi

echo "added '${keyid}'" >> "${__messages_out:?}"
echo "added '${keyid}'" >>"${__messages_out:?}"
;;
(absent)
# Removal for keys added from a keyserver without this flag
Expand All @@ -97,11 +97,11 @@ EOF
then
# fallback to deprecated apt-key
echo "apt-key del \"${keyid}\""
echo "removed '${keyid}'" >> "${__messages_out:?}"
echo "removed '${keyid}'" >>"${__messages_out:?}"
# Propagate messages if needed
elif grep -Eq "^__file${keyfile}" "${__messages_in:?}"
then
echo "removed '${keyid}'" >> "${__messages_out:?}"
echo "removed '${keyid}'" >>"${__messages_out:?}"
fi
;;
esac
8 changes: 4 additions & 4 deletions type/__apt_key/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ state_should=$(cat "${__object:?}/parameter/state")

incompatible_args()
{
cat >> /dev/stderr <<-EOF
cat >>/dev/stderr <<-EOF
This type does not support --${1} and --${method} simultaneously.
EOF
exit 1
Expand Down Expand Up @@ -63,7 +63,7 @@ then
method='keyid'
fi
# Save this for later in gencode-remote
echo "${method}" > "${__object:?}/key_method"
echo "${method}" >"${__object:?}/key_method"

# Required remotely (most likely already installed)
__package dirmngr
Expand All @@ -82,7 +82,7 @@ else
if [ "${state_should}" = 'absent' ] && \
[ -f "${__object:?}/parameter/keyid" ]
then
cat >> /dev/stderr <<EOF
cat >&2 <<EOF
You can't reliably remove by keyid without --use-deprecated-apt-key.
This would very likely do something you do not intend.
EOF
Expand Down Expand Up @@ -112,7 +112,7 @@ then
# Dearmor if necessary
if grep -Fq 'BEGIN PGP PUBLIC KEY BLOCK' '${keyfilecdist}'
then
gpg --dearmor < '${keyfilecdist}' > '${keyfile}'
gpg --dearmor <'${keyfilecdist}' >'${keyfile}'
else
cp '${keyfilecdist}' '${keyfile}'
fi
Expand Down
2 changes: 1 addition & 1 deletion type/__apt_key_uri/explorer/state
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ else
name="${__object_id:?}"
fi

apt-key list 2> /dev/null | grep -Fqe "${name}" \
apt-key list 2>/dev/null | grep -Fqe "${name}" \
&& echo present \
|| echo absent
2 changes: 1 addition & 1 deletion type/__apt_key_uri/gencode-remote
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ in
printf 'curl -s -L "%s" | apt-key add -\n' "${uri}"
;;
(absent)
cat << DONE
cat <<DONE
keyid=\$(apt-key list | grep -B1 "${name}" | awk '/pub/ { print \$2 }' | cut -d'/' -f 2)
apt-key del \${keyid}
DONE
Expand Down
2 changes: 1 addition & 1 deletion type/__apt_mark/gencode-remote
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fi
case ${state_should}
in
(hold|unhold)
echo "apt-mark ${state_should} ${name} > /dev/null"
echo "apt-mark ${state_should} ${name} >/dev/null"
;;
(*)
printf 'Invalid --state: %s\n' "${state_should}" >&2
Expand Down
2 changes: 1 addition & 1 deletion type/__apt_source/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export signed_by

# generate file from template
mkdir "${__object:?}/files"
"${__type:?}/files/source.list.template" > "${__object:?}/files/source.list"
"${__type:?}/files/source.list.template" >"${__object:?}/files/source.list"
__file "/etc/apt/sources.list.d/${name}.list" \
--source "${__object:?}/files/source.list" \
--owner root --group root --mode 0644 \
Expand Down
8 changes: 3 additions & 5 deletions type/__apt_unattended_upgrades/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ __file /etc/apt/apt.conf.d/20auto-upgrades \
--owner root \
--group root \
--mode 644 \
--source - << EOF
--source - <<EOF
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
EOF
Expand All @@ -48,8 +48,7 @@ then
while read -r l
do
o=$(printf '%s\nUnattended-Upgrade::%s "%s";\n' "${o}" "${l%%=*}" "${l#*=}")
done \
< "${__object:?}/parameter/option"
done <"${__object:?}/parameter/option"

conf=$(printf '%s\n%s\n' "${conf}" "${o}")
fi
Expand All @@ -61,8 +60,7 @@ then
while read -r l
do
b=$(printf '%s\n"%s";\n' "${b}" "${l}")
done \
< "${__object:?}/parameter/blacklist"
done <"${__object:?}/parameter/blacklist"

conf=$(printf '%s\n%s\n}\n' "${conf}" "${b}")
fi
Expand Down
2 changes: 1 addition & 1 deletion type/__apt_update_index/gencode-remote
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ apt_opts='-o Acquire::AllowReleaseInfoChange::Suite=true -o Acquire::AllowReleas
if [ -f "${__object:?}/parameter/always" ] \
|| [ "$(cat "${__object:?}/explorer/state")" = 'outdated' ]
then
cat << EOF
cat <<EOF
apt-get ${apt_opts} update || apt-get ${apt_opts} update
touch -c /var/lib/apt/lists
EOF
Expand Down
14 changes: 7 additions & 7 deletions type/__block/gencode-remote
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ then
fi

remove_block() {
cat << DONE
cat <<DONE
tmpfile=\$(mktemp ${quoted_file}.skonfig.XXXXXX)
# preserve ownership and permissions of existing file
if [ -f ${quoted_file} ]
Expand All @@ -66,7 +66,7 @@ awk -v prefix=$(quote "${prefix}") -v suffix=$(quote "${suffix}") '
} else {
print
}
}' ${quoted_file} > "\${tmpfile}"
}' ${quoted_file} >"\${tmpfile}"
mv -f "\${tmpfile}" ${quoted_file}
DONE
}
Expand All @@ -77,20 +77,20 @@ in
(present)
if [ "${state_is}" = 'changed' ]
then
echo update >> "${__messages_out:?}"
echo update >>"${__messages_out:?}"
remove_block
else
echo add >> "${__messages_out:?}"
echo add >>"${__messages_out:?}"
fi
: "${__type:?}" # make shellcheck happy
cat << DONE
cat >> ${quoted_file} << '${__type##*/}_DONE'
cat <<DONE
cat >>${quoted_file} <<'${__type##*/}_DONE'
$(cat "${block}")
${__type##*/}_DONE
DONE
;;
(absent)
echo remove >> "${__messages_out:?}"
echo remove >>"${__messages_out:?}"
remove_block
;;
esac
8 changes: 4 additions & 4 deletions type/__block/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ text=$(cat "${__object:?}/parameter/text")
mkdir "${__object:?}/files"
# Generate text block for inclusion in file
block="${__object:?}/files/block"
echo "${prefix}" > "${block}"
echo "${prefix}" >"${block}"
if [ "${text}" = "-" ]
then
cat "${__object:?}/stdin" >> "${block}"
cat "${__object:?}/stdin" >>"${block}"
else
echo "${text}" >> "${block}"
echo "${text}" >>"${block}"
fi
echo "${suffix}" >> "${block}"
echo "${suffix}" >>"${block}"
2 changes: 1 addition & 1 deletion type/__cdistmarker/gencode-remote
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ destination=$(cat "${__object:?}/parameter/destination")
format=$(cat "${__object:?}/parameter/format")

# Dump the timestamp in UTC to the marker
echo "date ${format} > ${destination}"
echo "date ${format} >${destination}"
2 changes: 1 addition & 1 deletion type/__check_messages/gencode-remote
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ if grep -Eq \
"$(cat "${__object:?}/parameter/pattern")" \
"${__messages_in:?}"
then
tee "${__messages_out:?}" < "${__object:?}/parameter/execute"
tee "${__messages_out:?}" <"${__object:?}/parameter/execute"
fi
12 changes: 6 additions & 6 deletions type/__directory/gencode-remote
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ get_current_value() {

set_group() {
echo "chgrp ${recursive} '$1' '${destination}'"
echo "chgrp ${recursive} '$1'" >> "${__messages_out:?}"
echo "chgrp ${recursive} '$1'" >>"${__messages_out:?}"
}

set_owner() {
echo "chown ${recursive} '$1' '${destination}'"
echo "chown ${recursive} '$1'" >> "${__messages_out:?}"
echo "chown ${recursive} '$1'" >>"${__messages_out:?}"
}

set_mode() {
echo "chmod ${recursive} '$1' '${destination}'"
echo "chmod ${recursive} '$1'" >> "${__messages_out:?}"
echo "chmod ${recursive} '$1'" >>"${__messages_out:?}"
}

case ${state_should}
Expand All @@ -86,10 +86,10 @@ in
# our destination is not a directory, remove whatever is there
# and then create our directory and set all attributes
echo "rm -f '${destination}'"
echo 'remove non directory' >> "${__messages_out:?}"
echo 'remove non directory' >>"${__messages_out:?}"
fi
echo "mkdir ${mkdiropt} '${destination}'"
echo 'create' >> "${__messages_out:?}"
echo 'create' >>"${__messages_out:?}"
elif [ "${state_should}" = 'exists' ]
then
# The type is directory and --state exists. We are done and do not
Expand Down Expand Up @@ -146,7 +146,7 @@ in
if [ "${type}" = 'directory' ]
then
echo "rm -rf '${destination}'"
echo remove >> "${__messages_out:?}"
echo remove >>"${__messages_out:?}"
fi
;;
(*)
Expand Down
4 changes: 2 additions & 2 deletions type/__dpkg_architecture/gencode-remote
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ then
# updating the index to make the new architecture available
echo 'apt update'

echo added >> "${__messages_out:?}"
echo added >>"${__messages_out:?}"
;;

(absent)
Expand All @@ -77,7 +77,7 @@ then
# print remove code
printf "dpkg --remove-architecture '%s'\n" "${arch_wanted}"

echo removed >> "${__messages_out:?}"
echo removed >>"${__messages_out:?}"
;;

(*)
Expand Down
6 changes: 3 additions & 3 deletions type/__group/gencode-remote
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ then
if [ "${new_value}" != "${current_value}" ]
then
set -- "$@" "$(shorten_property "${property}")" \'"${new_value}"\'
echo "change ${property} ${new_value} ${current_value}" >> "${__messages_out:?}"
echo "change ${property} ${new_value} ${current_value}" >>"${__messages_out:?}"
fi
fi
done
Expand All @@ -80,7 +80,7 @@ then
(*)
echo groupmod "$@" "${name}" ;;
esac
echo mod >> "${__messages_out:?}"
echo mod >>"${__messages_out:?}"
fi
else
# create new
Expand Down Expand Up @@ -117,6 +117,6 @@ else
(*)
echo groupdel "${name}" ;;
esac
echo remove >> "${__messages_out:?}"
echo remove >>"${__messages_out:?}"
fi
fi
8 changes: 4 additions & 4 deletions type/__key_value/gencode-remote
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ in
# nothing to do
;;
(wrongformat|wrongvalue|present)
echo 'remove' >> "${__messages_out:?}"
echo 'remove' >>"${__messages_out:?}"
fire_onchange=true
;;
(*)
Expand All @@ -55,15 +55,15 @@ in
case ${state_is}
in
(nosuchfile)
echo 'create' >> "${__messages_out:?}"
echo 'create' >>"${__messages_out:?}"
fire_onchange=true
;;
(absent)
echo 'insert' >> "${__messages_out:?}"
echo 'insert' >>"${__messages_out:?}"
fire_onchange=true
;;
(wrongformated|wrongvalue)
echo 'change' >> "${__messages_out:?}"
echo 'change' >>"${__messages_out:?}"
fire_onchange=true
;;
(present)
Expand Down
Loading

0 comments on commit c5298d6

Please sign in to comment.