[elbe-devel] [PATCH 06/17] elbepack: projectmanager: drop unused function set_current_project_savesh

Thomas Weißschuh thomas.weissschuh at linutronix.de
Fri Jul 19 13:30:57 CEST 2024


This function is never used, so delete it.
Also propagate the deletion to other components which are now unused.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/db.py             | 33 ---------------------------------
 elbepack/projectmanager.py |  7 -------
 2 files changed, 40 deletions(-)

diff --git a/elbepack/db.py b/elbepack/db.py
index da7914e8d0e6..c1afaf612e58 100644
--- a/elbepack/db.py
+++ b/elbepack/db.py
@@ -148,39 +148,6 @@ class ElbeDB:
 
             return ProjectData(p)
 
-    def set_savesh(self, builddir, savesh_file):
-        if not os.path.exists(builddir):
-            raise ElbeDBError('project directory does not exist')
-
-        with session_scope(self.session) as s:
-            p = None
-            try:
-                p = s.query(Project). \
-                    filter(Project.builddir == builddir).one()
-            except NoResultFound:
-                raise ElbeDBError(
-                    f'project {builddir} is not registered in the database')
-
-            if p.status == 'busy':
-                raise ElbeDBError(
-                    f'cannot set savesh file while project {builddir} is busy')
-
-            p.edit = datetime.utcnow()
-            if p.status == 'empty_project' or p.status == 'build_failed':
-                p.status = 'needs_build'
-            elif p.status == 'build_done':
-                p.status = 'has_changes'
-
-            with open(builddir + '/save.sh', 'w') as dst:
-                copyfileobj(savesh_file, dst)
-
-            os.chmod(builddir + '/save.sh', 0o755)
-            dos2unix(builddir + '/save.sh')
-
-            return _update_project_file(
-                s, builddir,
-                'save.sh', 'application/sh', 'version save script')
-
     def set_presh(self, builddir, presh_file):
         if not os.path.exists(builddir):
             raise ElbeDBError('project directory does not exist')
diff --git a/elbepack/projectmanager.py b/elbepack/projectmanager.py
index f6daa726ca45..76bbabe00f11 100644
--- a/elbepack/projectmanager.py
+++ b/elbepack/projectmanager.py
@@ -177,13 +177,6 @@ class ProjectManager:
             # Make db reload the xml file
             self.db.set_xml(ep.builddir, None)
 
-    def set_current_project_savesh(self, userid, savesh_file):
-        with self.lock:
-            ep = self._get_current_project(userid, allow_busy=False)
-
-            f = self.db.set_savesh(ep.builddir, savesh_file)
-            ep.savesh_file = f
-
     def set_current_project_presh(self, userid, presh_file):
         with self.lock:
             ep = self._get_current_project(userid, allow_busy=False)

-- 
2.45.2



More information about the elbe-devel mailing list