From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7339847101007790080 X-Received: by 2002:a05:6870:1813:b0:21f:d149:7e9b with SMTP id t19-20020a056870181300b0021fd1497e9bmr6634278oaf.15.1708941324384; Mon, 26 Feb 2024 01:55:24 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6870:ce4c:b0:21f:a0f8:8272 with SMTP id xd12-20020a056870ce4c00b0021fa0f88272ls2997727oab.2.-pod-prod-02-us; Mon, 26 Feb 2024 01:55:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IHcSDfziHwgz+09Bcjdo1bc7xI2hB/Q/yRgBuuGUksFe9TnT5tT3KHpwmEuXwjBjTGJlsWc X-Received: by 2002:a05:6808:1a08:b0:3c1:a8c5:7679 with SMTP id bk8-20020a0568081a0800b003c1a8c57679mr326511oib.7.1708941323635; Mon, 26 Feb 2024 01:55:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708941323; cv=none; d=google.com; s=arc-20160816; b=Ume9LZIAnDe00eAKDZwF92bXb2KpUuOhYhOhsVDblzCjvpeN8r68OwfaPZt6melngB j6BiUVRSjYhmFofqZDSDe+NCNFSPl7QSyRGJIZoWFn5B0QfWq0yBS2ArSWMAHGnpOWTA oex50FbGYxpBAPu6y8b2MRns9QhDtL6ckPtzhSsPiVwac5Jew0CdZ9f41oM02DXyS+l5 dLA7lAgTKgsStysTwAyjR2rdsyap4CblpZfQdb6ncgnpDIpEKow0lvLAJOZz0nj3/+Qh MY5QSh7NDJT4LQInkadYS51Wf9bi5XQgAEQJa65DcFpBNIgOioaYeSFEDZlBdtUVer58 SAAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:message-id:date :subject:cc:to:from:dkim-signature; bh=VDpA3HJw4CXn4+Z0v6avVks9KeCJIjYyVKQuyMYbpWo=; fh=1z37pEVhqwMLlkT4FDzOga7XBsM6Rzv6sXOq0pipxqo=; b=qiKy5NhMI+rOZc6SvJpyjfulvZ99N++vAzJpeXVFjIGXWVHUCDHM7/UfYnHtr/Lg43 UYacjWAUgGX/fBfmeeUJ+xSXDopxmMcC1KDTtW1hdP84qLshhDzY7xDsZcnl85Q0vSI9 nenag1cSfXMi03bnBpEhjmPqGpWW3+ZJdvcN1phUuch7gA1UukXLQqEush7olDVtf/pn T0DkkoRZU5+m1NsWJayhviHG5RhK+a9A5pgqh5Hk4jxI/uN886xmkUwO2oNjlHANNkZD RRIzmJTL8wHtDrKiwMSD1ErfyEMKhumOlnQv0crJ2fER9gD3IEUuqFxHyQsOXEFwKq0T ltjA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=pg3bOjqF; spf=pass (google.com: domain of fm-1212295-20240226095521d56493bf429e7db2e4-mwhxpg@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-1212295-20240226095521d56493bf429e7db2e4-mwHxPg@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Return-Path: Received: from mta-64-227.siemens.flowmailer.net (mta-64-227.siemens.flowmailer.net. [185.136.64.227]) by gmr-mx.google.com with ESMTPS id y15-20020a056808130f00b003c176bd214csi398108oiv.5.2024.02.26.01.55.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Feb 2024 01:55:23 -0800 (PST) Received-SPF: pass (google.com: domain of fm-1212295-20240226095521d56493bf429e7db2e4-mwhxpg@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) client-ip=185.136.64.227; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=pg3bOjqF; spf=pass (google.com: domain of fm-1212295-20240226095521d56493bf429e7db2e4-mwhxpg@rts-flowmailer.siemens.com designates 185.136.64.227 as permitted sender) smtp.mailfrom=fm-1212295-20240226095521d56493bf429e7db2e4-mwHxPg@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 20240226095521d56493bf429e7db2e4 for ; Mon, 26 Feb 2024 10:55:21 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=cedric.hombourger@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc; bh=VDpA3HJw4CXn4+Z0v6avVks9KeCJIjYyVKQuyMYbpWo=; b=pg3bOjqFI8FOayicJzE8MzAdRBCtWLuuKhcmg4VSAWQjAvLVPGxGfHYiW7YdWuWtmMupB7 yOV/RjTfn9WgtojnJ6HU95ZfYuhlYSxOy9HoNEiTyBSEqlIhNvdZtcJmCb9kuy/hqobTFVk7 qUiOVMRUvgeoo8ehKmLp9eZ+S1EGQ=; From: Cedric Hombourger To: isar-users@googlegroups.com Cc: Cedric Hombourger Subject: [PATCH] dpkg: use find to create symlinks to downloaded .deb files vs ln -sf wildcard Date: Mon, 26 Feb 2024 10:55:17 +0100 Message-Id: <20240226095517.66032-1-cedric.hombourger@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1212295:519-21489:flowmailer X-TUID: ytBf3lW98d6W If no .deb files were downloaded from remote feeds, use of "ln -sf *.deb" will create a dangling symlink named "*.deb" in the target directory and will be a broken link and make the cp command used in the finished-build-commands fail. Use "find -exec ln -t -sf {} +" to create symlinks instead of "ln -sf wildcard". For consistency and optimization, the find command used to copy newly downloaded .deb files from the sbuild env back to the build env is also changed to use the "{} +" -exec flavor (instead of "{} ;" which spawns one cp command for each single match). The issue of a dangling symlink named "*.deb" was found while building against file:// sources and no remote feeds. Signed-off-by: Cedric Hombourger --- meta/classes/dpkg.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass index 0578977d..3fa9f604 100644 --- a/meta/classes/dpkg.bbclass +++ b/meta/classes/dpkg.bbclass @@ -120,10 +120,10 @@ dpkg_runbuild() { --chroot-setup-commands="echo \"APT::Get::allow-downgrades 1;\" > /etc/apt/apt.conf.d/50isar-apt" \ --chroot-setup-commands="rm -f /var/log/dpkg.log" \ --chroot-setup-commands="mkdir -p ${deb_dir}" \ - --chroot-setup-commands="ln -sf ${ext_deb_dir}/*.deb -t ${deb_dir}/" \ + --chroot-setup-commands="find ${ext_deb_dir} -maxdepth 1 -name '*.deb' -exec ln -t ${deb_dir}/ -sf {} +" \ --chroot-setup-commands="apt-get update -o Dir::Etc::SourceList=\"sources.list.d/isar-apt.list\" -o Dir::Etc::SourceParts=\"-\" -o APT::Get::List-Cleanup=\"0\"" \ --finished-build-commands="rm -f ${deb_dir}/sbuild-build-depends-main-dummy_*.deb" \ - --finished-build-commands="find ${deb_dir} -maxdepth 1 -type f -name '*.deb' -print -exec cp ${CP_FLAGS} -t ${ext_deb_dir}/ {} \;" \ + --finished-build-commands="find ${deb_dir} -maxdepth 1 -type f -name '*.deb' -print -exec cp ${CP_FLAGS} -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.39.2