[PackageKit-commit] packagekit: Branch 'master' - 21 commits

Richard Hughes hughsient at kemper.freedesktop.org
Tue Apr 22 13:44:12 PDT 2008


 backends/alpm/pk-backend-alpm.c    |    5 
 backends/box/pk-backend-box.c      |    4 
 backends/yum/helpers/yumBackend.py |   29 +++
 backends/zypp/pk-backend-zypp.cpp  |  319 ++++++++++++++++++++++++++-----------
 contrib/gnome-packagekit.spec.in   |   38 ----
 docs/html/pk-faq.html              |   15 +
 docs/spec/pk-concepts.xml          |   10 +
 libpackagekit/pk-client.c          |   11 +
 libpackagekit/pk-enum.c            |  265 +++++++++++++++---------------
 libpackagekit/pk-enum.h            |    5 
 src/pk-backend-spawn.c             |    1 
 tools/add-error-enum.sh            |    2 
 12 files changed, 431 insertions(+), 273 deletions(-)

New commits:
commit 66bf3e0ce3babcd3a8c726be77d919c3bf624f61
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Apr 22 21:43:02 2008 +0100

    continue my tirade against space delimited tabs

diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index 152a33b..a635a74 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -278,129 +278,129 @@ static PkEnumMatch enum_provides[] = {
 };
 
 static PkEnumMatch enum_free_licenses[] = {
-	{PK_LICENSE_ENUM_UNKNOWN,              "unknown"},	/* fall though value */
-	{PK_LICENSE_ENUM_GLIDE,                "Glide"},
-	{PK_LICENSE_ENUM_AFL,                  "AFL"},
-	{PK_LICENSE_ENUM_AMPAS_BSD,            "AMPAS BSD"},
-	{PK_LICENSE_ENUM_AMAZON_DSL,           "ADSL"},
-	{PK_LICENSE_ENUM_ADOBE,                "Adobe"},
-	{PK_LICENSE_ENUM_AGPLV1,               "AGPLv1"},
-	{PK_LICENSE_ENUM_AGPLV3,               "AGPLv3"},
-	{PK_LICENSE_ENUM_ASL_1_DOT_0,          "ASL 1.0"},
-	{PK_LICENSE_ENUM_ASL_1_DOT_1,          "ASL 1.1"},
-	{PK_LICENSE_ENUM_ASL_2_DOT_0,          "ASL 2.0"},
-	{PK_LICENSE_ENUM_APSL_2_DOT_0,         "APSL 2.0"},
-	{PK_LICENSE_ENUM_ARTISTIC_CLARIFIED,   "Artistic clarified"},
-	{PK_LICENSE_ENUM_ARTISTIC_2_DOT_0,     "Artistic 2.0"},
-	{PK_LICENSE_ENUM_ARL,                  "ARL"},
-	{PK_LICENSE_ENUM_BITTORRENT,           "BitTorrent"},
-	{PK_LICENSE_ENUM_BOOST,                "Boost"},
-	{PK_LICENSE_ENUM_BSD_WITH_ADVERTISING, "BSD with advertising"},
-	{PK_LICENSE_ENUM_BSD,                  "BSD"},
-	{PK_LICENSE_ENUM_CECILL,               "CeCILL"},
-	{PK_LICENSE_ENUM_CDDL,                 "CDDL"},
-	{PK_LICENSE_ENUM_CPL,                  "CPL"},
-	{PK_LICENSE_ENUM_CONDOR,               "Condor"},
-	{PK_LICENSE_ENUM_COPYRIGHT_ONLY,       "Copyright only"},
-	{PK_LICENSE_ENUM_CRYPTIX,              "Cryptix"},
-	{PK_LICENSE_ENUM_CRYSTAL_STACKER,      "Crystal Stacker"},
-	{PK_LICENSE_ENUM_DOC,                  "DOC"},
-	{PK_LICENSE_ENUM_WTFPL,                "WTFPL"},
-	{PK_LICENSE_ENUM_EPL,                  "EPL"},
-	{PK_LICENSE_ENUM_ECOS,                 "eCos"},
-	{PK_LICENSE_ENUM_EFL_2_DOT_0,          "EFL 2.0"},
-	{PK_LICENSE_ENUM_EU_DATAGRID,          "EU Datagrid"},
-	{PK_LICENSE_ENUM_LGPLV2_WITH_EXCEPTIONS, "LGPLv2 with exceptions"},
-	{PK_LICENSE_ENUM_FTL,                  "FTL"},
-	{PK_LICENSE_ENUM_GIFTWARE,             "Giftware"},
-	{PK_LICENSE_ENUM_GPLV2,                "GPLv2"},
-	{PK_LICENSE_ENUM_GPLV2_WITH_EXCEPTIONS, "GPLv2 with exceptions"},
+	{PK_LICENSE_ENUM_UNKNOWN,		"unknown"},	/* fall though value */
+	{PK_LICENSE_ENUM_GLIDE,			"Glide"},
+	{PK_LICENSE_ENUM_AFL,			"AFL"},
+	{PK_LICENSE_ENUM_AMPAS_BSD,		"AMPAS BSD"},
+	{PK_LICENSE_ENUM_AMAZON_DSL,		"ADSL"},
+	{PK_LICENSE_ENUM_ADOBE,			"Adobe"},
+	{PK_LICENSE_ENUM_AGPLV1,		"AGPLv1"},
+	{PK_LICENSE_ENUM_AGPLV3,		"AGPLv3"},
+	{PK_LICENSE_ENUM_ASL_1_DOT_0,		"ASL 1.0"},
+	{PK_LICENSE_ENUM_ASL_1_DOT_1,		"ASL 1.1"},
+	{PK_LICENSE_ENUM_ASL_2_DOT_0,		"ASL 2.0"},
+	{PK_LICENSE_ENUM_APSL_2_DOT_0,		"APSL 2.0"},
+	{PK_LICENSE_ENUM_ARTISTIC_CLARIFIED,	"Artistic clarified"},
+	{PK_LICENSE_ENUM_ARTISTIC_2_DOT_0,	"Artistic 2.0"},
+	{PK_LICENSE_ENUM_ARL,			"ARL"},
+	{PK_LICENSE_ENUM_BITTORRENT,		"BitTorrent"},
+	{PK_LICENSE_ENUM_BOOST,			"Boost"},
+	{PK_LICENSE_ENUM_BSD_WITH_ADVERTISING,	"BSD with advertising"},
+	{PK_LICENSE_ENUM_BSD,			"BSD"},
+	{PK_LICENSE_ENUM_CECILL,		"CeCILL"},
+	{PK_LICENSE_ENUM_CDDL,			"CDDL"},
+	{PK_LICENSE_ENUM_CPL,			"CPL"},
+	{PK_LICENSE_ENUM_CONDOR,		"Condor"},
+	{PK_LICENSE_ENUM_COPYRIGHT_ONLY,	"Copyright only"},
+	{PK_LICENSE_ENUM_CRYPTIX,		"Cryptix"},
+	{PK_LICENSE_ENUM_CRYSTAL_STACKER,	"Crystal Stacker"},
+	{PK_LICENSE_ENUM_DOC,			"DOC"},
+	{PK_LICENSE_ENUM_WTFPL,			"WTFPL"},
+	{PK_LICENSE_ENUM_EPL,			"EPL"},
+	{PK_LICENSE_ENUM_ECOS,			"eCos"},
+	{PK_LICENSE_ENUM_EFL_2_DOT_0,		"EFL 2.0"},
+	{PK_LICENSE_ENUM_EU_DATAGRID,		"EU Datagrid"},
+	{PK_LICENSE_ENUM_LGPLV2_WITH_EXCEPTIONS,"LGPLv2 with exceptions"},
+	{PK_LICENSE_ENUM_FTL,			"FTL"},
+	{PK_LICENSE_ENUM_GIFTWARE,		"Giftware"},
+	{PK_LICENSE_ENUM_GPLV2,			"GPLv2"},
+	{PK_LICENSE_ENUM_GPLV2_WITH_EXCEPTIONS,	"GPLv2 with exceptions"},
 	{PK_LICENSE_ENUM_GPLV2_PLUS_WITH_EXCEPTIONS, "GPLv2+ with exceptions"},
-	{PK_LICENSE_ENUM_GPLV3,                "GPLv3"},
-	{PK_LICENSE_ENUM_GPLV3_WITH_EXCEPTIONS, "GPLv3 with exceptions"},
+	{PK_LICENSE_ENUM_GPLV3,			"GPLv3"},
+	{PK_LICENSE_ENUM_GPLV3_WITH_EXCEPTIONS,	"GPLv3 with exceptions"},
 	{PK_LICENSE_ENUM_GPLV3_PLUS_WITH_EXCEPTIONS, "GPLv3+ with exceptions"},
-	{PK_LICENSE_ENUM_LGPLV2,               "LGPLv2"},
-	{PK_LICENSE_ENUM_LGPLV3,               "LGPLv3"},
-	{PK_LICENSE_ENUM_GNUPLOT,              "gnuplot"},
-	{PK_LICENSE_ENUM_IBM,                  "IBM"},
-	{PK_LICENSE_ENUM_IMATIX,               "iMatix"},
-	{PK_LICENSE_ENUM_IMAGEMAGICK,          "ImageMagick"},
-	{PK_LICENSE_ENUM_IMLIB2,               "Imlib2"},
-	{PK_LICENSE_ENUM_IJG,                  "IJG"},
-	{PK_LICENSE_ENUM_INTEL_ACPI,           "Intel ACPI"},
-	{PK_LICENSE_ENUM_INTERBASE,            "Interbase"},
-	{PK_LICENSE_ENUM_ISC,                  "ISC"},
-	{PK_LICENSE_ENUM_JABBER,               "Jabber"},
-	{PK_LICENSE_ENUM_JASPER,               "JasPer"},
-	{PK_LICENSE_ENUM_LPPL,                 "LPPL"},
-	{PK_LICENSE_ENUM_LIBTIFF,              "libtiff"},
-	{PK_LICENSE_ENUM_LPL,                  "LPL"},
-	{PK_LICENSE_ENUM_MECAB_IPADIC,         "mecab-ipadic"},
-	{PK_LICENSE_ENUM_MIT,                  "MIT"},
-	{PK_LICENSE_ENUM_MIT_WITH_ADVERTISING, "MIT with advertising"},
-	{PK_LICENSE_ENUM_MPLV1_DOT_0,          "MPLv1.0"},
-	{PK_LICENSE_ENUM_MPLV1_DOT_1,          "MPLv1.1"},
-	{PK_LICENSE_ENUM_NCSA,                 "NCSA"},
-	{PK_LICENSE_ENUM_NGPL,                 "NGPL"},
-	{PK_LICENSE_ENUM_NOSL,                 "NOSL"},
-	{PK_LICENSE_ENUM_NETCDF,               "NetCDF"},
-	{PK_LICENSE_ENUM_NETSCAPE,             "Netscape"},
-	{PK_LICENSE_ENUM_NOKIA,                "Nokia"},
-	{PK_LICENSE_ENUM_OPENLDAP,             "OpenLDAP"},
-	{PK_LICENSE_ENUM_OPENPBS,              "OpenPBS"},
-	{PK_LICENSE_ENUM_OSL_1_DOT_0,          "OSL 1.0"},
-	{PK_LICENSE_ENUM_OSL_1_DOT_1,          "OSL 1.1"},
-	{PK_LICENSE_ENUM_OSL_2_DOT_0,          "OSL 2.0"},
-	{PK_LICENSE_ENUM_OSL_3_DOT_0,          "OSL 3.0"},
-	{PK_LICENSE_ENUM_OPENSSL,              "OpenSSL"},
-	{PK_LICENSE_ENUM_OREILLY,              "OReilly"},
-	{PK_LICENSE_ENUM_PHORUM,               "Phorum"},
-	{PK_LICENSE_ENUM_PHP,                  "PHP"},
-	{PK_LICENSE_ENUM_PUBLIC_DOMAIN,        "Public Domain"},
-	{PK_LICENSE_ENUM_PYTHON,               "Python"},
-	{PK_LICENSE_ENUM_QPL,                  "QPL"},
-	{PK_LICENSE_ENUM_RPSL,                 "RPSL"},
-	{PK_LICENSE_ENUM_RUBY,                 "Ruby"},
-	{PK_LICENSE_ENUM_SENDMAIL,             "Sendmail"},
-	{PK_LICENSE_ENUM_SLEEPYCAT,            "Sleepycat"},
-	{PK_LICENSE_ENUM_SLIB,                 "SLIB"},
-	{PK_LICENSE_ENUM_SISSL,                "SISSL"},
-	{PK_LICENSE_ENUM_SPL,                  "SPL"},
-	{PK_LICENSE_ENUM_TCL,                  "TCL"},
-	{PK_LICENSE_ENUM_UCD,                  "UCD"},
-	{PK_LICENSE_ENUM_VIM,                  "Vim"},
-	{PK_LICENSE_ENUM_VNLSL,                "VNLSL"},
-	{PK_LICENSE_ENUM_VSL,                  "VSL"},
-	{PK_LICENSE_ENUM_W3C,                  "W3C"},
-	{PK_LICENSE_ENUM_WXWIDGETS,            "wxWidgets"},
-	{PK_LICENSE_ENUM_XINETD,               "xinetd"},
-	{PK_LICENSE_ENUM_ZEND,                 "Zend"},
-	{PK_LICENSE_ENUM_ZPLV1_DOT_0,          "ZPLv1.0"},
-	{PK_LICENSE_ENUM_ZPLV2_DOT_0,          "ZPLv2.0"},
-	{PK_LICENSE_ENUM_ZPLV2_DOT_1,          "ZPLv2.1"},
-	{PK_LICENSE_ENUM_ZLIB,                 "zlib"},
-	{PK_LICENSE_ENUM_ZLIB_WITH_ACK,        "zlib with acknowledgement"},
-	{PK_LICENSE_ENUM_CDL,                  "CDL"},
-	{PK_LICENSE_ENUM_FBSDDL,               "FBSDDL"},
-	{PK_LICENSE_ENUM_GFDL,                 "GFDL"},
-	{PK_LICENSE_ENUM_IEEE,                 "IEEE"},
-	{PK_LICENSE_ENUM_OFSFDL,               "OFSFDL"},
-	{PK_LICENSE_ENUM_OPEN_PUBLICATION,     "Open Publication"},
-	{PK_LICENSE_ENUM_CC_BY,                "CC-BY"},
-	{PK_LICENSE_ENUM_CC_BY_SA,             "CC-BY-SA"},
-	{PK_LICENSE_ENUM_CC_BY_ND,             "CC-BY-ND"},
-	{PK_LICENSE_ENUM_DSL,                  "DSL"},
-	{PK_LICENSE_ENUM_FREE_ART,             "Free Art"},
-	{PK_LICENSE_ENUM_OFL,                  "OFL"},
-	{PK_LICENSE_ENUM_UTOPIA,               "Utopia"},
-	{PK_LICENSE_ENUM_ARPHIC,               "Arphic"},
-	{PK_LICENSE_ENUM_BAEKMUK,              "Baekmuk"},
-	{PK_LICENSE_ENUM_BITSTREAM_VERA,       "Bitstream Vera"},
-	{PK_LICENSE_ENUM_LUCIDA,               "Lucida"},
-	{PK_LICENSE_ENUM_MPLUS,                "mplus"},
-	{PK_LICENSE_ENUM_STIX,                 "STIX"},
-	{PK_LICENSE_ENUM_XANO,                 "XANO"},
-	{PK_LICENSE_ENUM_VOSTROM,              "VOSTROM"},
+	{PK_LICENSE_ENUM_LGPLV2,		"LGPLv2"},
+	{PK_LICENSE_ENUM_LGPLV3,		"LGPLv3"},
+	{PK_LICENSE_ENUM_GNUPLOT,		"gnuplot"},
+	{PK_LICENSE_ENUM_IBM,			"IBM"},
+	{PK_LICENSE_ENUM_IMATIX,		"iMatix"},
+	{PK_LICENSE_ENUM_IMAGEMAGICK,		"ImageMagick"},
+	{PK_LICENSE_ENUM_IMLIB2,		"Imlib2"},
+	{PK_LICENSE_ENUM_IJG,			"IJG"},
+	{PK_LICENSE_ENUM_INTEL_ACPI,		"Intel ACPI"},
+	{PK_LICENSE_ENUM_INTERBASE,		"Interbase"},
+	{PK_LICENSE_ENUM_ISC,			"ISC"},
+	{PK_LICENSE_ENUM_JABBER,		"Jabber"},
+	{PK_LICENSE_ENUM_JASPER,		"JasPer"},
+	{PK_LICENSE_ENUM_LPPL,			"LPPL"},
+	{PK_LICENSE_ENUM_LIBTIFF,		"libtiff"},
+	{PK_LICENSE_ENUM_LPL,			"LPL"},
+	{PK_LICENSE_ENUM_MECAB_IPADIC,		"mecab-ipadic"},
+	{PK_LICENSE_ENUM_MIT,			"MIT"},
+	{PK_LICENSE_ENUM_MIT_WITH_ADVERTISING,	"MIT with advertising"},
+	{PK_LICENSE_ENUM_MPLV1_DOT_0,		"MPLv1.0"},
+	{PK_LICENSE_ENUM_MPLV1_DOT_1,		"MPLv1.1"},
+	{PK_LICENSE_ENUM_NCSA,			"NCSA"},
+	{PK_LICENSE_ENUM_NGPL,			"NGPL"},
+	{PK_LICENSE_ENUM_NOSL,			"NOSL"},
+	{PK_LICENSE_ENUM_NETCDF,		"NetCDF"},
+	{PK_LICENSE_ENUM_NETSCAPE,		"Netscape"},
+	{PK_LICENSE_ENUM_NOKIA,			"Nokia"},
+	{PK_LICENSE_ENUM_OPENLDAP,		"OpenLDAP"},
+	{PK_LICENSE_ENUM_OPENPBS,		"OpenPBS"},
+	{PK_LICENSE_ENUM_OSL_1_DOT_0,		"OSL 1.0"},
+	{PK_LICENSE_ENUM_OSL_1_DOT_1,		"OSL 1.1"},
+	{PK_LICENSE_ENUM_OSL_2_DOT_0,		"OSL 2.0"},
+	{PK_LICENSE_ENUM_OSL_3_DOT_0,		"OSL 3.0"},
+	{PK_LICENSE_ENUM_OPENSSL,		"OpenSSL"},
+	{PK_LICENSE_ENUM_OREILLY,		"OReilly"},
+	{PK_LICENSE_ENUM_PHORUM,		"Phorum"},
+	{PK_LICENSE_ENUM_PHP,			"PHP"},
+	{PK_LICENSE_ENUM_PUBLIC_DOMAIN,		"Public Domain"},
+	{PK_LICENSE_ENUM_PYTHON,		"Python"},
+	{PK_LICENSE_ENUM_QPL,			"QPL"},
+	{PK_LICENSE_ENUM_RPSL,			"RPSL"},
+	{PK_LICENSE_ENUM_RUBY,			"Ruby"},
+	{PK_LICENSE_ENUM_SENDMAIL,		"Sendmail"},
+	{PK_LICENSE_ENUM_SLEEPYCAT,		"Sleepycat"},
+	{PK_LICENSE_ENUM_SLIB,			"SLIB"},
+	{PK_LICENSE_ENUM_SISSL,			"SISSL"},
+	{PK_LICENSE_ENUM_SPL,			"SPL"},
+	{PK_LICENSE_ENUM_TCL,			"TCL"},
+	{PK_LICENSE_ENUM_UCD,			"UCD"},
+	{PK_LICENSE_ENUM_VIM,			"Vim"},
+	{PK_LICENSE_ENUM_VNLSL,			"VNLSL"},
+	{PK_LICENSE_ENUM_VSL,			"VSL"},
+	{PK_LICENSE_ENUM_W3C,			"W3C"},
+	{PK_LICENSE_ENUM_WXWIDGETS,		"wxWidgets"},
+	{PK_LICENSE_ENUM_XINETD,		"xinetd"},
+	{PK_LICENSE_ENUM_ZEND,			"Zend"},
+	{PK_LICENSE_ENUM_ZPLV1_DOT_0,		"ZPLv1.0"},
+	{PK_LICENSE_ENUM_ZPLV2_DOT_0,		"ZPLv2.0"},
+	{PK_LICENSE_ENUM_ZPLV2_DOT_1,		"ZPLv2.1"},
+	{PK_LICENSE_ENUM_ZLIB,			"zlib"},
+	{PK_LICENSE_ENUM_ZLIB_WITH_ACK,		"zlib with acknowledgement"},
+	{PK_LICENSE_ENUM_CDL,			"CDL"},
+	{PK_LICENSE_ENUM_FBSDDL,		"FBSDDL"},
+	{PK_LICENSE_ENUM_GFDL,			"GFDL"},
+	{PK_LICENSE_ENUM_IEEE,			"IEEE"},
+	{PK_LICENSE_ENUM_OFSFDL,		"OFSFDL"},
+	{PK_LICENSE_ENUM_OPEN_PUBLICATION,	"Open Publication"},
+	{PK_LICENSE_ENUM_CC_BY,			"CC-BY"},
+	{PK_LICENSE_ENUM_CC_BY_SA,		"CC-BY-SA"},
+	{PK_LICENSE_ENUM_CC_BY_ND,		"CC-BY-ND"},
+	{PK_LICENSE_ENUM_DSL,			"DSL"},
+	{PK_LICENSE_ENUM_FREE_ART,		"Free Art"},
+	{PK_LICENSE_ENUM_OFL,			"OFL"},
+	{PK_LICENSE_ENUM_UTOPIA,		"Utopia"},
+	{PK_LICENSE_ENUM_ARPHIC,		"Arphic"},
+	{PK_LICENSE_ENUM_BAEKMUK,		"Baekmuk"},
+	{PK_LICENSE_ENUM_BITSTREAM_VERA,	"Bitstream Vera"},
+	{PK_LICENSE_ENUM_LUCIDA,		"Lucida"},
+	{PK_LICENSE_ENUM_MPLUS,			"mplus"},
+	{PK_LICENSE_ENUM_STIX,			"STIX"},
+	{PK_LICENSE_ENUM_XANO,			"XANO"},
+	{PK_LICENSE_ENUM_VOSTROM,		"VOSTROM"},
 	{0, NULL}
 };
 
