]> git.ipfire.org Git - pakfire.git/commitdiff
Make ActionChange an alias to ActionReinstall.
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 1 Oct 2011 14:47:07 +0000 (16:47 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 1 Oct 2011 14:47:07 +0000 (16:47 +0200)
python/pakfire/actions.py
python/pakfire/repository/database.py

index ee1b5275b54e0c15320576e7f167b541043d9376..0d714f51b9f5f35a4afc625ec41252de8ac1a384 100644 (file)
@@ -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
index 1b3872f02d8f324b788a501e61b58bf57ae68a4a..87aecd2a1ee52fc90486a165d3d3587292c901e4 100644 (file)
@@ -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: