[packagekit] packagekit: Branch 'master' - 11 commits

Richard Hughes hughsient at kemper.freedesktop.org
Fri Mar 28 10:48:18 PDT 2008


 NEWS                                    |   79 ++++++++++++++++++++++++++++++++
 TODO                                    |    2 
 backends/yum/helpers/yumBackend.py      |   16 ++++++
 backends/yum2/helpers/yumDBUSBackend.py |   13 +++++
 configure.ac                            |    2 
 docs/html/pk-download.html              |    1 
 libpackagekit/pk-common.c               |    2 
 python/packagekit/backend.py            |   32 +++++++++---
 python/packagekit/daemonBackend.py      |    9 +++
 src/pk-transaction-db.c                 |    8 ++-
 10 files changed, 151 insertions(+), 13 deletions(-)

New commits:
commit abfcda71b854040bc11801962ab1cea611bac5df
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Mar 28 17:32:37 2008 +0000

    post release version bump

diff --git a/configure.ac b/configure.ac
index eccc222..1c79ff3 100755
--- a/configure.ac
+++ b/configure.ac
@@ -1,13 +1,13 @@
 AC_PREREQ(2.52)
 
-AC_INIT(PackageKit, 0.1.10)
+AC_INIT(PackageKit, 0.1.11)
 AC_CONFIG_SRCDIR(src)
 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
 AM_CONFIG_HEADER(config.h)
 
 # Should we enable extra stuff automatically?
 # set no for release builds, yes for development builds
-DEVELOPMENT_RELEASE=no
+DEVELOPMENT_RELEASE=yes
 
 # libtool versioning - this applies to libpackagekit
 #
commit 9b865242dedbd61810ea291fb81ed5e44ab9f229
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Mar 28 17:26:55 2008 +0000

    release version 0.1.10

