From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7310255822639988736 X-Received: by 2002:a05:600c:1e02:b0:40c:192f:6ae5 with SMTP id ay2-20020a05600c1e0200b0040c192f6ae5mr187384wmb.112.1702051568317; Fri, 08 Dec 2023 08:06:08 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:e346:0:b0:333:57a5:61cf with SMTP id n6-20020adfe346000000b0033357a561cfls227209wrj.0.-pod-prod-01-eu; Fri, 08 Dec 2023 08:06:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IHF6EiKc/DvfLITJiS2DzCysPTmsFCj0dT41RoJmpERhErrX11vfEEr4kWG0QPfS+jJDKCI X-Received: by 2002:a5d:4344:0:b0:333:f04:f2d7 with SMTP id u4-20020a5d4344000000b003330f04f2d7mr137289wrr.55.1702051566114; Fri, 08 Dec 2023 08:06:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702051566; cv=none; d=google.com; s=arc-20160816; b=B2eyd1z4RuzFu4CFHv8MnirBl3zOCWWJgltVcCH1wNCt9hfJkvmQOYoac4TcOmjj7c ei+8JzMQSKga+QfvqMeX1ejjQUMduYBFvDNzV4fQ+tcR9wOIEaQunA5VytTrq4yoG2Sd PJZDN3jjb1SSvoWfRG8y+ApOeYsMfAyXkypFbxXCs4vyZSH8krTsbw3vzfQ/OM5CJTjc Y9DIMtND0AsmOwYkmi2V7nQm/9mpdGTIGTuv+3OWLiwMOX/BZW/3SicX+4gKS/naznpq YSkK9uU8k9RHSV04Un/8OqQc6Czg9SG5N2CshOb1hlKQYDCT8VkJ8bRrLNLeheuEQ1XO i9Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=hY3Y9Czkj2l1L/sNpNGxCoYAeoh4sHDVmrLS19mrPts=; fh=/h9QQkzJ8EboVkWg45aWwpaUro6WMavIVd2OhN45RtE=; b=eeVeMl0B5C08NkQIvV1y6yjpELrsxLvAYTSXDcNL+L0aMF/706MZj9vEYkeTYPG+7G eDJ92DOFPYOCxc/CjC1WJr/7Lvliimdb2V8DHmZve/9EPKaWfmTge+FIgxlVs2FT5kXp 6rCS0k36/6WoLFdhoonuQHIj0Kgy9tdJzbtuWJSK/ByOrCYcsi7aEBt/N1gpUm/tE84G gcaEqeunVGEolIJRU/FtMFxIVSXyhrgKeuoCMO0xBGzqYREW0xbg88fvzNTtoPruSktG oH2aFbo2l/mElkvfXdQ7yMiGh9aj+lcJAmQ2gKY3sV56N3Kes5X3zvMDjL1IDtVrW1Ri NbmQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id b13-20020adfe64d000000b00333504001b3si108919wrn.1.2023.12.08.08.06.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Dec 2023 08:06:06 -0800 (PST) Received-SPF: pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Received: from user-B660.promwad.corp ([159.148.83.123]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 3B8G64BR004761 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 8 Dec 2023 17:06:04 +0100 From: Anton Mikanovich To: isar-users@googlegroups.com Cc: Anton Mikanovich Subject: [PATCH] dpkg: Fix failure with the latest coreutils Date: Fri, 8 Dec 2023 18:05:57 +0200 Message-Id: <20231208160557.108706-1-amikan@ilbers.de> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: B5XfffxuD7sv 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 --- 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