Less cat abuse

More than 90% of cats were thus terminated.
read (shell built-in) is better at reading, and dogs are better pets.

Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
btrfsvols
Riku Viitanen 2023-09-03 17:00:18 +03:00
parent e369e8fb4a
commit ef3fb05d66
8 changed files with 17 additions and 17 deletions

View File

@ -4,7 +4,7 @@
. "include/err.sh" . "include/err.sh"
projectname="$(cat projectname)" read projectname < projectname
main() main()
{ {

2
lbmk
View File

@ -27,7 +27,7 @@ set -u -e
. "include/err.sh" . "include/err.sh"
. "include/export.sh" . "include/export.sh"
projectname="$(cat projectname)" read projectname < projectname
buildpath="" buildpath=""
mode="" mode=""
option="" option=""

View File

@ -31,7 +31,7 @@ set -u -e
. "include/err.sh" . "include/err.sh"
projectname="$(cat projectname)" read projectname < projectname
opts="" opts=""
boards= boards=
firstoption="" firstoption=""

View File

@ -28,7 +28,7 @@ set -u -e
. "include/err.sh" . "include/err.sh"
projectname="$(cat projectname)" read projectname < projectname
cfgsdir="resources/coreboot" cfgsdir="resources/coreboot"

View File

@ -23,7 +23,7 @@ set -u -e
. "include/err.sh" . "include/err.sh"
projectname="$(cat projectname)" read projectname < projectname
version="version-unknown" version="version-unknown"
versiondate="version-date-unknown" versiondate="version-date-unknown"
tree="default" tree="default"
@ -53,9 +53,9 @@ main()
init_check() init_check()
{ {
[ -f version ] && \ [ -f version ] && \
version="$(cat version)" read version < version
[ -f versiondate ] && \ [ -f versiondate ] && \
versiondate="$(cat versiondate)" read versiondate < versiondate
[ ! -d "bin/" ] && \ [ ! -d "bin/" ] && \
err "init_check: no ROMs built yet (error)" err "init_check: no ROMs built yet (error)"
[ -d "release/" ] || \ [ -d "release/" ] || \

View File

@ -23,7 +23,7 @@ set -u -e
. "include/err.sh" . "include/err.sh"
projectname="$(cat projectname)" read projectname < projectname
trees_fetch_list="coreboot u-boot seabios" trees_fetch_list="coreboot u-boot seabios"
simple_fetch_list="flashrom grub memtest86plus me_cleaner uefitool" simple_fetch_list="flashrom grub memtest86plus me_cleaner uefitool"
@ -46,9 +46,9 @@ printf "Building source code archive, version %s\n" "${version}"
main() main()
{ {
[ -f version ] && \ [ -f version ] && \
version="$(cat version)" read version < version
[ -f versiondate ] && \ [ -f versiondate ] && \
versiondate="$(cat versiondate)" read versiondate < versiondate
create_release_directory create_release_directory
download_modules download_modules

View File

@ -26,8 +26,8 @@ set -u -e
. "include/err.sh" . "include/err.sh"
projectname="$(cat projectname)" read projectname < projectname
our_version="$(cat version)" read our_version < version
export LOCALVERSION="-${projectname}-${our_version}" export LOCALVERSION="-${projectname}-${our_version}"
@ -270,11 +270,11 @@ copy_elf()
err "copy_elf: cannot prepare coreboot image" err "copy_elf: cannot prepare coreboot image"
fi fi
for f in $(cat "${listfile}"); do while read f; do
[ ! -f "${codedir}/$f" ] || \ [ ! -f "${codedir}/$f" ] || \
cp "${codedir}/${f}" "${dest_dir}/" || \ cp "${codedir}/${f}" "${dest_dir}/" || \
fail "copy_elf: cannot copy elf file" fail "copy_elf: cannot copy elf file"
done done < ${listfile}
./handle make file -c "${codedir}" || \ ./handle make file -c "${codedir}" || \
fail "copy_elf: clean: ${codedir} (${project}/${target})" fail "copy_elf: clean: ${codedir} (${project}/${target})"

View File

@ -21,10 +21,10 @@ set -u
. "include/err.sh" . "include/err.sh"
project="$(cat projectname)" read project < projectname
version="version-unknown" version="version-unknown"
[ -f version ] && version="$(cat version)" [ -f version ] && read version < version
version_="${version}" version_="${version}"
if [ -e ".git" ]; then if [ -e ".git" ]; then
version="$(git describe --tags HEAD 2>&1)" || \ version="$(git describe --tags HEAD 2>&1)" || \
@ -34,7 +34,7 @@ if [ -e ".git" ]; then
fi fi
versiondate="version-date-unknown" versiondate="version-date-unknown"
[ -f versiondate ] && versiondate="$(cat versiondate)" [ -f versiondate ] && read versiondate < versiondate
versiondate_="${versiondate}" versiondate_="${versiondate}"
if [ -e ".git" ]; then if [ -e ".git" ]; then
versiondate="$(git show --no-patch --no-notes --pretty='%ct' HEAD)" || \ versiondate="$(git show --no-patch --no-notes --pretty='%ct' HEAD)" || \