Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
for row in query:
path = row.path
- if not path.startswith("/"):
- path = os.path.join(PACKAGES_DIR, path)
-
if not path or not paths.startswith("%s/" % PAKFIRE_DIR):
log.warning("Cannot delete file outside of the tree")
continue
# Remove all logfiles
for logfile in self.logfiles:
- self.db.execute("INSERT INTO queue_delete(path) VALUES(%s)", logfile.path)
+ self.backend.delete_file(os.path.join(PACKAGES_DIR, logfile.path))
self.db.execute("DELETE FROM logfiles WHERE job_id = %s", self.id)
return pakfire.util.version_compare(self.backend, self.friendly_name, other.friendly_name) < 0
def delete(self):
- self.db.execute("INSERT INTO queue_delete(path) VALUES(%s)", self.path)
+ self.backend.delete_file(os.path.join(PACKAGES_DIR, self.path))
# Delete all files from the filelist.
self.db.execute("DELETE FROM filelists WHERE pkg_id = %s", self.id)