public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] dpkg: Account for empty local apt cache after package build
@ 2023-10-18 13:08 Jan Kiszka
  2023-10-18 20:33 ` Klincov, Wadim
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2023-10-18 13:08 UTC (permalink / raw)
  To: isar-users; +Cc: Schmidt, Adriaan

From: Jan Kiszka <jan.kiszka@siemens.com>

A build dependency-free package combined with sstate caching and cleared
deb cache can trigger

| cp -Ln --no-preserve=owner /var/cache/apt/archives/*.deb -t /home/builder/example-raw/rootfs/var/cache/apt/archives/
| --------------------------------------------------------------------------------------------------------------------
|
| cp: cannot stat '/var/cache/apt/archives/*.deb': No such file or directory
|
| E: Command 'cp -Ln --no-preserve=owner /var/cache/apt/archives/*.deb -t /home/builder/example-raw/rootfs/var/cache/apt/archives/' failed to run.

Account for that.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/classes/dpkg.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index d89b0fd9..7249f32b 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -109,7 +109,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="cp -Ln --no-preserve=owner ${deb_dir}/*.deb -t ${ext_deb_dir}/" \
+        --finished-build-commands="[ -n "$(find ${deb_dir} -maxdepth 1 -name '*.deb' -print -quit)" ] && cp -Ln --no-preserve=owner ${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.35.3

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

end of thread, other threads:[~2023-10-19  4:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-18 13:08 [PATCH] dpkg: Account for empty local apt cache after package build Jan Kiszka
2023-10-18 20:33 ` Klincov, Wadim
2023-10-19  4:36   ` Jan Kiszka

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