public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] dpkg: Fix failure with the latest coreutils
@ 2023-12-08 16:05 Anton Mikanovich
  2023-12-14  7:15 ` Uladzimir Bely
  0 siblings, 1 reply; 2+ messages in thread
From: Anton Mikanovich @ 2023-12-08 16:05 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich

Starting from coreutils 9.2 commands 'cp -n' and 'mv -n' exit with
nonzero status if they skip their action because the destination
exists.
This results in packages building failures on Debian Sid targets.
To keep old behavior '--update=none' was added since 9.3.
This patch introduce choosing the right option syntax based on distro
and override it for Sid.
In case of backporting coreutils > 9.2 into testing and/or stable we
should add overrides for them also.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 meta/classes/dpkg.bbclass | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index b69fa254..1d684e98 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -28,6 +28,11 @@ do_prepare_build:append() {
     env > ${DPKG_PREBUILD_ENV_FILE}
 }
 
+# cp -n results in nonzero exit code starting from coreutils 9.2
+# and starting from 9.3 we can use --update=none for the same behaviour
+CP_FLAGS ?= "-Ln --no-preserve=owner"
+CP_FLAGS:sid ?= "-L --update=none --no-preserve=owner"
+
 # Build package from sources using build script
 dpkg_runbuild[vardepsexclude] += "${SBUILD_PASSTHROUGH_ADDITIONS}"
 dpkg_runbuild() {
@@ -116,7 +121,7 @@ dpkg_runbuild() {
         --chroot-setup-commands="mkdir -p ${deb_dir}" \
         --chroot-setup-commands="ln -sf ${ext_deb_dir}/*.deb -t ${deb_dir}/" \
         --finished-build-commands="rm -f ${deb_dir}/sbuild-build-depends-main-dummy_*.deb" \
-        --finished-build-commands="[ -z "$(find ${deb_dir} -maxdepth 1 -name '*.deb' -print -quit)" ] || cp -Ln --no-preserve=owner ${deb_dir}/*.deb -t ${ext_deb_dir}/" \
+        --finished-build-commands="[ -z "$(find ${deb_dir} -maxdepth 1 -name '*.deb' -print -quit)" ] || cp ${CP_FLAGS} ${deb_dir}/*.deb -t ${ext_deb_dir}/" \
         --finished-build-commands="cp /var/log/dpkg.log ${ext_root}/dpkg_partial.log" \
         --debbuildopts="--source-option=-I" \
         --build-dir=${WORKDIR} --dist="isar" ${DSC_FILE}
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] dpkg: Fix failure with the latest coreutils
  2023-12-08 16:05 [PATCH] dpkg: Fix failure with the latest coreutils Anton Mikanovich
@ 2023-12-14  7:15 ` Uladzimir Bely
  0 siblings, 0 replies; 2+ messages in thread
From: Uladzimir Bely @ 2023-12-14  7:15 UTC (permalink / raw)
  To: Anton Mikanovich, isar-users

On Fri, 2023-12-08 at 18:05 +0200, Anton Mikanovich wrote:
> Starting from coreutils 9.2 commands 'cp -n' and 'mv -n' exit with
> nonzero status if they skip their action because the destination
> exists.
> This results in packages building failures on Debian Sid targets.
> To keep old behavior '--update=none' was added since 9.3.
> This patch introduce choosing the right option syntax based on distro
> and override it for Sid.
> In case of backporting coreutils > 9.2 into testing and/or stable we
> should add overrides for them also.
> 
> Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
> ---
>  meta/classes/dpkg.bbclass | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 

Applied to next.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-14  7:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-08 16:05 [PATCH] dpkg: Fix failure with the latest coreutils Anton Mikanovich
2023-12-14  7:15 ` Uladzimir Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox