public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Zhihang Wei <wzh@ilbers.de>
To: Felix Moessbauer <felix.moessbauer@siemens.com>,
	isar-users@googlegroups.com
Cc: christoph.steiger@siemens.com
Subject: Re: [PATCH 1/1] remove all newly installed packages after localepurge
Date: Thu, 26 Mar 2026 14:05:49 +0100	[thread overview]
Message-ID: <ba047b6c-198c-4f53-ab02-7ff7d341ba8a@ilbers.de> (raw)
In-Reply-To: <20260323094521.682576-1-felix.moessbauer@siemens.com>

Applied to next, thanks.

Zhihang

On 3/23/26 10:45, 'Felix Moessbauer' via isar-users wrote:
> To perform the localepurge, we install the localepurge package, run the
> command and then remove it again from the rootfs. In case the set of
> newly installed packages intersects with the set of suggested packages
> from all previously installed packages, the intersection is not removed
> on autopurge (as apt internally does not track why a package was
> installed). However, we want these packages to be removed, as we never
> intended to install them in the first place (except for the localepurge
> operation).
>
> We fix this by tracking which new packages will be installed when
> installing localepurge and then remove exactly these.
>
> One example package that is affected in the base image is "perl".
>
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> ---
>   meta/classes-recipe/image-locales-extension.bbclass | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes-recipe/image-locales-extension.bbclass b/meta/classes-recipe/image-locales-extension.bbclass
> index b6b07dba..45dcdb67 100644
> --- a/meta/classes-recipe/image-locales-extension.bbclass
> +++ b/meta/classes-recipe/image-locales-extension.bbclass
> @@ -69,6 +69,9 @@ __EOF__
>           else
>               localepurge_state='p'
>               echo 'localepurge was not installed (removing it later)'
> +            # track additional packages that will be installed, as these packages might be
> +            # in the suggested set of other packages and by that need to be explicitly removed
> +            localepurge_pkgs=$(chroot '${ROOTFSDIR}' apt-get ${ROOTFS_APT_ARGS} -s localepurge 2>&1 | sed -n 's/^Inst \([^ ]*\) .*/\1/p')
>               chroot '${ROOTFSDIR}' apt-get ${ROOTFS_APT_ARGS} localepurge
>           fi
>   
> @@ -105,7 +108,7 @@ EOSH
>           if [ "$localepurge_state" = 'p' ]
>           then
>               echo removing localepurge...
> -            chroot '${ROOTFSDIR}' apt-get autopurge --yes localepurge
> +            chroot '${ROOTFSDIR}' apt-get purge --yes $localepurge_pkgs
>           fi
>   EOSUDO
>   }

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/ba047b6c-198c-4f53-ab02-7ff7d341ba8a%40ilbers.de.

      parent reply	other threads:[~2026-03-26 13:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-23  9:45 'Felix Moessbauer' via isar-users
2026-03-23 11:09 ` 'Jan Kiszka' via isar-users
2026-03-26 13:05 ` Zhihang Wei [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ba047b6c-198c-4f53-ab02-7ff7d341ba8a@ilbers.de \
    --to=wzh@ilbers.de \
    --cc=christoph.steiger@siemens.com \
    --cc=felix.moessbauer@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox