From c4cd3ae5d4ab8cf1ee424b68ba2a554d1813184740099abcdfd7b58620f58a78 Mon Sep 17 00:00:00 2001 From: Richard Brown Date: Tue, 14 Jun 2022 15:40:39 +0000 Subject: [PATCH 1/2] Accepting request 982638 from home:dancermak:branches:devel:microos Add missing Requires(post): sed, fixes boo#1200524 OBS-URL: https://build.opensuse.org/request/show/982638 OBS-URL: https://build.opensuse.org/package/show/devel:microos/libcontainers-common?expand=0&rev=4 --- libcontainers-common.changes | 6 ++++++ libcontainers-common.spec | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libcontainers-common.changes b/libcontainers-common.changes index 8f93f39..95a9b59 100644 --- a/libcontainers-common.changes +++ b/libcontainers-common.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jun 14 13:53:43 UTC 2022 - Dan Čermák + +- Add missing Requires(post): sed, fixes boo#1200524 +- Make %post compatible with dash + ------------------------------------------------------------------- Wed Jun 8 12:39:46 UTC 2022 - Richard Brown diff --git a/libcontainers-common.spec b/libcontainers-common.spec index 276ff13..30ed54a 100644 --- a/libcontainers-common.spec +++ b/libcontainers-common.spec @@ -53,7 +53,8 @@ Provides: libcontainers-storage = %{version} Obsoletes: libcontainers-image < %{version} Obsoletes: libcontainers-storage < %{version} Requires(post): util-linux-systemd -Requires(post): grep +Requires(post): /usr/bin/grep +Requires(post): /usr/bin/sed BuildArch: noarch %description @@ -138,7 +139,7 @@ sed -i 's/ostree_repo = ""/\#ostree_repo = ""/g' /etc/containers/storage.conf # If installing, check if /var/lib/containers (or /var/lib in its defect) is btrfs and set driver # to "btrfs" if true if [ $1 -eq 1 ] ; then - fstype=$((findmnt -o FSTYPE -l --target /var/lib/containers || findmnt -o FSTYPE -l --target /var/lib) | grep -v FSTYPE) + fstype=`(findmnt -o FSTYPE -l --target /var/lib/containers || findmnt -o FSTYPE -l --target /var/lib) | grep -v FSTYPE` if [ "$fstype" = "btrfs" ]; then sed -i 's/driver = "overlay"/driver = "btrfs"/g' %{_sysconfdir}/containers/storage.conf fi From 6f851ba5fc4f1d2e30c27a82147b1491fb5c504445fbc1a64dda5d2f2f7855ca Mon Sep 17 00:00:00 2001 From: Richard Brown Date: Wed, 15 Jun 2022 11:16:31 +0000 Subject: [PATCH 2/2] Accepting request 982756 from home:favogt:branches:devel:microos - Use $() again in %post, but with a space for POSIX compliance OBS-URL: https://build.opensuse.org/request/show/982756 OBS-URL: https://build.opensuse.org/package/show/devel:microos/libcontainers-common?expand=0&rev=5 --- libcontainers-common.changes | 5 +++++ libcontainers-common.spec | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libcontainers-common.changes b/libcontainers-common.changes index 95a9b59..155db66 100644 --- a/libcontainers-common.changes +++ b/libcontainers-common.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jun 15 10:20:16 UTC 2022 - Fabian Vogt + +- Use $() again in %post, but with a space for POSIX compliance + ------------------------------------------------------------------- Tue Jun 14 13:53:43 UTC 2022 - Dan Čermák diff --git a/libcontainers-common.spec b/libcontainers-common.spec index 30ed54a..f712d36 100644 --- a/libcontainers-common.spec +++ b/libcontainers-common.spec @@ -139,7 +139,8 @@ sed -i 's/ostree_repo = ""/\#ostree_repo = ""/g' /etc/containers/storage.conf # If installing, check if /var/lib/containers (or /var/lib in its defect) is btrfs and set driver # to "btrfs" if true if [ $1 -eq 1 ] ; then - fstype=`(findmnt -o FSTYPE -l --target /var/lib/containers || findmnt -o FSTYPE -l --target /var/lib) | grep -v FSTYPE` + # Space to avoid ambiguity with arithmetic expansion + fstype=$( (findmnt -o FSTYPE -l --target /var/lib/containers || findmnt -o FSTYPE -l --target /var/lib) | grep -v FSTYPE) if [ "$fstype" = "btrfs" ]; then sed -i 's/driver = "overlay"/driver = "btrfs"/g' %{_sysconfdir}/containers/storage.conf fi