Signed-off-by: Mark Hymers <mhy@debian.org>
chg = u.pkg.add_known_changes(holding.holding_dir, session=session)
u.accept(summary, short_summary, session)
u.check_override()
+ chg.clean_from_queue()
session.commit()
u.remove()
elif answer == 'P':
Logger.log(["total", summarystats.accept_count, summarystats.accept_bytes])
if not Options["No-Action"]:
+ # Clean out the queue files
+ session = DBConn().session()
+ session.execute("DELETE FROM changes_pending_files WHERE id NOT IN (SELECT file_id FROM changes_pending_files_map )")
+ session.commit()
+
if log_urgency:
UrgencyLog().close()
Logger.close()
def __repr__(self):
return '<DBChange %s>' % self.changesname
+ def clean_from_queue(self):
+ session = DBConn().session().object_session(self)
+
+ # Remove changes_pool_files entries
+ for pf in self.poolfiles:
+ self.poolfiles.remove(pf)
+
+ # Remove change
+ for cf in self.files:
+ self.files.remove(cf)
+
+ # Clear out of queue
+ self.in_queue = None
+ self.approved_for_id = None
+
__all__.append('DBChange')
@session_wrapper