meta/classes/image: move sources-list as bootstrap.list in rootfs_finalize

Message ID 20241213134538.1261599-1-srinuvasan.a@siemens.com
State Under Review, archived
Headers show
Series meta/classes/image: move sources-list as bootstrap.list in rootfs_finalize | expand

Commit Message

srinuvasan.a Dec. 13, 2024, 1:45 p.m. UTC
From: srinuvasan <srinuvasan.a@siemens.com>

Presently, sources-list is not moved as bootstrap.list, even though the source-list file
and sources.list.d directory present, this regression introduced in 8c10710

Make sure to use -d if the directory exists and use the correct name of the directory (sources.list.d).

Signed-off-by: srinuvasan <srinuvasan.a@siemens.com>
---
 meta/classes/image.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Uladzimir Bely Dec. 20, 2024, 7:47 a.m. UTC | #1
On Fri, 2024-12-13 at 19:15 +0530, srinuvasan.a@siemens.com wrote:
> From: srinuvasan <srinuvasan.a@siemens.com>
> 
> Presently, sources-list is not moved as bootstrap.list, even though
> the source-list file
> and sources.list.d directory present, this regression introduced in
> 8c10710
> 
> Make sure to use -d if the directory exists and use the correct name
> of the directory (sources.list.d).
> 
> Signed-off-by: srinuvasan <srinuvasan.a@siemens.com>
> ---
>  meta/classes/image.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index 4ed9123f..db21cc76 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -416,7 +416,7 @@ do_rootfs_finalize() {
>                  -maxdepth 1 -name 'qemu-*-static' -type f -delete
>          fi
>  
> -        if [ -e "${ROOTFSDIR}/etc/apt/sources-list" ] && [ -e
> "${ROOTFSDIR}/etc/apt/sources-list.d" ]; then
> +        if [ -e "${ROOTFSDIR}/etc/apt/sources-list" ] && [ -d
> "${ROOTFSDIR}/etc/apt/sources.list.d" ]; then
>              mv "${ROOTFSDIR}/etc/apt/sources-list" \
>                  "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list"
>          fi

Applied to next, thanks.

Patch

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 4ed9123f..db21cc76 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -416,7 +416,7 @@  do_rootfs_finalize() {
                 -maxdepth 1 -name 'qemu-*-static' -type f -delete
         fi
 
-        if [ -e "${ROOTFSDIR}/etc/apt/sources-list" ] && [ -e "${ROOTFSDIR}/etc/apt/sources-list.d" ]; then
+        if [ -e "${ROOTFSDIR}/etc/apt/sources-list" ] && [ -d "${ROOTFSDIR}/etc/apt/sources.list.d" ]; then
             mv "${ROOTFSDIR}/etc/apt/sources-list" \
                 "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list"
         fi