[elbe-devel] [PATCH 05/17] elbepack: projectmanager: drop unused function set_current_project_postbuild
Thomas Weißschuh
thomas.weissschuh at linutronix.de
Fri Jul 19 13:30:56 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 | 29 -----------------------------
elbepack/projectmanager.py | 7 -------
2 files changed, 36 deletions(-)
diff --git a/elbepack/db.py b/elbepack/db.py
index ae7a67bb27c1..da7914e8d0e6 100644
--- a/elbepack/db.py
+++ b/elbepack/db.py
@@ -148,35 +148,6 @@ class ElbeDB:
return ProjectData(p)
- def set_postbuild(self, builddir, postbuild_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(
- 'cannot set postbuild file while project '
- f'{builddir} is busy')
-
- p.edit = datetime.utcnow()
-
- with open(builddir + '/postbuild.sh', 'w') as dst:
- copyfileobj(postbuild_file, dst)
-
- os.chmod(builddir + '/postbuild.sh', 0o755)
- dos2unix(builddir + '/postbuild.sh')
-
- return _update_project_file(s, builddir,
- 'postbuild.sh', 'application/sh', 'postbuild script')
-
def set_savesh(self, builddir, savesh_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 f43acbc0907d..f6daa726ca45 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_postbuild(self, userid, postbuild_file):
- with self.lock:
- ep = self._get_current_project(userid, allow_busy=False)
-
- f = self.db.set_postbuild(ep.builddir, postbuild_file)
- ep.postbuild_file = f
-
def set_current_project_savesh(self, userid, savesh_file):
with self.lock:
ep = self._get_current_project(userid, allow_busy=False)
--
2.45.2
More information about the elbe-devel
mailing list