diff --git a/NEWS b/NEWS
index 49f69e6..e1bef77 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,82 @@
+Version 0.1.10
+~~~~~~~~~~~~~~
+Released: 2008-03-28
+
+* Backends:
+ - apt2: Allow to cancel SearchName, SearchDetails and GetUpdates (Sebastian Heinlein)
+ - apt2: Move the threaded decorator to the module (Sebastian Heinlein)
+ - apt2: Add a decorator for functions that need to lock the cache (Sebastian Heinlein)
+ - apt2: Fix the total progress bar for all actions (Sebastian Heinlein)
+ - box: Implemented backend_update_packages (Grzegorz Dabrowski)
+ - conary: Add stub for search-group (Ken VanDine)
+ - opkg: Fix search name (Thomas Wood)
+ - poldek: Add poldek backend (Marcin Banasiak)
+ - poldek: Make GetRequires and GetDepends use the filter parameter (Marcin Banasiak)
+ - poldek: Force unique package names and use the new PkFilter code (Marcin Banasiak)
+ - poldek: Add GetUpdateDetail (Marcin Banasiak)
+ - poldek: Make GetRequires use recursive for installed packages (Marcin Banasiak)
+ - poldek: Improve percentage updates in UpdatePackages (Marcin Banasiak)
+ - poldek: Don't try to update blocked package (Marcin Banasiak)
+ - smart: Get the C file compiling again (James Bowes)
+ - yum: Handle yum.Errors.GroupsError fd:#14906 (Debarshi Ray)
+ - yum: Added what-provides support (Tim Lauridsen)
+ - yum : Cleanup install_file and use code in current yum instead (Tim Lauridsen)
+ - yum2: Use the forked decorator in more places (Sebastian Heinlein)
+ - yum2: Send INFO_BLOCKED signal for packages that were not updated (Robin Norwood)
+ - yum2: Add UpdatePackages method for future use (Robin Norwood)
+ - yum2: Maybe implement cancel correctly (Robin Norwood)
+ - yum2: Reset progress bar so percentage feedback is correct (Robin Norwood)
+ - yum2: Make InstallFile bail out on a src.rpm (Tim Lauridsen)
+ - yum2: Fix Cancel() action (Robin Norwood)
+ - yum2: What-provides (Robin Norwood)
+ - yum(2): Handle problem with getting repo data in a better way (Tim Lauridsen)
+ - yum(2): Make install-file send a message if a newer file exits (Tim Lauridsen)
+ - yum(2): Emit dep-resolve when doing dep resolving (James Bowes)
+ - yum(2): Use status enum TEST_COMMIT and SIG_CHECK (Richard Hughes)
+ - zypp: Update zypp status and fix crash (Scott Reeves)
+ - zypp: GetRequires is now also usable for uninstalled packages (Stefan Haas)
+ - zypp: Added GetUpdateDetail (Stefan Haas)
+ - zypp: Changed opensuse to real vendor of the package (Stefan Haas)
+ - zypp: Unitized commit process and added Update System (Stefan Haas)
+ - zypp: Changed install-algorithm and connected KeyRing-Callback (Stefan Haas)
+ - zypp: Require new libzypp 4.6 (Scott Reeves)
+ - zypp: Remove the description causing markup parse errors (Scott Reeves)
+ - zypp: Added update_packages (Stefan Haas)
+ - zypp: Added what-provides (Stefan Haas)
+
+* New features:
+ - Don't queue StateHaschanged to fix rh:436840 (Richard Hughes)
+ - Disable the cron script by default (Richard Hughes)
+ - Use G_GNUC_WARN_UNUSED_RESULT to find a few bugs in the daemon (Richard Hughes)
+ - Document PkClient with gtk-doc (Richard Hughes)
+ - Don't queue duplicate GetUpdates in the daemon (Richard Hughes)
+ - Add a filter parameter to GetRequires and GetDepends to fix fd:14838 (Richard Hughes)
+ - Use the backend user in the dbus configuration files (Sebastian Heinlein)
+ - Add a sensible error for installing source packages (Richard Hughes)
+ - Add another status enum so we can do the 'waiting' UI elements better (Richard Hughes)
+ - Increase speed of pk-import-desktop by an order of magnitude (Richard Hughes)
+ - Log to a file if we have TransactionLogging specified (Richard Hughes)
+ - Add PackageKitThread class which enhances the Thread class (Sebastian Heinlein)
+ - Make pkcon when we have multiple possible packages (Richard Hughes)
+ - Make libpackagekit force WAIT when the transaction is queued (Richard Hughes)
+ - Turn UpdatePackage() into UpdatePackages() - this allows coolness (Richard Hughes)
+ - Add RepoListChanged when a repo is added, removed or changed (Richard Hughes)
+
+* Bugfixes:
+ - Fix segmentation fault in pk-import-desktop fd:14920 (Debarshi Ray)
+ - Changed signal PK_BACKEND_REPO_SIGNATURE_REQUIRED to avoid a segfault (Stefan Haas)
+ - Don't SIGABRT when trying to run a second instance of the daemon (Richard Hughes)
+ - Protect pk_strsafe against NULL text (Thomas Wood)
+ - Fix many sparse warnings and small memory leaks (Richard Hughes)
+ - Backend Unicode handling improvements (Luke Macken)
+ - Remove the stderr path for the backends as they sometimes get unsynchronised (Richard Hughes)
+ - Fix bashisms in autogen.sh (Alex Converse)
+ - Fix so that authentication requirements are consistent (Robin Norwood)
+ - Add --enable-developer to fix developer warnings rh:439216 (Richard Hughes)
+ - Only enable time remaining calculations it if PK_IS_DEVELOPER is set (Richard Hughes)
+ - Don't set the STATUS_CANCEL state in the backend, do it in the runner (Richard Hughes)
+ - Manually flush the output rather than relying on python to do it for us (Richard Hughes)
+
 Version 0.1.9
 ~~~~~~~~~~~~~
 Released: 2008-03-04
diff --git a/configure.ac b/configure.ac
index 63fa4db..eccc222 100755
--- a/configure.ac
+++ b/configure.ac
@@ -7,7 +7,7 @@ AM_CONFIG_HEADER(config.h)
 
 # Should we enable extra stuff automatically?
 # set no for release builds, yes for development builds
-DEVELOPMENT_RELEASE=yes
+DEVELOPMENT_RELEASE=no
 
 # libtool versioning - this applies to libpackagekit
 #
diff --git a/docs/html/pk-download.html b/docs/html/pk-download.html
index 33da53c..038dcec 100644
--- a/docs/html/pk-download.html
+++ b/docs/html/pk-download.html
@@ -58,6 +58,7 @@ Released versions are found on
 <tr><td>0.1.7</td><td></td><td>2008-02-14</td></tr>
 <tr><td>0.1.8</td><td></td><td>2008-02-21</td></tr>
 <tr><td>0.1.9</td><td></td><td>2008-03-04</td></tr>
