* [PATCH] buildchroot: Remove bashism when reading file content
@ 2021-06-10 7:02 Anton Mikanovich
2021-06-10 15:05 ` Henning Schild
0 siblings, 1 reply; 2+ messages in thread
From: Anton Mikanovich @ 2021-06-10 7:02 UTC (permalink / raw)
To: isar-users; +Cc: Anton Mikanovich
Reading mount counter with $(<file) was not working correctly in all
the environments, so replace it with more generic POSIX way:
$(cat file)
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
meta/classes/buildchroot.bbclass | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/meta/classes/buildchroot.bbclass b/meta/classes/buildchroot.bbclass
index 97d5301..806a29f 100644
--- a/meta/classes/buildchroot.bbclass
+++ b/meta/classes/buildchroot.bbclass
@@ -30,7 +30,7 @@ buildchroot_do_mounts() {
count="1"
if [ -f '${BUILDCHROOT_DIR}.mount' ]; then
- count=$(($(< '${BUILDCHROOT_DIR}.mount') + 1))
+ count=$(($(cat '${BUILDCHROOT_DIR}.mount') + 1))
fi
echo $count > '${BUILDCHROOT_DIR}.mount'
if [ $count -gt 1 ]; then
@@ -78,9 +78,10 @@ buildchroot_undo_mounts() {
set -e
if [ -f '${BUILDCHROOT_DIR}.mount' ]; then
- count=$(($(< '${BUILDCHROOT_DIR}.mount') - 1))
+ count=$(($(cat '${BUILDCHROOT_DIR}.mount') - 1))
echo $count > '${BUILDCHROOT_DIR}.mount'
else
+ echo "Could not find mount counter"
exit 1
fi
if [ $count -gt 0 ]; then
--
2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] buildchroot: Remove bashism when reading file content
2021-06-10 7:02 [PATCH] buildchroot: Remove bashism when reading file content Anton Mikanovich
@ 2021-06-10 15:05 ` Henning Schild
0 siblings, 0 replies; 2+ messages in thread
From: Henning Schild @ 2021-06-10 15:05 UTC (permalink / raw)
To: Anton Mikanovich; +Cc: isar-users
That does fix the build issues in docker/CI. So i think it should be
merged because without it people using a container workflow wont be
able to use next.
regards,
Henning
Am Thu, 10 Jun 2021 10:02:22 +0300
schrieb Anton Mikanovich <amikan@ilbers.de>:
> Reading mount counter with $(<file) was not working correctly in all
> the environments, so replace it with more generic POSIX way:
> $(cat file)
>
> Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
> ---
> meta/classes/buildchroot.bbclass | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/meta/classes/buildchroot.bbclass
> b/meta/classes/buildchroot.bbclass index 97d5301..806a29f 100644
> --- a/meta/classes/buildchroot.bbclass
> +++ b/meta/classes/buildchroot.bbclass
> @@ -30,7 +30,7 @@ buildchroot_do_mounts() {
>
> count="1"
> if [ -f '${BUILDCHROOT_DIR}.mount' ]; then
> - count=$(($(< '${BUILDCHROOT_DIR}.mount') + 1))
> + count=$(($(cat '${BUILDCHROOT_DIR}.mount') + 1))
> fi
> echo $count > '${BUILDCHROOT_DIR}.mount'
> if [ $count -gt 1 ]; then
> @@ -78,9 +78,10 @@ buildchroot_undo_mounts() {
> set -e
>
> if [ -f '${BUILDCHROOT_DIR}.mount' ]; then
> - count=$(($(< '${BUILDCHROOT_DIR}.mount') - 1))
> + count=$(($(cat '${BUILDCHROOT_DIR}.mount') - 1))
> echo $count > '${BUILDCHROOT_DIR}.mount'
> else
> + echo "Could not find mount counter"
> exit 1
> fi
> if [ $count -gt 0 ]; then
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-06-10 15:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10 7:02 [PATCH] buildchroot: Remove bashism when reading file content Anton Mikanovich
2021-06-10 15:05 ` Henning Schild
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox