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 1/3] repository: repo_del_package should not remove source packages
Date: Fri, 22 Nov 2024 06:48:14 +0100	[thread overview]
Message-ID: <20241122054816.3371334-2-cedric.hombourger@siemens.com> (raw)
In-Reply-To: <20241122054816.3371334-1-cedric.hombourger@siemens.com>

When the architecture of the binary package is "all", repo_del_package would
remove the architecture filter to remove binary for any packages. This
unfortunately causes reprepro to also remove the source package. Modify this
function to use "reprepro removefilter" where we can make sure that only .deb
packages are removed.

Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com>
---
 meta/classes/repository.bbclass | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/meta/classes/repository.bbclass b/meta/classes/repository.bbclass
index 28e712fd..42d15823 100644
--- a/meta/classes/repository.bbclass
+++ b/meta/classes/repository.bbclass
@@ -84,14 +84,11 @@ repo_del_package() {
     if [ -n "${GNUPGHOME}" ]; then
         export GNUPGHOME="${GNUPGHOME}"
     fi
-    local p=$( dpkg-deb --show --showformat '${Package}' "${file}" )
-    local a=$( dpkg-deb --show --showformat '${Architecture}' "${file}" )
-    # removing "all" means no arch
-    local aarg="-A ${a}"
-    [ "${a}" = "all" ] && aarg=""
-    reprepro -b "${dir}" --dbdir "${dbdir}" -C main ${aarg} \
-        remove "${codename}" \
-        "${p}"
+    set -- $( dpkg-deb --show --showformat '${Package} ${Architecture}' "${file}" )
+    local p="${1}" a="${2}"
+    reprepro -b "${dir}" --dbdir "${dbdir}" -C main \
+        removefilter "${codename}" \
+        'Package (= '${p}'), Architecture (= '${a}'), $PackageType (= deb)'
 }
 
 repo_contains_package() {
-- 
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-2-cedric.hombourger%40siemens.com.

  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 ` 'Cedric Hombourger' via isar-users [this message]
2024-11-22  5:48 ` [PATCH 2/3] repository: align repo_contains_package signature with other repo functions 'Cedric Hombourger' via isar-users
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-2-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