+<tr><td>0.1.10</td><td></td><td>2008-03-28</td></tr>
 </table>
 
 <h2>Dependencies</h2>
commit 74e0cb4d6cff2208fbd42743a0069c8e537c29bc
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Mar 28 17:02:34 2008 +0000

    update TODO

diff --git a/TODO b/TODO
index 7ada72e..5c6dadd 100644
--- a/TODO
+++ b/TODO
@@ -8,6 +8,8 @@ Order of no particular importance:
 
 * Find out why yum doesn't output some package status calls.
 
+* Make PkMessages into proper erumerated types with localised descriptions
+
 * We need to make sure the html documentation is still correct and easy
 to read - does any of it sound like technobabble? Is it easy enough for
 developers to get detailed information about how to contribute?
commit 02c8fd68a96cf5f5aece013afee94ecbb1e5752c
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Mar 28 16:44:18 2008 +0000

    error out if the database cannot be opened, and be more paranoid about sqlite status

diff --git a/src/pk-transaction-db.c b/src/pk-transaction-db.c
index 635b4c5..37a770b 100644
--- a/src/pk-transaction-db.c
+++ b/src/pk-transaction-db.c
@@ -192,6 +192,7 @@ pk_transaction_db_sql_statement (PkTransactionDb *tdb, const gchar *sql)
 
 	g_return_val_if_fail (tdb != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_TRANSACTION_DB (tdb), FALSE);
+	g_return_val_if_fail (tdb->priv->db != NULL, FALSE);
 
 	pk_debug ("statement=%s", sql);
 	rc = sqlite3_exec (tdb->priv->db, sql, pk_transaction_sqlite_callback, tdb, &error_msg);
@@ -241,6 +242,7 @@ pk_transaction_db_action_time_since (PkTransactionDb *tdb, PkRoleEnum role)
 
 	g_return_val_if_fail (tdb != NULL, 0);
 	g_return_val_if_fail (PK_IS_TRANSACTION_DB (tdb), 0);
+	g_return_val_if_fail (tdb->priv->db != NULL, FALSE);
 
 	role_text = pk_role_enum_to_text (role);
 	pk_debug ("get_time_since_action=%s", role_text);
@@ -280,6 +282,7 @@ pk_transaction_db_action_time_reset (PkTransactionDb *tdb, PkRoleEnum role)
 
 	g_return_val_if_fail (tdb != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_TRANSACTION_DB (tdb), FALSE);
+	g_return_val_if_fail (tdb->priv->db != NULL, FALSE);
 
 	timespec = pk_iso8601_present ();
 	role_text = pk_role_enum_to_text (role);
@@ -449,6 +452,7 @@ pk_transaction_db_empty (PkTransactionDb *tdb)
 
 	g_return_val_if_fail (tdb != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_TRANSACTION_DB (tdb), FALSE);
+	g_return_val_if_fail (tdb->priv->db != NULL, FALSE);
 
 	statement = "TRUNCATE TABLE transactions;";
 	sqlite3_exec (tdb->priv->db, statement, NULL, NULL, NULL);
@@ -468,6 +472,7 @@ pk_transaction_db_create_table_last_action (PkTransactionDb *tdb)
 
 	g_return_val_if_fail (tdb != NULL, FALSE);
 	g_return_val_if_fail (PK_IS_TRANSACTION_DB (tdb), FALSE);
+	g_return_val_if_fail (tdb->priv->db != NULL, FALSE);
 
 	timespec = pk_iso8601_present ();
 	statement = "CREATE TABLE last_action (role TEXT primary key, timespec TEXT);";
@@ -497,6 +502,7 @@ pk_transaction_db_init (PkTransactionDb *tdb)
 	g_return_if_fail (PK_IS_TRANSACTION_DB (tdb));
 
 	tdb->priv = PK_TRANSACTION_DB_GET_PRIVATE (tdb);
+	tdb->priv->db = NULL;
 
 	/* if the database file was not installed (or was nuked) recreate it */
 	create_file = g_file_test (PK_TRANSACTION_DB_FILE, G_FILE_TEST_EXISTS);