commit bbba48c8611091c129dbb302ce9141bcb783bf3f
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Apr 22 20:39:24 2008 +0100

    fix a couple of cosmetic issues

diff --git a/libpackagekit/pk-client.c b/libpackagekit/pk-client.c
index 9e71004..5b8cfad 100644
--- a/libpackagekit/pk-client.c
+++ b/libpackagekit/pk-client.c
@@ -2299,10 +2299,11 @@ pk_client_update_packages_strv (PkClient *client, gchar **package_ids, GError **
 
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_UPDATE_PACKAGES;
-        /* I think this is needed when called from: pk_client_requeue() 
-         * although this makes the "ownership" of package_ids interesting. */
-        if (client->priv->cached_package_ids != package_ids)
-	        client->priv->cached_package_ids = g_strdupv (package_ids);
+
+	/* only copy if we are not requeing */
+	if (client->priv->cached_package_ids == package_ids) {
+		client->priv->cached_package_ids = g_strdupv (package_ids);
+	}
 
 	/* hopefully do the operation first time */
 	ret = pk_client_update_packages_action (client, package_ids, &error_pk);
@@ -2352,7 +2353,7 @@ pk_client_update_packages (PkClient *client, GError **error, const gchar *packag
 {
 	va_list args;
 	gchar **package_ids;
-        gboolean ret;
+	gboolean ret;
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (package_id != NULL, FALSE);
@@ -2363,8 +2364,8 @@ pk_client_update_packages (PkClient *client, GError **error, const gchar *packag
 	va_end (args);
 
 	ret = pk_client_update_packages_strv (client, package_ids, error);
-        g_strfreev (package_ids);
-        return ret;
+	g_strfreev (package_ids);
+	return ret;
 }
 
 /**
commit 3a6f1b06be02c6fd67b6f5abcee0c60631d2d69b
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Tue Apr 22 15:12:45 2008 -0400

    Add several checks when installing a local package.

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index c70e0e6..8da06df 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -33,7 +33,7 @@ from yum.constants import *
 from yum.update_md import UpdateMetadata
 from yum.callbacks import *
 from yum.misc import prco_tuple_to_string,unique
-from yum.packages import YumLocalPackage
+from yum.packages import YumLocalPackage, parsePackages
 from yum.packageSack import MetaSack
 import rpmUtils
 import exceptions
@@ -917,6 +917,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
         self.yumbase.conf.gpgcheck=0
 
         try:
+            self._check_local_file(inst_file)
             txmbr = self.yumbase.installLocal(inst_file)
             if txmbr:
                 self._checkForNewer(txmbr[0].po)
@@ -947,6 +948,25 @@ class PackageKitYumBackend(PackageKitBaseBackend):
             except yum.Errors.InstallError,e:
                 self.error(ERROR_LOCAL_INSTALL_FAILED,str(e))
                 
+    def _check_local_file(self, pkg):
+        """
+        Duplicates some of the checks that yumbase.installLocal would
+        do, so we can get decent error reporting.
+        """
+        po = None
+        try:
+            po = YumLocalPackage(ts=self.yumbase.rpmdb.readOnlyTS(), filename=pkg)
+        except yum.Errors.MiscError:
+            raise yum.Errors.InstallError("%s does not appear to be a valid package." % pkg)
+
+        if self._is_inst(po):
+            raise yum.Errors.InstallError("%s is already installed" % str(po))
+
+        if len(self.yumbase.conf.exclude) > 0:
+           exactmatch, matched, unmatched = \
+                   parsePackages([po], self.yumbase.conf.exclude, casematch=1)
+           if po in exactmatch + matched:
+               raise yum.Errors.InstallError("%s is excluded by yum configuration." % pkg)
 
     def update(self,packages):
         '''
commit 9bafbeeb29f4afdad24cc27c9cf7533d047600fa
Author: James Antill <james at and.org>
Date:   Tue Apr 22 12:58:15 2008 -0400

    Likely another strv related leak bugfix

diff --git a/libpackagekit/pk-client.c b/libpackagekit/pk-client.c
index 60349ac..9e71004 100644
--- a/libpackagekit/pk-client.c
+++ b/libpackagekit/pk-client.c
@@ -2299,7 +2299,10 @@ pk_client_update_packages_strv (PkClient *client, gchar **package_ids, GError **
 
 	/* save this so we can re-issue it */
 	client->priv->role = PK_ROLE_ENUM_UPDATE_PACKAGES;
-	client->priv->cached_package_ids = g_strdupv (package_ids);
+        /* I think this is needed when called from: pk_client_requeue() 
+         * although this makes the "ownership" of package_ids interesting. */
+        if (client->priv->cached_package_ids != package_ids)
+	        client->priv->cached_package_ids = g_strdupv (package_ids);
 
 	/* hopefully do the operation first time */
 	ret = pk_client_update_packages_action (client, package_ids, &error_pk);
commit 6e3a3596c8ff1b27ddb72488cf45d662b1e5dd4d
Author: James Antill <james at and.org>
Date:   Tue Apr 22 12:52:20 2008 -0400

    Don't leak package_ids

diff --git a/libpackagekit/pk-client.c b/libpackagekit/pk-client.c
index 8a0eaef..60349ac 100644
--- a/libpackagekit/pk-client.c
+++ b/libpackagekit/pk-client.c
@@ -2349,6 +2349,7 @@ pk_client_update_packages (PkClient *client, GError **error, const gchar *packag
 {
 	va_list args;
 	gchar **package_ids;
+        gboolean ret;
 
 	g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
 	g_return_val_if_fail (package_id != NULL, FALSE);
@@ -2358,7 +2359,9 @@ pk_client_update_packages (PkClient *client, GError **error, const gchar *packag
 	package_ids = pk_package_ids_from_va_list (package_id, &args);
 	va_end (args);
 
-	return pk_client_update_packages_strv (client, package_ids, error);
+	ret = pk_client_update_packages_strv (client, package_ids, error);
+        g_strfreev (package_ids);
+        return ret;
 }
 
 /**
commit f9344be11370db8c0aab22da7d066cdaa71d3b12
Author: James Antill <james at and.org>
Date:   Tue Apr 22 12:46:44 2008 -0400

    Don't leak argv

diff --git a/src/pk-backend-spawn.c b/src/pk-backend-spawn.c
index 6f933ca..d77a830 100644
--- a/src/pk-backend-spawn.c
+++ b/src/pk-backend-spawn.c
@@ -485,6 +485,7 @@ pk_backend_spawn_helper_va_list (PkBackendSpawn *backend_spawn, const gchar *exe
 		pk_backend_finished (backend_spawn->priv->backend);
 	}
 	g_free (filename);
+	g_strfreev (argv);
 	return ret;
 }
 
commit 6423f34c838320e58bc495fc0f57b46ed03fcfb1
Merge: 463628d... a56bc4e...
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Apr 22 17:03:55 2008 +0100

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

commit 463628d425be87765cecffa588550e3ae8a4bbe0
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Apr 22 17:02:26 2008 +0100

    add a new error enum: PK_ERROR_ENUM_MISSING_GPG_SIGNATURE

diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index 26db88a..152a33b 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -134,20 +134,21 @@ static PkEnumMatch enum_error[] = {
 	{PK_ERROR_ENUM_REPO_NOT_FOUND,		"repo-not-found"},
 	{PK_ERROR_ENUM_CANNOT_REMOVE_SYSTEM_PACKAGE,	"cannot-remove-system-package"},
 	{PK_ERROR_ENUM_PROCESS_KILL,		"process-kill"},
-        {PK_ERROR_ENUM_FAILED_INITIALIZATION,   "failed-initialization"},
-        {PK_ERROR_ENUM_FAILED_FINALISE,         "failed-finalise"},
+	{PK_ERROR_ENUM_FAILED_INITIALIZATION,	"failed-initialization"},
+	{PK_ERROR_ENUM_FAILED_FINALISE,		"failed-finalise"},
 	{PK_ERROR_ENUM_FAILED_CONFIG_PARSING,	"failed-config-parsing"},
 	{PK_ERROR_ENUM_CANNOT_CANCEL,		"cannot-cancel"},
-	{PK_ERROR_ENUM_CANNOT_GET_LOCK,         "cannot-get-lock"},
-	{PK_ERROR_ENUM_NO_PACKAGES_TO_UPDATE,   "no-packages-to-update"},
-	{PK_ERROR_ENUM_CANNOT_WRITE_REPO_CONFIG,        "cannot-write-repo-config"},
-	{PK_ERROR_ENUM_LOCAL_INSTALL_FAILED,    "local-install-failed"},
-	{PK_ERROR_ENUM_BAD_GPG_SIGNATURE,       "bad-gpg-signature"},
-	{PK_ERROR_ENUM_CANNOT_INSTALL_SOURCE_PACKAGE,   "cannot-install-source-package"},
-	{PK_ERROR_ENUM_REPO_CONFIGURATION_ERROR,        "repo-configuration-error"},
+	{PK_ERROR_ENUM_CANNOT_GET_LOCK,		"cannot-get-lock"},
+	{PK_ERROR_ENUM_NO_PACKAGES_TO_UPDATE,	"no-packages-to-update"},
+	{PK_ERROR_ENUM_CANNOT_WRITE_REPO_CONFIG, "cannot-write-repo-config"},
+	{PK_ERROR_ENUM_LOCAL_INSTALL_FAILED,	"local-install-failed"},
+	{PK_ERROR_ENUM_BAD_GPG_SIGNATURE,	"bad-gpg-signature"},
+	{PK_ERROR_ENUM_MISSING_GPG_SIGNATURE,	"missing-gpg-signature"},
+	{PK_ERROR_ENUM_CANNOT_INSTALL_SOURCE_PACKAGE,	"cannot-install-source-package"},
+	{PK_ERROR_ENUM_REPO_CONFIGURATION_ERROR,	"repo-configuration-error"},
 	{PK_ERROR_ENUM_NO_LICENSE_AGREEMENT,	"no-license-agreement"},
 	{PK_ERROR_ENUM_FILE_CONFLICTS,		"file-conflicts"},
-	{PK_ERROR_ENUM_REPO_NOT_AVAILABLE,      "repo-not-available"},
+	{PK_ERROR_ENUM_REPO_NOT_AVAILABLE,	"repo-not-available"},
 	{0, NULL}
 };
 
diff --git a/libpackagekit/pk-enum.h b/libpackagekit/pk-enum.h
index c1ec965..11c61cf 100644
--- a/libpackagekit/pk-enum.h
+++ b/libpackagekit/pk-enum.h
@@ -234,6 +234,7 @@ typedef enum {
 	PK_ERROR_ENUM_CANNOT_WRITE_REPO_CONFIG,
 	PK_ERROR_ENUM_LOCAL_INSTALL_FAILED,
 	PK_ERROR_ENUM_BAD_GPG_SIGNATURE,
+	PK_ERROR_ENUM_MISSING_GPG_SIGNATURE,
 	PK_ERROR_ENUM_CANNOT_INSTALL_SOURCE_PACKAGE,
 	PK_ERROR_ENUM_REPO_CONFIGURATION_ERROR,
 	PK_ERROR_ENUM_NO_LICENSE_AGREEMENT,
diff --git a/tools/add-error-enum.sh b/tools/add-error-enum.sh
index 5df025f..7e55ef2 100755
--- a/tools/add-error-enum.sh
+++ b/tools/add-error-enum.sh
@@ -1,4 +1,4 @@
 #!/bin/sh
 
-$EDITOR docs/spec/pk-introduction.xml libpackagekit/pk-enum.h libpackagekit/pk-enum.c ../gnome-packagekit/libpackagekit-gnome/gpk-common.c python/packagekit/backend.py
+$EDITOR docs/spec/pk-introduction.xml libpackagekit/pk-enum.h libpackagekit/pk-enum.c ../gnome-packagekit/src/gpk-common.c
 
commit a56bc4e2e0aceba87b07b44853e7a09753c96221
Merge: 5e91ecd... 548005a...
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Tue Apr 22 11:49:18 2008 -0400

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

commit 5e91ecdd6dbcbb3ed6b45eeed7b7e2b881163476
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Tue Apr 22 11:49:03 2008 -0400

    Since we disable existing repos, we have to manually init pkgSack.  Yuck.

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 891d946..e14a44a 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -34,6 +34,7 @@ from yum.update_md import UpdateMetadata
 from yum.callbacks import *
 from yum.misc import prco_tuple_to_string,unique
 from yum.packages import YumLocalPackage
+from yum.packageSack import MetaSack
 import rpmUtils
 import exceptions
 import types
@@ -938,6 +939,8 @@ class PackageKitYumBackend(PackageKitBaseBackend):
                 txmbr = self.yumbase.installLocal(inst_file)
                 if txmbr:
                     if len(self.yumbase.tsInfo) > 0:
+                        if not self.yumbase.tsInfo.pkgSack:
+                            self.yumbase.tsInfo.pkgSack = MetaSack()
                         self._runYumTransaction()
                 else:
                     self.error(ERROR_LOCAL_INSTALL_FAILED,"Can't install %s" % inst_file)
commit f6caf8c6abc6208804bced31546578f84f3f10cc
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Apr 22 13:37:06 2008 +0100

    fix the spec file now that libpackagekit-gnome ceases to exist

diff --git a/contrib/gnome-packagekit.spec.in b/contrib/gnome-packagekit.spec.in
index d430edd..6cf4822 100644
--- a/contrib/gnome-packagekit.spec.in
+++ b/contrib/gnome-packagekit.spec.in
@@ -18,7 +18,6 @@ Requires:  libnotify >= 0.4.3
 Requires:  dbus-glib >= %{dbus_version}
 Requires:  dbus-x11 >= %{dbus_version}
 Requires:  PackageKit >= %{packagekit_version}
-Requires: gnome-packagekit-libs = %{version}-%{release}
 Requires(post):   scrollkeeper
 Requires(pre):    GConf2
 Requires(post):   GConf2
@@ -51,26 +50,6 @@ packagekit-gnome provides session applications for the PackageKit API.
 There are several utilities designed for installing, updating and
 removing packages on your system.
 
-%package libs
-Summary: Libraries for accessing PackageKit
-Group: Development/Libraries
-Requires: dbus >= %{dbus_version}
-Requires: %{name} = %{version}-%{release}
-
-%description libs
-Libraries for accessing PackageKit in the GNOME desktop.
-
-%package devel
-Summary: Libraries and headers for gnome-packagekit
-Group: Development/Libraries
-Requires: %{name} = %{version}-%{release}
-Requires: dbus-devel >= %{dbus_version}
-Requires: pkgconfig
-Requires: sqlite-devel
-
-%description devel
-Headers and libraries for packagekit-gnome.
-
 %prep
 %setup -q
 
@@ -87,9 +66,6 @@ unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
 install %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/system-install-packages
 install %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/man/man1/system-install-packages.1.gz
 
-rm -f $RPM_BUILD_ROOT%{_libdir}/libpackagekit-gnome*.a
-rm -f $RPM_BUILD_ROOT%{_libdir}/libpackagekit-gnome*.la
-
 desktop-file-install --delete-original                   \
   --dir=$RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart/                    \
   $RPM_BUILD_ROOT%{_datadir}/gnome/autostart/gpk-update-icon.desktop
@@ -151,24 +127,10 @@ fi
 %{_datadir}/icons/hicolor/scalable/status/*.svg
 %config(noreplace) %{_sysconfdir}/gconf/schemas/*.schemas
 %{_datadir}/man/man1/*.1.gz
-%{_datadir}/gtk-doc/html/gnome-packagekit
 %{_datadir}/gnome/help/gnome-packagekit
 %{_datadir}/omf/gnome-packagekit
 %{_sysconfdir}/xdg/autostart/gpk-update-icon.desktop
 %{_datadir}/applications/gpk-*.desktop
-%exclude %{_libdir}/libpackagekit-gnome*.so.*
-
-%files libs
-%defattr(-,root,root,-)
-%doc README AUTHORS NEWS COPYING 
-%{_libdir}/*packagekit-gnome*.so.*
-
-%files devel
-%defattr(-,root,root,-)
-
-%{_libdir}/lib*.so
-%{_libdir}/pkgconfig/*
-%{_includedir}/*
 
 %changelog
 * #LONGDATE# Richard Hughes <richard at hughsie.com> #VERSION#-0.#BUILD##ALPHATAG#
commit 548005a8a30d90e5a9234904e4db4cf24e27833e
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Apr 22 11:52:57 2008 +0100

    add the arch filter to the FAQ page

diff --git a/docs/html/pk-faq.html b/docs/html/pk-faq.html
index 857f0c3..5c16e7c 100644
--- a/docs/html/pk-faq.html
+++ b/docs/html/pk-faq.html
@@ -544,6 +544,21 @@
 <td><img src="img/status-bad.png" alt="[no]"/></td><!-- yum2 -->
 <td><img src="img/status-bad.png" alt="[no]"/></td><!-- zypp -->
 </tr>
+<tr>
+<td><b>Arch</b></td>
+<td><img src="img/status-bad.png" alt="[no]"/></td><!-- apt -->
+<td><img src="img/status-bad.png" alt="[no]"/></td><!-- apt2 -->
+<td><img src="img/status-bad.png" alt="[no]"/></td><!-- alpm -->
+<td><img src="img/status-bad.png" alt="[no]"/></td><!-- box -->
+<td><img src="img/status-bad.png" alt="[no]"/></td><!-- conary -->
+<td><img src="img/status-bad.png" alt="[no]"/></td><!-- opkg -->
+<td><img src="img/status-bad.png" alt="[no]"/></td><!-- pisi -->
+<td><img src="img/status-bad.png" alt="[no]"/></td><!-- poldek -->
+<td><img src="img/status-bad.png" alt="[no]"/></td><!-- smart -->
+<td><img src="img/status-bad.png" alt="[no]"/></td><!-- yum -->
+<td><img src="img/status-bad.png" alt="[no]"/></td><!-- yum2 -->
+<td><img src="img/status-bad.png" alt="[no]"/></td><!-- zypp -->
+</tr>
 </table>
 
 <hr>
commit d6120e0a04228a119f3c388f204cbd10be2a204c
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Apr 22 11:51:57 2008 +0100

    add the ARCH filter so we can match native and non-native archs in search results

diff --git a/docs/spec/pk-concepts.xml b/docs/spec/pk-concepts.xml
index 50c11c9..1f294c0 100644
--- a/docs/spec/pk-concepts.xml
+++ b/docs/spec/pk-concepts.xml
@@ -117,6 +117,16 @@
               <literal>gimp-2.4.3-1.fc9.i386</literal>.
             </entry>
           </row>
+          <row>
+            <entry><literal>arch</literal> or <literal>~arch</literal></entry>
+            <entry>
+              The arch filter will only return the packages that match the exact architecture
+              of the system, for instance only showing x86_64 packages on a AMD Turion 64.
+              This would mean that x86_64 packages could be filtered from non-native 32-bit
+              packages.
+              This allows the used to choose non-native packages if a multi-lib policy is allowed.
+            </entry>
+          </row>
         </tbody>
       </tgroup>
     </informaltable>
diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index 93535fa..26db88a 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -187,6 +187,8 @@ static PkEnumMatch enum_filter[] = {
 	{PK_FILTER_ENUM_NOT_BASENAME,		"~basename"},
 	{PK_FILTER_ENUM_NEWEST,			"newest"},
 	{PK_FILTER_ENUM_NOT_NEWEST,		"~newest"},
+	{PK_FILTER_ENUM_ARCH,			"arch"},
+	{PK_FILTER_ENUM_NOT_ARCH,		"~arch"},
 	{0, NULL}
 };
 
diff --git a/libpackagekit/pk-enum.h b/libpackagekit/pk-enum.h
index d4ab06a..c1ec965 100644
--- a/libpackagekit/pk-enum.h
+++ b/libpackagekit/pk-enum.h
@@ -169,7 +169,9 @@ typedef enum {
 	PK_FILTER_ENUM_NOT_BASENAME		= 1 << 13,
 	PK_FILTER_ENUM_NEWEST			= 1 << 14,
 	PK_FILTER_ENUM_NOT_NEWEST		= 1 << 15,
-	PK_FILTER_ENUM_UNKNOWN			= 1 << 16
+	PK_FILTER_ENUM_ARCH			= 1 << 16,
+	PK_FILTER_ENUM_NOT_ARCH			= 1 << 17,
+	PK_FILTER_ENUM_UNKNOWN			= 1 << 18
 } PkFilterEnum;
 
 /**
commit e55017af86134d88b1732b4384d3702888da99b2
Merge: 514af33... ba43b9d...
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Apr 22 10:59:25 2008 +0100

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

commit ba43b9d109c3c20a1dceb30e35c6138abeae02fb
Author: Stefan Haas <shaas at suse.de>
Date:   Tue Apr 22 10:13:20 2008 +0200

    fixed BNC# 381697 and BNC# 381698

diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
index 42598ba..821fd91 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -1222,21 +1222,18 @@ backend_remove_package_thread (PkBackendThread *thread, gpointer data)
 	try
 	{
 		// Iterate over the resolvables and mark the ones we want to remove
-		//zypp->start ();
-		for (zypp::ResPoolProxy::const_iterator it = zypp->poolProxy().byKindBegin <zypp::Package>();
-				it != zypp->poolProxy().byKindEnd <zypp::Package>(); it++) {
-			zypp::ui::Selectable::Ptr selectable = *it;
-			if (strcmp (selectable->name().c_str(), pi->name) == 0) {
-				if (selectable->status () == zypp::ui::S_KeepInstalled) {
-					selectable->setStatus (zypp::ui::S_Del);
-					break;
-				}
+		zypp::ResPool pool = zypp::ResPool::instance ();
+		for (zypp::ResPool::byIdent_iterator it = pool.byIdentBegin (zypp::ResKind::package, pi->name);
+				it != pool.byIdentEnd (zypp::ResKind::package, pi->name); it++) {
+			if ((*it)->isSystem ()) {
+				it->status ().setToBeUninstalled (zypp::ResStatus::USER);
+				break;
 			}
 		}
-
+		
 		pk_backend_set_percentage (backend, 40);
 
-                if (!zypp_perform_execution (backend, REMOVE, FALSE)){
+                if (!zypp_perform_execution (backend, REMOVE, TRUE)){
                         pk_backend_error_code (backend, PK_ERROR_ENUM_TRANSACTION_ERROR, "Couldn't remove the package");
                         g_free (d->package_id);
                         g_free (d);
@@ -1247,7 +1244,6 @@ backend_remove_package_thread (PkBackendThread *thread, gpointer data)
 
 		pk_backend_set_percentage (backend, 100);
 
-		// TODO: Check result for success
 	} catch (const zypp::repo::RepoNotFoundException &ex) {
 		// TODO: make sure this dumps out the right sring.
 		pk_backend_error_code (backend, PK_ERROR_ENUM_REPO_NOT_FOUND, ex.asUserString().c_str() );
commit 18b67d4448ac2419ab9e680e5ba6dad1f37807dc
Author: Stefan Haas <shaas at suse.de>
Date:   Tue Apr 22 10:12:07 2008 +0200

    added install-file to zypp-backend

diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
index 0575263..42598ba 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -49,6 +49,7 @@
 #include <zypp/target/rpm/RpmHeader.h>
 #include <zypp/target/rpm/RpmException.h>
 #include <zypp/base/LogControl.h>
+#include <zypp/TmpPath.h>
 
 #include <zypp/sat/Solvable.h>
 
@@ -97,6 +98,10 @@ typedef struct {
 } ThreadData;
 
 typedef struct {
+	gchar *full_path;
+} InstFileData;
+
+typedef struct {
         gchar *package_id;
         PkFilterEnum filters;
         gint type;
@@ -704,6 +709,86 @@ backend_get_updates_thread (PkBackendThread *thread, gpointer data)
 	return TRUE;
 }
 
+static gboolean
+backend_refresh_cache_thread (PkBackendThread *thread, gpointer data)
+{
+	PkBackend *backend;
+	RefreshData *d = (RefreshData*) data;
+
+	backend = pk_backend_thread_get_backend (thread);
+	gboolean force = d->force;
+	g_free (d);
+
+	pk_backend_set_status (backend, PK_STATUS_ENUM_REFRESH_CACHE);
+	pk_backend_set_percentage (backend, 0);
+
+	zypp::RepoManager manager;
+	std::list <zypp::RepoInfo> repos;
+	try
+	{
+		repos = manager.knownRepositories();
+	}
+	catch ( const zypp::Exception &e)
+	{
+		// FIXME: make sure this dumps out the right sring.
+		pk_backend_error_code (backend, PK_ERROR_ENUM_REPO_NOT_FOUND, e.asUserString().c_str() );
+		pk_backend_finished (backend);
+		return FALSE;
+	}
+
+	int i = 1;
+	int num_of_repos = repos.size ();
+	int percentage_increment = 100 / num_of_repos;
+
+	for (std::list <zypp::RepoInfo>::iterator it = repos.begin(); it != repos.end(); it++, i++) {
+		zypp::RepoInfo repo (*it);
+
+		// skip disabled repos
+		if (repo.enabled () == false)
+			continue;
+
+		// skip changeable meda (DVDs and CDs).  Without doing this,
+		// the disc would be required to be physically present.
+		if (zypp_is_changeable_media (*repo.baseUrlsBegin ()) == true)
+			continue;
+
+		try {
+                        // Refreshing metadata
+			manager.refreshMetadata (repo, force == TRUE ?
+				zypp::RepoManager::RefreshForced :
+				zypp::RepoManager::RefreshIfNeeded);
+		} catch (const zypp::Exception &ex) {
+			pk_backend_error_code (backend, PK_ERROR_ENUM_INTERNAL_ERROR, ex.asUserString ().c_str ());
+			pk_backend_finished (backend);
+			return FALSE;
+		}
+
+		try {
+                        // Building cache
+                        manager.buildCache (repo, force == TRUE ?
+				zypp::RepoManager::BuildForced :
+				zypp::RepoManager::BuildIfNeeded);
+		//} catch (const zypp::repo::RepoNoUrlException &ex) {
+		//} catch (const zypp::repo::RepoNoAliasException &ex) {
+		//} catch (const zypp::repo::RepoUnknownTypeException &ex) {
+		//} catch (const zypp::repo::RepoException &ex) {
+		} catch (const zypp::Exception &ex) {
+			// TODO: Handle the exceptions in manager.refreshMetadata
+			pk_backend_error_code (backend, PK_ERROR_ENUM_INTERNAL_ERROR, ex.asUserString().c_str() );
+			pk_backend_finished (backend);
+			return FALSE;
+		}
+
+		// Update the percentage completed
+		pk_backend_set_percentage (backend,
+					      i == num_of_repos ?
+						100 :
+						i * percentage_increment);
+	}
+
+	pk_backend_finished (backend);
+	return TRUE;
+}
 
 /**
  * backend_get_updates
@@ -716,6 +801,137 @@ backend_get_updates (PkBackend *backend, PkFilterEnum filters)
 }
 
 static gboolean
+backend_install_file_thread (PkBackendThread *thread, gpointer data)
+{
+	PkBackend *backend;
+	InstFileData *d = (InstFileData*) data;
+
+	backend = pk_backend_thread_get_backend (thread);
+
+	// check if file is really a rpm
+
+	zypp::Pathname rpmPath (d->full_path);
+	zypp::target::rpm::RpmHeader::constPtr rpmHeader = zypp::target::rpm::RpmHeader::readPackage (rpmPath, zypp::target::rpm::RpmHeader::NOSIGNATURE);
+
+	if (rpmHeader == NULL) {
+		pk_backend_error_code (backend, PK_ERROR_ENUM_LOCAL_INSTALL_FAILED, "%s is no valid rpm-File", d->full_path);
+		g_free (d->full_path);
+		g_free (d);
+		pk_backend_finished (backend);
+		return FALSE;
+	}
+
+	// create a temporary directory
+	zypp::filesystem::TmpDir tmpDir;
+	if (tmpDir == NULL) {
+		pk_backend_error_code (backend, PK_ERROR_ENUM_LOCAL_INSTALL_FAILED, "Could not create a temporary directory");
+		g_free (d->full_path);
+		g_free (d);
+		pk_backend_finished (backend);
+		return FALSE;
+	}
+
+	// copy the rpm into tmpdir
+
+	std::string tempDest = tmpDir.path ().asString () + "/" + rpmHeader->tag_name () + ".rpm";
+	if (zypp::filesystem::copy (d->full_path, tempDest) != 0) {
+		pk_backend_error_code (backend, PK_ERROR_ENUM_LOCAL_INSTALL_FAILED, "Could not copy the rpm-file into the temp-dir");
+		g_free (d->full_path);
+		g_free (d);
+		pk_backend_finished (backend);
+		return FALSE;
+	}
+
+	// create a plaindir-repo
+	zypp::RepoInfo tmpRepo;
+
+	try {
+
+		tmpRepo.setType(zypp::repo::RepoType::RPMPLAINDIR);
+		std::string url = "dir://" + tmpDir.path ().asString ();
+		tmpRepo.addBaseUrl(zypp::Url::parseUrl(url));
+		tmpRepo.setEnabled (true);
+		tmpRepo.setAutorefresh (true);
+		tmpRepo.setAlias ("PK_TMP_DIR");
+		tmpRepo.setName ("PK_TMP_DIR");
+
+		// add Repo to pool
+
+		zypp::RepoManager manager;
+		manager.addRepository (tmpRepo);
+
+		manager.refreshMetadata (tmpRepo);
+		manager.buildCache (tmpRepo);
+
+	} catch (const zypp::url::UrlException &ex) {
+		pk_backend_error_code (backend, PK_ERROR_ENUM_INTERNAL_ERROR, ex.asUserString ().c_str ());
+		g_free (d->full_path);
+		g_free (d);
+		pk_backend_finished (backend);
+		return FALSE;
+	} catch (const zypp::Exception &ex) {
+		pk_backend_error_code (backend, PK_ERROR_ENUM_INTERNAL_ERROR, ex.asUserString().c_str() );
+		g_free (d->full_path);
+		g_free (d);
+		pk_backend_finished (backend);
+		return FALSE;
+	}
+
+	// look for the package and try to install it
+	std::vector<zypp::sat::Solvable> *solvables = new std::vector<zypp::sat::Solvable>;	
+	solvables = zypp_get_packages_by_name (rpmHeader->tag_name ().c_str (), zypp::ResKind::package, FALSE);
+	zypp::PoolItem *item = NULL;
+	gboolean found = FALSE;
+
+	for (std::vector<zypp::sat::Solvable>::iterator it = solvables->begin (); it != solvables->end (); it ++) {
+	       if (it->repository ().name () == "PK_TMP_DIR") {
+		       item = new zypp::PoolItem(*it);
+		       found = TRUE;
+		       break;
+	       }
+	}
+
+	if (!found) {
+		pk_backend_error_code (backend, PK_ERROR_ENUM_INTERNAL_ERROR, "Could not find the rpm-Package in Pool");
+	}else{
+		zypp::ResStatus status = item->status ().setToBeInstalled (zypp::ResStatus::USER);
+		if (!zypp_perform_execution (backend, INSTALL, FALSE)) {
+			pk_backend_error_code (backend, PK_ERROR_ENUM_LOCAL_INSTALL_FAILED, "Could not install the rpm-file.");
+                }
+
+                item->statusReset ();
+	}
+
+	//remove tmp-dir and the tmp-repo
+	try {
+		zypp::RepoManager manager;
+		manager.removeRepository (tmpRepo);
+	} catch (const zypp::repo::RepoNotFoundException &ex) {
+		pk_backend_error_code (backend, PK_ERROR_ENUM_REPO_NOT_FOUND, ex.asUserString().c_str() );
+	}
+
+	g_free (d->full_path);
+	g_free (d);
+	delete (solvables);
+	delete (item);
+	pk_backend_finished (backend);
+	return TRUE;
+}
+
+/**
+  * backend_install_file
+  */
+static void
+backend_install_file (PkBackend *backend, const gchar *full_path)
+{
+	g_return_if_fail (backend != NULL);
+	InstFileData *data = g_new0(InstFileData, 1);
+	data->full_path = g_strdup (full_path);
+
+	pk_backend_thread_create (thread, backend_install_file_thread, data);
+}
+
+static gboolean
 backend_get_update_detail_thread (PkBackendThread *thread, gpointer data)
 {
 	PkBackend *backend;
@@ -972,87 +1188,6 @@ backend_install_package (PkBackend *backend, const gchar *package_id)
 }
 
 static gboolean
-backend_refresh_cache_thread (PkBackendThread *thread, gpointer data)
-{
-	PkBackend *backend;
-	RefreshData *d = (RefreshData*) data;
-
-	backend = pk_backend_thread_get_backend (thread);
-	gboolean force = d->force;
-	g_free (d);
-
-	pk_backend_set_status (backend, PK_STATUS_ENUM_REFRESH_CACHE);
-	pk_backend_set_percentage (backend, 0);
-
-	zypp::RepoManager manager;
-	std::list <zypp::RepoInfo> repos;
-	try
-	{
-		repos = manager.knownRepositories();
-	}
-	catch ( const zypp::Exception &e)
-	{
-		// FIXME: make sure this dumps out the right sring.
-		pk_backend_error_code (backend, PK_ERROR_ENUM_REPO_NOT_FOUND, e.asUserString().c_str() );
-		pk_backend_finished (backend);
-		return FALSE;
-	}
-
-	int i = 1;
-	int num_of_repos = repos.size ();
-	int percentage_increment = 100 / num_of_repos;
-
-	for (std::list <zypp::RepoInfo>::iterator it = repos.begin(); it != repos.end(); it++, i++) {
-		zypp::RepoInfo repo (*it);
-
-		// skip disabled repos
-		if (repo.enabled () == false)
-			continue;
-
-		// skip changeable meda (DVDs and CDs).  Without doing this,
-		// the disc would be required to be physically present.
-		if (zypp_is_changeable_media (*repo.baseUrlsBegin ()) == true)
-			continue;
-
-		try {
-                        // Refreshing metadata
-			manager.refreshMetadata (repo, force == TRUE ?
-				zypp::RepoManager::RefreshForced :
-				zypp::RepoManager::RefreshIfNeeded);
-		} catch (const zypp::Exception &ex) {
-			pk_backend_error_code (backend, PK_ERROR_ENUM_INTERNAL_ERROR, ex.asUserString ().c_str ());
-			pk_backend_finished (backend);
-			return FALSE;
-		}
-
-		try {
-                        // Building cache
-                        manager.buildCache (repo, force == TRUE ?
-				zypp::RepoManager::BuildForced :
-				zypp::RepoManager::BuildIfNeeded);
-		//} catch (const zypp::repo::RepoNoUrlException &ex) {
-		//} catch (const zypp::repo::RepoNoAliasException &ex) {
-		//} catch (const zypp::repo::RepoUnknownTypeException &ex) {
-		//} catch (const zypp::repo::RepoException &ex) {
-		} catch (const zypp::Exception &ex) {
-			// TODO: Handle the exceptions in manager.refreshMetadata
-			pk_backend_error_code (backend, PK_ERROR_ENUM_INTERNAL_ERROR, ex.asUserString().c_str() );
-			pk_backend_finished (backend);
-			return FALSE;
-		}
-
-		// Update the percentage completed
-		pk_backend_set_percentage (backend,
-					      i == num_of_repos ?
-						100 :
-						i * percentage_increment);
-	}
-
-	pk_backend_finished (backend);
-	return TRUE;
-}
-
-static gboolean
 backend_remove_package_thread (PkBackendThread *thread, gpointer data)
 {
 	PkBackend *backend;
@@ -1816,7 +1951,7 @@ extern "C" PK_BACKEND_OPTIONS (
 	backend_get_requires,			/* get_requires */
 	backend_get_update_detail,		/* get_update_detail */
 	backend_get_updates,			/* get_updates */
-	NULL,					/* install_file */
+	backend_install_file,			/* install_file */
 	backend_install_package,		/* install_package */
 	NULL,					/* install_signature */
 	backend_refresh_cache,			/* refresh_cache */
commit ee680f9b17ac4cd6bd77a8d38e1182f56bf495e0
Author: Grzegorz Dabrowski <gdx at o2.pl>
Date:   Tue Apr 22 08:51:53 2008 +0000

    [box] build fix - use correct enum

diff --git a/backends/box/pk-backend-box.c b/backends/box/pk-backend-box.c
index 726d881..73680d4 100644
--- a/backends/box/pk-backend-box.c
+++ b/backends/box/pk-backend-box.c
@@ -136,10 +136,10 @@ find_packages_real (PkBackend *backend, const gchar *search, PkFilterEnum filter
 	if (pk_enums_contain (filters, PK_FILTER_ENUM_NOT_INSTALLED)) {
 		filter_box = filter_box | PKG_AVAILABLE;
 	}
-	if (pk_enums_contain (filters, PK_FILTER_ENUM_DEVEL)) {
+	if (pk_enums_contain (filters, PK_FILTER_ENUM_DEVELOPMENT)) {
 		filter_box = filter_box | PKG_DEVEL;
 	}
-	if (pk_enums_contain (filters, PK_FILTER_ENUM_NOT_DEVEL)) {
+	if (pk_enums_contain (filters, PK_FILTER_ENUM_NOT_DEVELOPMENT)) {
 		filter_box = filter_box | PKG_NON_DEVEL;
 	}
 	if (pk_enums_contain (filters, PK_FILTER_ENUM_GUI)) {
commit 514af33a54531d8fc2fd72452098cbdad3eb60a8
Merge: 95d0ee0... 9a34a5a...
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Apr 22 02:05:22 2008 +0100

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

commit 9a34a5ac21d7fbea73a0a5c316ef7b0ca5c5aafb
Author: Andrea Scarpino <bash.lnx at gmail.com>
Date:   Tue Apr 22 02:59:39 2008 +0200

    fixed alpm make fail

diff --git a/backends/alpm/pk-backend-alpm.c b/backends/alpm/pk-backend-alpm.c
index 7c6bf88..10bec06 100644
--- a/backends/alpm/pk-backend-alpm.c
+++ b/backends/alpm/pk-backend-alpm.c
@@ -773,24 +773,24 @@ backend_get_repo_list (PkBackend *backend, PkFilterEnum filters)
 PK_BACKEND_OPTIONS (
 	"alpm",						/* description */
 	"Andreas Obergrusberger <tradiaz at yahoo.de>",	/* author */
-	backend_initialize,			/* initialize */
-	backend_destroy,			/* destroy */
+	backend_initialize,				/* initialize */
+	backend_destroy,				/* destroy */
 	NULL,						/* get_groups */
-	backend_get_filters,		/* get_filters */
+	backend_get_filters,				/* get_filters */
 	NULL,						/* cancel */
  	NULL,						/* get_depends */
 	NULL,						/* get_description */
 	NULL,						/* get_files */
 	NULL,						/* get_packages */
-	backend_get_repo_list,		/* get_repo_list */
+	backend_get_repo_list,				/* get_repo_list */
 	NULL,						/* get_requires */
 	NULL,						/* get_update_detail */
 	NULL,						/* get_updates */
-	backend_install_file,		/* install_file */
-	backend_install_package,	/* install_package */
+	backend_install_file,				/* install_file */
+	backend_install_package,			/* install_package */
 	NULL,						/* install_signature */
-	backend_refresh_cache,		/* refresh_cache */
-	backend_remove_package,		/* remove_package */
+	backend_refresh_cache,				/* refresh_cache */
+	backend_remove_package,				/* remove_package */
 	NULL,						/* repo_enable */
 	NULL,						/* repo_set_data */
 	NULL,						/* resolve */
@@ -798,9 +798,9 @@ PK_BACKEND_OPTIONS (
 	NULL,						/* search_details */
 	NULL,						/* search_file */
 	NULL,						/* search_group */
-	backend_search_name,		/* search_name */
+	backend_search_name,				/* search_name */
 	NULL,						/* service_pack */
-	backend_update_packages,	/* update_packages */
+	backend_update_packages,			/* update_packages */
 	NULL,						/* update_system */
 	NULL						/* what_provides */
 );
commit 95d0ee0caeaf0869cd9b719a60d3f242baaf63f0
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Apr 22 01:49:04 2008 +0100

    add some comments to the gpg handling stuff in yum

diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 891d946..4f4eecc 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -1641,11 +1641,13 @@ class PackageKitYumBase(yum.YumBase):
         for po in pkgs:
             result,errmsg = self.sigCheckPkg(po)
             if result == 0:
-                # Verified ok, or verify not req'd
+                # verified ok, or verify not required
                 continue
             elif result == 1:
+                # verify failed but installation of the correct GPG key might help
                 self.getKeyForPackage(po,fullaskcb=self._fullAskForGPGKeyImport)
             else:
+                # fatal GPG verification error
                 raise yum.Errors.YumGPGCheckError,errmsg
         return 0
 
commit f150b347156e42370cbfa301596a92153fa40db3
Author: Andrea Scarpino <bash.lnx at gmail.com>
Date:   Tue Apr 22 02:26:43 2008 +0200

    fixed make fail

diff --git a/backends/alpm/pk-backend-alpm.c b/backends/alpm/pk-backend-alpm.c
index 6746a28..7c6bf88 100644
--- a/backends/alpm/pk-backend-alpm.c
+++ b/backends/alpm/pk-backend-alpm.c
@@ -657,8 +657,8 @@ backend_search_name (PkBackend *backend, PkFilterEnum filters, const gchar *sear
 	alpm_list_t *localresult = NULL;
 	alpm_list_t *dbs = NULL;
 
-	installed = pk_enums_contain (filters, PK_FILTER_ENUM_INSTALLED);
-	ninstalled = pk_enums_contain (filters, PK_FILTER_ENUM_NOT_INSTALLED);
+	gboolean installed = pk_enums_contain (filters, PK_FILTER_ENUM_INSTALLED);
+	gboolean ninstalled = pk_enums_contain (filters, PK_FILTER_ENUM_NOT_INSTALLED);
 
 	pk_debug ("alpm: searching for \"%s\" - searching in installed: %i, ~installed: %i",
 		  search, installed, ninstalled);
@@ -773,23 +773,24 @@ backend_get_repo_list (PkBackend *backend, PkFilterEnum filters)
 PK_BACKEND_OPTIONS (
 	"alpm",						/* description */
 	"Andreas Obergrusberger <tradiaz at yahoo.de>",	/* author */
-	backend_initialize,				/* initialize */
-	backend_destroy,				/* destroy */
-	backend_get_filters,				/* get_filters */
+	backend_initialize,			/* initialize */
+	backend_destroy,			/* destroy */
+	NULL,						/* get_groups */
+	backend_get_filters,		/* get_filters */
 	NULL,						/* cancel */
  	NULL,						/* get_depends */
 	NULL,						/* get_description */
 	NULL,						/* get_files */
 	NULL,						/* get_packages */
-	backend_get_repo_list,				/* get_repo_list */
+	backend_get_repo_list,		/* get_repo_list */
 	NULL,						/* get_requires */
 	NULL,						/* get_update_detail */
 	NULL,						/* get_updates */
-	backend_install_file,				/* install_file */
-	backend_install_package,			/* install_package */
+	backend_install_file,		/* install_file */
+	backend_install_package,	/* install_package */
 	NULL,						/* install_signature */
-	backend_refresh_cache,				/* refresh_cache */
-	backend_remove_package,				/* remove_package */
+	backend_refresh_cache,		/* refresh_cache */
+	backend_remove_package,		/* remove_package */
 	NULL,						/* repo_enable */
 	NULL,						/* repo_set_data */
 	NULL,						/* resolve */
@@ -797,9 +798,9 @@ PK_BACKEND_OPTIONS (
 	NULL,						/* search_details */
 	NULL,						/* search_file */
 	NULL,						/* search_group */
-	backend_search_name,				/* search_name */
+	backend_search_name,		/* search_name */
 	NULL,						/* service_pack */
-	backend_update_packages,			/* update_packages */
+	backend_update_packages,	/* update_packages */
 	NULL,						/* update_system */
 	NULL						/* what_provides */
 );


More information about the PackageKit-commit mailing list