From 6ca2a97f2336d1c3b14dac3cd7bd0af42376a94e Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 1 Oct 2011 16:47:07 +0200 Subject: [PATCH] Make ActionChange an alias to ActionReinstall. --- python/pakfire/actions.py | 18 ++++++++---------- python/pakfire/repository/database.py | 4 +++- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/python/pakfire/actions.py b/python/pakfire/actions.py index ee1b5275..0d714f51 100644 --- a/python/pakfire/actions.py +++ b/python/pakfire/actions.py @@ -58,7 +58,7 @@ class Action(object): @property def needs_download(self): - return self.type in ("install", "reinstall", "upgrade", "downgrade",) \ + return self.type in ("install", "reinstall", "upgrade", "downgrade", "change",) \ and not isinstance(self.pkg, packages.BinaryPackage) def download(self, text): @@ -314,6 +314,13 @@ class ActionReinstall(Action): self.pkg.extract(_("Installing"), prefix=self.pakfire.path) +class ActionChange(ActionReinstall): + """ + The change action is like the reinstall action. + """ + type = "change" + + class ActionDowngrade(Action): type = "downgrade" @@ -328,12 +335,3 @@ class ActionDowngrade(Action): self.local.add_package(self.pkg) self.pkg.extract(_("Downgrading"), prefix=self.pakfire.path) - - -class ActionChange(Action): - type = "change" - - # XXX still need to find out what this should be doing - - def run(self): - print "XXX Change: %s" % self.pkg diff --git a/python/pakfire/repository/database.py b/python/pakfire/repository/database.py index 1b3872f0..87aecd2a 100644 --- a/python/pakfire/repository/database.py +++ b/python/pakfire/repository/database.py @@ -252,7 +252,9 @@ class DatabaseLocal(Database): # Get the ID of the package in the database. c = self.cursor() - c.execute("SELECT id FROM packages WHERE uuid = ? LIMIT 1", (pkg.uuid,)) + #c.execute("SELECT id FROM packages WHERE uuid = ? LIMIT 1", (pkg.uuid,)) + c.execute("SELECT id FROM packages WHERE name = ? AND epoch = ? AND version = ?" + " AND release = ? LIMIT 1", (pkg.name, pkg.epoch, pkg.version, pkg.release,)) id = None for row in c: -- 2.39.2