@@ -504,8 +510,8 @@ pk_transaction_db_init (PkTransactionDb *tdb)
 	pk_debug ("trying to open database '%s'", PK_TRANSACTION_DB_FILE);
 	rc = sqlite3_open (PK_TRANSACTION_DB_FILE, &tdb->priv->db);
 	if (rc) {
-		pk_warning ("Can't open database: %s\n", sqlite3_errmsg (tdb->priv->db));
 		sqlite3_close (tdb->priv->db);
+		pk_error ("Can't open database: %s\n", sqlite3_errmsg (tdb->priv->db));
 		return;
 	} else {
 		if (create_file == FALSE) {
commit 7a511c04855d641db8252d1c6e29b140e8d7d7d6
Merge: 768567c... a83ece6...
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Mar 28 16:18:21 2008 +0000

    Merge branch 'master' of git+ssh://hughsie@git.packagekit.org/srv/git/PackageKit

commit a83ece6d32f9d0bcd5d963760d88034c73efdb21
Author: Luke Macken <lmacken at redhat.com>
Date:   Fri Mar 28 12:17:19 2008 -0400

    Fix the yum backends customTracebackHandler similar to c0f0c59c4bdd1ec6c087ea6ec80cdf69906bdb09

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 6060fa0..159601d 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -1237,8 +1237,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         to packagekit.
         Overload this method if you what handle special Tracebacks
         '''
-        tbType = type(tb)
-        if tbType in [type(yum.Errors.RepoError),type(IOError)] :
+        if issubclass(tb, (yum.Errors.RepoError, IOError)):
             # Unhandled Repo error, can be network problems
             self.error(ERROR_NO_NETWORK,"Problem with loading repository metadata, this can be caused by network problems or repository misconfigurations")
             return True
commit 768567c124e2f5787a44884467b0dad5750b3599
Merge: 54346ed... c0f0c59...
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Mar 28 13:50:16 2008 +0000

    Merge branch 'master' of git+ssh://hughsie@git.packagekit.org/srv/git/PackageKit

commit c0f0c59c4bdd1ec6c087ea6ec80cdf69906bdb09
Author: Tim Lauridsen <timlau at fedoraproject.org>
Date:   Fri Mar 28 14:25:15 2008 +0100

    yum2: handle problem with getting repo data in a better way

diff --git a/backends/yum2/helpers/yumDBUSBackend.py b/backends/yum2/helpers/yumDBUSBackend.py
index bbd8be8..626d44e 100755
--- a/backends/yum2/helpers/yumDBUSBackend.py
+++ b/backends/yum2/helpers/yumDBUSBackend.py
@@ -1826,6 +1826,19 @@ class PackageKitYumBackend(PackageKitBaseBackend):
 # Other utility methods
 #
 
+    def _customTracebackHandler(self,exctype):
+        '''
+        Handle special not catched Tracebacks
+        '''
+        # Handle misc errors with loading repository metadata
+        if (issubclass(exctype, yum.Errors.RepoError) or
+            issubclass(exctype, IOError)):
+            self.ErrorCode(ERROR_NO_NETWORK, "Problem with loading repository metadata, this can be caused by network problems or repository misconfigurations")
+            self.Finished(EXIT_FAILED)
+            return True
+        else:
+            return False
+
     def _check_init(self):
         ''' Check if yum has setup, else call init '''
         if hasattr(self,'yumbase'):
diff --git a/python/packagekit/daemonBackend.py b/python/packagekit/daemonBackend.py
index c9dedc6..b4f1aa1 100644
--- a/python/packagekit/daemonBackend.py
+++ b/python/packagekit/daemonBackend.py
@@ -868,6 +868,12 @@ class PackageKitBaseBackend(dbus.service.Object):
 
         return True
 
+    def _customTracebackHandler(self,exctype):
+        '''
+
+        '''
+        return False
+
     def _excepthook(self, exctype, excvalue, exctb):
         '''
         Handle a crash: try to submit the message to packagekitd and the logger.
@@ -876,6 +882,9 @@ class PackageKitBaseBackend(dbus.service.Object):
         if (issubclass(exctype, KeyboardInterrupt) or
             issubclass(exctype, SystemExit)):
             return
+        if self._customTracebackHandler(exctype):
+            return
+
         tbtext = ''.join(traceback.format_exception(exctype, excvalue, exctb))
         try:
             self.ErrorCode(ERROR_INTERNAL_ERROR, tbtext)
commit 4e52ef49a565a15e8210c0853f20158c2bf5c146
Author: Ken VanDine <ken at vandine.org>
Date:   Fri Mar 28 09:23:42 2008 -0400

    Don't filter out \# and |, we need those in the conary backend

diff --git a/libpackagekit/pk-common.c b/libpackagekit/pk-common.c
index b8b23ad..9279af3 100644
--- a/libpackagekit/pk-common.c
+++ b/libpackagekit/pk-common.c
@@ -117,11 +117,9 @@ pk_strvalidate_char (gchar item)
 	case ']':
 	case '{':
 	case '}':
-	case '#':
 	case '\\':
 	case '<':
 	case '>':
-	case '|':
 		return FALSE;
 	}
 	return TRUE;
commit 54346ed145d9cf4886f39cdf0fd66febeb42742b
Merge: ebd3c58... 6db41bf...
Author: Richard Hughes <richard at hughsie.com>
Date:   Fri Mar 28 13:21:32 2008 +0000

    Merge branch 'master' of git+ssh://hughsie@git.packagekit.org/srv/git/PackageKit

commit 6db41bf10f9605d2b9a784229fd07b247d5bc7a7
Author: Tim Lauridsen <timlau at fedoraproject.org>
Date:   Fri Mar 28 14:00:03 2008 +0100

    yum: handle problem with getting repo data in a better way

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 755d4c1..6060fa0 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -1228,6 +1228,23 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         self.dnlCallback = DownloadCallback(self,showNames=True)  # Download callback
         self.yumbase.repos.setProgressBar( self.dnlCallback )     # Setup the download callback class
 
+    def customTracebackHandler(self,tb):
+        '''
+        Custom Traceback Handler
+        this is called by the ExceptionHandler
+        return True if the exception is handled in the method.
+        return False if to do the default action an signal an error
+        to packagekit.
+        Overload this method if you what handle special Tracebacks
+        '''
+        tbType = type(tb)
+        if tbType in [type(yum.Errors.RepoError),type(IOError)] :
+            # Unhandled Repo error, can be network problems
+            self.error(ERROR_NO_NETWORK,"Problem with loading repository metadata, this can be caused by network problems or repository misconfigurations")
+            return True
+        else: # Do the default stuff
+            return False
+
 class DownloadCallback( BaseMeter ):
     """ Customized version of urlgrabber.progress.BaseMeter class """
     def __init__(self,base,showNames = False):
diff --git a/python/packagekit/backend.py b/python/packagekit/backend.py
index 933231e..66fcdd8 100644
--- a/python/packagekit/backend.py
+++ b/python/packagekit/backend.py
@@ -440,6 +440,17 @@ class PackageKitBaseBackend:
         '''
         self.error(ERROR_NOT_SUPPORTED,"This function is not implemented in this backend")
 
+    def customTracebackHandler(self,tb):
+        '''
+        Custom Traceback Handler
+        this is called by the ExceptionHandler
+        return True if the exception is handled in the method.
+        return False if to do the default action an signal an error
+        to packagekit.
+        Overload this method if you what handle special Tracebacks
+        '''
+        return False
+
 class PackagekitProgress:
     '''
     Progress class there controls the total progress of a transaction
@@ -522,18 +533,21 @@ class PackagekitProgress:
         incr = int(f*deltapct)
         self.percent = startpct + incr
 
+
 def exceptionHandler(typ, value, tb, base):
     # Restore original exception handler
     sys.excepthook = sys.__excepthook__
-    etb = traceback.extract_tb(tb)
-    errmsg = 'Error Type: %s;' % str(typ)
-    errmsg += 'Error Value: %s;' % str(value)
-    for tub in etb:
-        f,l,m,c = tub # file,lineno, function, codeline
-        errmsg += '  File : %s , line %s, in %s;' % (f,str(l),m)
-        errmsg += '    %s;' % c
-    # send the traceback to PackageKit
-    base.error(ERROR_INTERNAL_ERROR,errmsg,exit=True)
+    # Call backend custom Traceback handler
+    if not base.customTracebackHandler(typ):
+        etb = traceback.extract_tb(tb)
+        errmsg = 'Error Type: %s;' % str(typ)
+        errmsg += 'Error Value: %s;' % str(value)
+        for tub in etb:
+            f,l,m,c = tub # file,lineno, function, codeline
+            errmsg += '  File : %s , line %s, in %s;' % (f,str(l),m)
+            errmsg += '    %s;' % c
+        # send the traceback to PackageKit
+        base.error(ERROR_INTERNAL_ERROR,errmsg,exit=True)
 
 
 def installExceptionHandler(base):



More information about the PackageKit mailing list