public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'cedric.hombourger@siemens.com' via isar-users" <isar-users@googlegroups.com>
To: "isar-users@googlegroups.com" <isar-users@googlegroups.com>,
	"Arjunan, Srinu" <srinuvasan.a@siemens.com>
Cc: "Kiszka, Jan" <jan.kiszka@siemens.com>
Subject: Re: [PATCH] classes/repository: use the proper filename to find the packages under repo
Date: Sat, 16 Nov 2024 17:38:45 +0000	[thread overview]
Message-ID: <7753363cffbf014661ddfe439c96417a971a9f3c.camel@siemens.com> (raw)
In-Reply-To: <20241116172900.897898-1-srinuvasan.a@siemens.com>

Hello Srinu,

I have a different implementation of this function that I was going to
submit after doing some clean-up and running a full CI build

Here's anyhow what it looks like:

# lookup ${file} in the database for the current suite
package=$(reprepro -b ${dir} --dbdir ${dbdir} \
                   --list-format 'Filename\n' \
                   listfilter ${distro} \
                   'Filename (% /'${file##*/}')' | head -n 1)
if [ -n "$package" ]; then
    # yes
    cmp --silent "$package" "$file" && return 0

    # yes but not the exact same file
    return 1
fi
# no
return 2

I would suggest you come up with a more concise description of your
change and ideally some way to reproduce and exhibit the problem as I
am not sure I follow your problem statement

On Sat, 2024-11-16 at 22:58 +0530, srinuvasan.a@siemens.com wrote:
> From: srinuvasan <srinuvasan.a@siemens.com>
> 
> The very first time when we generate the base-apt the REPO_BASE_DIR
> is empty, it doesn't contain any packages, hence
> repo_contains_package
> function returns 2, based on the return value (2), we are adding all
> the
> packages to the empty repo by calling the repo_add_packages function.
> 
> After clearing the temporary and cache files, when we retrigger the
> base-apt
> we should skip the repo_add_packages function for all the packages
> (assume that
> repo packages are not contaminated), but we observed
> repo_contains_function
> says some of the packages not available in the existing repo, but
> really those
> packages available in the repo.
> 
> Here the issue is, reprepro caching all the packages by skipping the
> epoch version if any packages have, and all the packages contain only
> the
> <upstream_version>-<debian_version>.
> 
> But in the download folder , few packages contain the epoch version,
> f.e: automake, git-man, ssh, now we try to find the packages with
> epoch version in APT repo, but APT repos skip the epoch version
> during repo generation.
> 
> With that wrong finding again we are calling the repo_add_package
> function for few packages, even those packages already available in
> the repo.
> 
> Skip the epoch version during finding the packages in the repo, with
> that we can eliminate
> unnecessarily adding the packages to repo.
> 
> Signed-off-by: srinuvasan <srinuvasan.a@siemens.com>
> ---
>  meta/classes/repository.bbclass | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/repository.bbclass
> b/meta/classes/repository.bbclass
> index 28e712fd..7379658d 100644
> --- a/meta/classes/repository.bbclass
> +++ b/meta/classes/repository.bbclass
> @@ -99,7 +99,8 @@ repo_contains_package() {
>      local file="$2"
>      local package
>  
> -    package=$(find ${dir} -name ${file##*/})
> +    file_name=$(echo "${file##*/}" | sed 's/[0-9]%3a//g')
> +    package=$(find ${dir} -name ${file_name})
>      if [ -n "$package" ]; then
>          # yes
>          cmp --silent "$package" "$file" && return 0

-- 
Cedric Hombourger
Siemens AG
www.siemens.com

-- 
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/7753363cffbf014661ddfe439c96417a971a9f3c.camel%40siemens.com.

  reply	other threads:[~2024-11-16 17:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-16 17:28 srinuvasan.a via isar-users
2024-11-16 17:38 ` 'cedric.hombourger@siemens.com' via isar-users [this message]
2024-11-16 23:54 ` 'cedric.hombourger@siemens.com' via isar-users
2024-11-17  7:10   ` 'Arjunan, Srinu' via isar-users
2024-11-17 15:45   ` [PATCH v2] " srinuvasan.a via isar-users
2024-11-20  6:05     ` Uladzimir Bely
2024-11-20  9:32       ` [PATCH v3] " srinuvasan.a via isar-users
2024-11-27  7:25         ` Uladzimir Bely

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=7753363cffbf014661ddfe439c96417a971a9f3c.camel@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=cedric.hombourger@siemens.com \
    --cc=jan.kiszka@siemens.com \
    --cc=srinuvasan.a@siemens.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