[elbe-devel] [PATCH] elbepack: drop components from reprepro removesrc

Thomas Weißschuh thomas.weissschuh at linutronix.de
Tue Apr 16 11:00:37 CEST 2024


Newer versions of reprepro complain about "--component" with
"removesrc", drop it.

    [CMD] reprepro --basedir /var/cache/elbe/018ee225-510f-787d-bda0-9f7a8fa3633e/srcrepo-target --component "target" removesrc bullseye e2fsprogs
    Action 'removesrc' cannot be restricted to a component!
    neither --component nor -C make sense here.
    To ignore use --ignore=unusedoption.
    There have been errors!
    [ERROR]Build failed

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/repomanager.py | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/elbepack/repomanager.py b/elbepack/repomanager.py
index 9e617374dd0e..67d2f679225a 100644
--- a/elbepack/repomanager.py
+++ b/elbepack/repomanager.py
@@ -248,34 +248,27 @@ class RepoBase:
     def removedeb(self, pkgname, components=None):
         self._removedeb(pkgname, self.repo_attr.codename, components)
 
-    def _removesrc(self, srcname, codename, components=None):
+    def _removesrc(self, srcname, codename):
 
         global_opt = [f'--basedir {self.fs.path}']
 
-        if components is not None:
-            # Compatibility with old callers
-            if isinstance(components, str):
-                components = [components]
-            global_opt.append(f'--component "{"|".join(components)}"')
-
         global_opt = ' '.join(global_opt)
 
         do(f'reprepro {global_opt} removesrc {codename} {srcname}',
            env_add={'GNUPGHOME': '/var/cache/elbe/gnupg'})
 
-    def removesrc(self, path, components=None):
+    def removesrc(self, path):
         with open(path) as fp:
             for p in Deb822.iter_paragraphs(fp):
                 if 'Source' in p:
                     self._removesrc(p['Source'],
-                                    self.repo_attr.codename,
-                                    components)
+                                    self.repo_attr.codename)
 
     def _remove(self, path, codename, components=None):
         with open(path) as fp:
             for p in Deb822.iter_paragraphs(fp):
                 if 'Source' in p:
-                    self._removesrc(p['Source'], codename, components)
+                    self._removesrc(p['Source'], codename)
                 elif 'Package' in p:
                     self._removedeb(p['Package'], codename, components)
                 elif 'Binary' in p:
@@ -318,7 +311,7 @@ class RepoBase:
                 # different md5 already.
                 #
                 # Try remove, and add again.
-                self.removesrc(path, components)
+                self.removesrc(path)
                 self._includedsc(path, self.repo_attr.codename, components)
             else:
                 raise ce

---
base-commit: 374d9f7e4f41fe701af10b02c7c111a7ff32bc8b
change-id: 20240415-removesrc-1c4c72d575f0

Best regards,
-- 
Thomas Weißschuh <thomas.weissschuh at linutronix.de>



More information about the elbe-devel mailing list