[elbe-devel] [PATCH] elbepack: db: remove unused method ElbeDB.save_project()

Thomas Weißschuh thomas.weissschuh at linutronix.de
Fri Feb 28 13:14:03 CET 2025


The method is unused since commit
f25818d4f449 ("elbepack: commands: drop internal buildchroot command")

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/db.py | 30 ------------------------------
 1 file changed, 30 deletions(-)

diff --git a/elbepack/db.py b/elbepack/db.py
index eb3a8c6dd123e13826ef009ad9ef531483632ce1..80105b06e14adb78023af6d20f002920ad73a9d1 100644
--- a/elbepack/db.py
+++ b/elbepack/db.py
@@ -256,36 +256,6 @@ class ElbeDB:
             if os.path.exists(chrootpath):
                 rmtree(chrootpath)      # OSError
 
-    def save_project(self, ep):
-        # TODO: Recover in case writing the XML file or commiting the
-        # database entry fails
-        project = None
-
-        with session_scope(self.session) as s:
-            try:
-                project = s.query(Project).filter(
-                    Project.builddir == ep.builddir).one()
-            except NoResultFound:
-                pass
-
-            if not os.path.exists(ep.builddir):
-                os.makedirs(ep.builddir)
-            if not os.path.isfile(ep.builddir + '/source.xml') and ep.xml:
-                ep.xml.xml.write(ep.builddir + '/source.xml')
-
-            with open(ep.builddir + '/source.xml') as xml_file:
-                xml_str = xml_file.read()
-                if not project:
-                    project = Project(name=ep.xml.text('project/name'),
-                                      version=ep.xml.text('project/version'),
-                                      builddir=ep.builddir,
-                                      xml=xml_str)
-                    s.add(project)
-                else:
-                    project.edit = datetime.utcnow()
-                    project.version = ep.xml.text('project/version')
-                    project.xml = xml_str
-
     def load_project(
             self,
             builddir,

---
base-commit: fd48f02889d0de2714489df27f43429dbe86260d
change-id: 20241118-db-cleanup-f23553952625

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



More information about the elbe-devel mailing list