Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Fredrik Gustafsson" <fredrik.gustafsson@axis.com>
To: <openembedded-core@lists.openembedded.org>
Cc: <tools-cfpbuild-internal@axis.com>, <hugo.cedervall@axis.com>,
	Fredrik Gustafsson <fredrigu@axis.com>
Subject: [PATCH v2 19/26] package_manager.py: Move RpmIndexer
Date: Thu, 25 Jun 2020 12:21:38 +0200	[thread overview]
Message-ID: <20200625102145.7139-20-fredrigu@axis.com> (raw)
In-Reply-To: <20200625102145.7139-1-fredrigu@axis.com>

Let the code that is only used by rpm package manager live in that
package manager owned directory.

Signed-off-by: Fredrik Gustafsson <fredrigu@axis.com>
---
 meta/lib/oe/package_manager.py                | 36 -------------------
 .../package_managers/rpm/package_manager.py   | 36 +++++++++++++++++++
 2 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 542f4ed3c4..b4d1a20bd6 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -150,42 +150,6 @@ class Indexer(object, metaclass=ABCMeta):
         pass
 
 
-class RpmIndexer(Indexer):
-    def write_index(self):
-        self.do_write_index(self.deploy_dir)
-
-    def do_write_index(self, deploy_dir):
-        if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
-            signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND'))
-        else:
-            signer = None
-
-        createrepo_c = bb.utils.which(os.environ['PATH'], "createrepo_c")
-        result = create_index("%s --update -q %s" % (createrepo_c, deploy_dir))
-        if result:
-            bb.fatal(result)
-
-        # Sign repomd
-        if signer:
-            sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE')
-            is_ascii_sig = (sig_type.upper() != "BIN")
-            signer.detach_sign(os.path.join(deploy_dir, 'repodata', 'repomd.xml'),
-                               self.d.getVar('PACKAGE_FEED_GPG_NAME'),
-                               self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE'),
-                               armor=is_ascii_sig)
-
-class RpmSubdirIndexer(RpmIndexer):
-    def write_index(self):
-        bb.note("Generating package index for %s" %(self.deploy_dir))
-        self.do_write_index(self.deploy_dir)
-        for entry in os.walk(self.deploy_dir):
-            if os.path.samefile(self.deploy_dir, entry[0]):
-                for dir in entry[1]:
-                    if dir != 'repodata':
-                        dir_path = oe.path.join(self.deploy_dir, dir)
-                        bb.note("Generating package index for %s" %(dir_path))
-                        self.do_write_index(dir_path)
-
 class OpkgIndexer(Indexer):
     def write_index(self):
         arch_vars = ["ALL_MULTILIB_PACKAGE_ARCHS",
diff --git a/meta/lib/oe/package_managers/rpm/package_manager.py b/meta/lib/oe/package_managers/rpm/package_manager.py
index 306c3336ca..025e8cdfd2 100644
--- a/meta/lib/oe/package_managers/rpm/package_manager.py
+++ b/meta/lib/oe/package_managers/rpm/package_manager.py
@@ -360,4 +360,40 @@ class PkgPM(PackageManager):
 
         return tmp_dir
 
+class RpmIndexer(Indexer):
+    def write_index(self):
+        self.do_write_index(self.deploy_dir)
+
+    def do_write_index(self, deploy_dir):
+        if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
+            signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND'))
+        else:
+            signer = None
+
+        createrepo_c = bb.utils.which(os.environ['PATH'], "createrepo_c")
+        result = create_index("%s --update -q %s" % (createrepo_c, deploy_dir))
+        if result:
+            bb.fatal(result)
+
+        # Sign repomd
+        if signer:
+            sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE')
+            is_ascii_sig = (sig_type.upper() != "BIN")
+            signer.detach_sign(os.path.join(deploy_dir, 'repodata', 'repomd.xml'),
+                               self.d.getVar('PACKAGE_FEED_GPG_NAME'),
+                               self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE'),
+                               armor=is_ascii_sig)
+
+class RpmSubdirIndexer(RpmIndexer):
+    def write_index(self):
+        bb.note("Generating package index for %s" %(self.deploy_dir))
+        self.do_write_index(self.deploy_dir)
+        for entry in os.walk(self.deploy_dir):
+            if os.path.samefile(self.deploy_dir, entry[0]):
+                for dir in entry[1]:
+                    if dir != 'repodata':
+                        dir_path = oe.path.join(self.deploy_dir, dir)
+                        bb.note("Generating package index for %s" %(dir_path))
+                        self.do_write_index(dir_path)
+
 
-- 
2.20.1


  parent reply	other threads:[~2020-06-25 10:22 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-25 10:21 Add package managers as a plugin Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 01/26] nopackages.bbclass: Get tasks from variable Fredrik Gustafsson
2020-06-25 10:41   ` [OE-core] " Paul Barker
2020-06-25 10:21 ` [PATCH v2 02/26] package_managers: Add directory structure Fredrik Gustafsson
2020-06-25 10:41   ` [OE-core] " Paul Barker
2020-06-25 10:21 ` [PATCH v2 03/26] manifest: Move RpmManifest Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 04/26] manifest: Move DpkgManifest Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 05/26] manifest: Move OpkgManifest Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 06/26] manifest.py: Dynamic load of manifest Fredrik Gustafsson
2020-06-25 10:41   ` [OE-core] " Paul Barker
2020-06-25 10:21 ` [PATCH v2 07/26] sdk.py: Move RpmSdk Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 08/26] sdk.py: Move DpkgSdk Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 09/26] sdk.py: Move OpkgSdk Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 10/26] sdk.py: Dynamic load of sdk Fredrik Gustafsson
2020-06-25 10:41   ` [OE-core] " Paul Barker
2020-06-25 10:21 ` [PATCH v2 11/26] rootfs.py: Move RpmRootfs Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 12/26] rootfs.py: Move DpkgRootfs Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 13/26] rootfs.py: Move OpkgRootfs Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 14/26] rootfs.py: Dynamic load of rootfs Fredrik Gustafsson
2020-06-25 10:42   ` [OE-core] " Paul Barker
2020-06-25 10:21 ` [PATCH v2 15/26] package_manager.py: Move RpmPM Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 16/26] package_manager.py: Move DpkgPM Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 17/26] package_manager.py: Move OpkgPM Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 18/26] package_manager: Rename RpmPM to PkgPM, etc Fredrik Gustafsson
2020-06-25 10:42   ` [OE-core] " Paul Barker
2020-06-25 10:21 ` Fredrik Gustafsson [this message]
2020-06-25 10:21 ` [PATCH v2 20/26] package_manager.py: Move OpkgIndexer Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 21/26] package_manager.py: Move DpkgIndexer Fredrik Gustafsson
2020-06-25 10:42   ` [OE-core] " Paul Barker
2020-06-25 10:21 ` [PATCH v2 22/26] package_manager: Rename Indexer classes Fredrik Gustafsson
2020-06-25 10:42   ` [OE-core] " Paul Barker
2020-06-25 10:21 ` [PATCH v2 23/26] package_manager.py: Move RpmPkgsList Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 24/26] package_manager.py: Move OpkgPkgsList Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 25/26] package_manager.py: Move DpkgPkgsList Fredrik Gustafsson
2020-06-25 10:21 ` [PATCH v2 26/26] package_manager: Rename PkgsList classes Fredrik Gustafsson
2020-06-25 10:43   ` [OE-core] " Paul Barker
2020-06-25 10:40 ` [OE-core] Add package managers as a plugin Paul Barker
2020-06-30 18:39   ` Fredrik Gustafsson

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=20200625102145.7139-20-fredrigu@axis.com \
    --to=fredrik.gustafsson@axis.com \
    --cc=fredrigu@axis.com \
    --cc=hugo.cedervall@axis.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=tools-cfpbuild-internal@axis.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