bootstrap.inc install sources-list then wrongly remove it, bugfix

Message ID 20230110115020.1234724-1-roberto.foglietta@linuxteam.org
State Superseded, archived
Headers show
Series bootstrap.inc install sources-list then wrongly remove it, bugfix | expand

Commit Message

roberto.foglietta@linuxteam.org Jan. 10, 2023, 11:50 a.m. UTC
From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>

bootstrap.inc, bugfix: two lines were in reverse order between them

Signed-off-by: Roberto A. Foglietta <roberto.foglietta@gmail.com>
---
 meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Roberto A. Foglietta Jan. 10, 2023, 12:05 p.m. UTC | #1
On Tue, 10 Jan 2023 at 12:50, <roberto.foglietta@linuxteam.org> wrote:
>
> From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
>
> bootstrap.inc, bugfix: two lines were in reverse order between them
>

>          fi
> -        install -v -m644 "${APTSRCS_INIT}" "${ROOTFSDIR}/etc/apt/sources-list"
>          rm -f "${ROOTFSDIR}/etc/apt/sources.list"

This line does not belong to the intended patch, sorry

> -        rm -rf "${ROOTFSDIR}/var/lib/apt/lists/"

Once the sstate cache rely on a tar that has many --exclude included
/var/lib/apt/lists there is no anymore the need to delete them but in
the next, this line still have its reason to exists.

*
> +        install -v -m644 "${APTSRCS_INIT}" "${ROOTFSDIR}/etc/apt/sources-list"
> +
>          find ${APT_KEYS_DIR}/ -type f | while read keyfile
>          do
>              MY_GPGHOME="$(chroot "${ROOTFSDIR}" mktemp -d /tmp/gpghomeXXXXXXXXXX)"
> --
> 2.34.1
>

I am going to send the v2.

Best regards, R-
Jan Kiszka Jan. 10, 2023, 12:41 p.m. UTC | #2
On 10.01.23 12:50, roberto.foglietta@linuxteam.org wrote:
> From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
> 
> bootstrap.inc, bugfix: two lines were in reverse order between them
> 
> Signed-off-by: Roberto A. Foglietta <roberto.foglietta@gmail.com>
> ---
>  meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> index faba73f..3aa11a4 100644
> --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> @@ -296,6 +296,7 @@ do_bootstrap() {
>          if [ "${BOOTSTRAP_FOR_HOST}" = "0" ]; then
>              arch_param="--arch=${DISTRO_ARCH}"
>          fi
> +
>          ${DEBOOTSTRAP} $debootstrap_args \
>                         $arch_param \
>                         ${@get_distro_components_argument(d)} \
> @@ -327,9 +328,9 @@ do_bootstrap() {
>              install -v -m644 "${APTSRCS}" \
>                               "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list"
>          fi
> -        install -v -m644 "${APTSRCS_INIT}" "${ROOTFSDIR}/etc/apt/sources-list"
>          rm -f "${ROOTFSDIR}/etc/apt/sources.list"

sources-list != sources.list, if that was your concern. So the order is
not critical here. If it were, things should have exploded already in
all colors.

Jan

> -        rm -rf "${ROOTFSDIR}/var/lib/apt/lists/"*
> +        install -v -m644 "${APTSRCS_INIT}" "${ROOTFSDIR}/etc/apt/sources-list"
> +
>          find ${APT_KEYS_DIR}/ -type f | while read keyfile
>          do
>              MY_GPGHOME="$(chroot "${ROOTFSDIR}" mktemp -d /tmp/gpghomeXXXXXXXXXX)"
Roberto A. Foglietta Jan. 10, 2023, 7:22 p.m. UTC | #3
On Tue, 10 Jan 2023 at 13:42, Jan Kiszka <jan.kiszka@siemens.com> wrote:
>
> On 10.01.23 12:50, roberto.foglietta@linuxteam.org wrote:
> > From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>

> sources-list != sources.list, if that was your concern. So the order is

correct: I have increased the font size of my console

> not critical here. If it were, things should have exploded already in
> all colors.

correct: in next but not in my fork because deb_dl_import() imports
also the lists.

Patch

diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
index faba73f..3aa11a4 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
@@ -296,6 +296,7 @@  do_bootstrap() {
         if [ "${BOOTSTRAP_FOR_HOST}" = "0" ]; then
             arch_param="--arch=${DISTRO_ARCH}"
         fi
+
         ${DEBOOTSTRAP} $debootstrap_args \
                        $arch_param \
                        ${@get_distro_components_argument(d)} \
@@ -327,9 +328,9 @@  do_bootstrap() {
             install -v -m644 "${APTSRCS}" \
                              "${ROOTFSDIR}/etc/apt/sources.list.d/bootstrap.list"
         fi
-        install -v -m644 "${APTSRCS_INIT}" "${ROOTFSDIR}/etc/apt/sources-list"
         rm -f "${ROOTFSDIR}/etc/apt/sources.list"
-        rm -rf "${ROOTFSDIR}/var/lib/apt/lists/"*
+        install -v -m644 "${APTSRCS_INIT}" "${ROOTFSDIR}/etc/apt/sources-list"
+
         find ${APT_KEYS_DIR}/ -type f | while read keyfile
         do
             MY_GPGHOME="$(chroot "${ROOTFSDIR}" mktemp -d /tmp/gpghomeXXXXXXXXXX)"