public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'Cedric Hombourger' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: Cedric Hombourger <cedric.hombourger@siemens.com>
Subject: [PATCH 2/3] repository: align repo_contains_package signature with other repo functions
Date: Fri, 22 Nov 2024 06:48:15 +0100	[thread overview]
Message-ID: <20241122054816.3371334-3-cedric.hombourger@siemens.com> (raw)
In-Reply-To: <20241122054816.3371334-1-cedric.hombourger@siemens.com>

All repository functions take four arguments:
 - path to the repository
 - path to the database used by the repository management tool
 - codename
 - file/package

repo_contains_package was the only function deviating from this scheme and its
current implementation only takes a repository path and a file. Since the
repositoty class was introduced to hide implementation details (so we could
move away from reprepro if we wanted to), align that function with others.
The only caller found in the repository (base-apt) was changed to use the new
(standard) API.

Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
---
 meta/classes/repository.bbclass            | 4 +++-
 meta/recipes-devtools/base-apt/base-apt.bb | 5 ++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/meta/classes/repository.bbclass b/meta/classes/repository.bbclass
index 42d15823..b20ec091 100644
--- a/meta/classes/repository.bbclass
+++ b/meta/classes/repository.bbclass
@@ -93,7 +93,9 @@ repo_del_package() {
 
 repo_contains_package() {
     local dir="$1"
-    local file="$2"
+    local dbdir="$2"
+    local codename="$3"
+    local file="$4"
     local package
 
     package=$(find ${dir} -name ${file##*/})
diff --git a/meta/recipes-devtools/base-apt/base-apt.bb b/meta/recipes-devtools/base-apt/base-apt.bb
index 2766bc71..4fad76c5 100644
--- a/meta/recipes-devtools/base-apt/base-apt.bb
+++ b/meta/recipes-devtools/base-apt/base-apt.bb
@@ -24,7 +24,10 @@ populate_base_apt() {
 
         # Check if this package is already in base-apt
         ret=0
-        repo_contains_package "${REPO_BASE_DIR}/${base_distro}" "${package}" ||
+        repo_contains_package "${REPO_BASE_DIR}/${base_distro}" \
+            "${REPO_BASE_DB_DIR}"/"${base_distro}" \
+            "${BASE_DISTRO_CODENAME}" \
+            "${package}" ||
             ret=$?
         [ "${ret}" = "0" ] && continue
         if [ "${ret}" = "1" ]; then
-- 
2.34.1

-- 
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/20241122054816.3371334-3-cedric.hombourger%40siemens.com.

  parent reply	other threads:[~2024-11-22  5:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-22  5:48 [PATCH 0/3] repository: small fixes for repo_{contains,del}_packages 'Cedric Hombourger' via isar-users
2024-11-22  5:48 ` [PATCH 1/3] repository: repo_del_package should not remove source packages 'Cedric Hombourger' via isar-users
2024-11-22  5:48 ` 'Cedric Hombourger' via isar-users [this message]
2024-11-22  5:48 ` [PATCH 3/3] repository: make repo_contains_package query the package database 'Cedric Hombourger' via isar-users
2024-11-27  7:11 ` [PATCH 0/3] repository: small fixes for repo_{contains,del}_packages 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=20241122054816.3371334-3-cedric.hombourger@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=cedric.hombourger@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