| Message ID | 20251123070029.1674527-1-cedric.hombourger@siemens.com |
|---|---|
| State | Accepted, archived |
| Headers | show |
| Series | deb-src: do not error but warn for missing source packages | expand |
Applied to next, thanks. On 11/23/25 08:00, 'Cedric Hombourger' via isar-users wrote: > Some package repositories may only provide binary packages and no > source packages. While this is unfortunate, it shouldn't be fatal > either. Collect names and versions and print a warning for each. > > Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com> > --- > meta/classes/deb-dl-dir.bbclass | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > > diff --git a/meta/classes/deb-dl-dir.bbclass b/meta/classes/deb-dl-dir.bbclass > index 16ccd426..7ebc3526 100644 > --- a/meta/classes/deb-dl-dir.bbclass > +++ b/meta/classes/deb-dl-dir.bbclass > @@ -41,7 +41,8 @@ debsrc_download() { > # since "set -e" is used) > avail=$(mktemp) > wanted=$(mktemp) > - trap "rm -f ${avail} ${wanted}" EXIT > + missing=$(mktemp) > + trap "rm -f ${avail} ${wanted} ${missing}" EXIT > > # List all packages known to apt > apt-cache -o APT::Architecture=${DISTRO_ARCH} -o Dir=${rootfs} dumpavail \ > @@ -80,9 +81,16 @@ debsrc_download() { > -- \ > apt-get -o APT::Architecture=${DISTRO_ARCH} \ > -o Dir="${rootfs}" -y --download-only \ > - --only-source source "${src}=${version}" > + --only-source source "${src}=${version}" \ > + || echo "${src} ${version}" >> ${missing} > } > done > + > + # warn for missing source packages > + sort -u -o ${missing} ${missing} > + while read pkg ver; do > + bbwarn "could not find or download sources for ${pkg} ${ver}" > + done < ${missing} > ) 9>"${DEBSRCDIR}/${rootfs_distro}.lock" > } >
diff --git a/meta/classes/deb-dl-dir.bbclass b/meta/classes/deb-dl-dir.bbclass index 16ccd426..7ebc3526 100644 --- a/meta/classes/deb-dl-dir.bbclass +++ b/meta/classes/deb-dl-dir.bbclass @@ -41,7 +41,8 @@ debsrc_download() { # since "set -e" is used) avail=$(mktemp) wanted=$(mktemp) - trap "rm -f ${avail} ${wanted}" EXIT + missing=$(mktemp) + trap "rm -f ${avail} ${wanted} ${missing}" EXIT # List all packages known to apt apt-cache -o APT::Architecture=${DISTRO_ARCH} -o Dir=${rootfs} dumpavail \ @@ -80,9 +81,16 @@ debsrc_download() { -- \ apt-get -o APT::Architecture=${DISTRO_ARCH} \ -o Dir="${rootfs}" -y --download-only \ - --only-source source "${src}=${version}" + --only-source source "${src}=${version}" \ + || echo "${src} ${version}" >> ${missing} } done + + # warn for missing source packages + sort -u -o ${missing} ${missing} + while read pkg ver; do + bbwarn "could not find or download sources for ${pkg} ${ver}" + done < ${missing} ) 9>"${DEBSRCDIR}/${rootfs_distro}.lock" }
Some package repositories may only provide binary packages and no source packages. While this is unfortunate, it shouldn't be fatal either. Collect names and versions and print a warning for each. Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com> --- meta/classes/deb-dl-dir.bbclass | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)