@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):
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"
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
# 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: