[packagekit] packagekit: Branch 'master' - 4 commits
Richard Hughes
hughsient at kemper.freedesktop.org
Wed Sep 12 10:46:44 PDT 2007
backends/BACKENDS | 8 ++++++--
backends/yum/helpers/search-file.py | 2 +-
backends/yum/helpers/yumBackend.py | 26 ++++++++++++++++++++++++--
configure.ac | 4 ++++
src/Makefile.am | 2 ++
src/pk-backend.c | 8 ++++++--
6 files changed, 43 insertions(+), 7 deletions(-)
New commits:
diff-tree ef43307e0715dfe075d1ef02c034bc1edf173e23 (from b2e6a38966c7a3cd8c20e4288d8bcce7baf501b2)
Author: Richard Hughes <richard at hughsie.com>
Date: Wed Sep 12 18:42:41 2007 +0100
pick up an sqlite dep for the upcoming database work
diff --git a/configure.ac b/configure.ac
index 5ce4df7..45e8cf6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,6 +68,10 @@ PKG_CHECK_MODULES(GMODULE, gmodule-2.0)
AC_SUBST(GMODULE_CFLAGS)
AC_SUBST(GMODULE_LIBS)
+PKG_CHECK_MODULES(SQLITE, sqlite3)
+AC_SUBST(SQLITE_CFLAGS)
+AC_SUBST(SQLITE_LIBS)
+
PKG_CHECK_MODULES(DBUS, \
dbus-glib-1 >= $DBUS_GLIB_REQUIRED \
dbus-1 >= $DBUS_REQUIRED \
diff --git a/src/Makefile.am b/src/Makefile.am
index 2949a86..92255be 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -14,6 +14,7 @@ SELFTEST_LIBS = \
INCLUDES = \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
+ $(SQLITE_CFLAGS) \
$(POLKIT_CFLAGS) \
$(NM_CFLAGS) \
-DBINDIR=\"$(bindir)\" \
@@ -60,6 +61,7 @@ packagekitd_LDADD = \
$(GLIB_LIBS) \
$(GMODULE_LIBS) \
$(DBUS_LIBS) \
+ $(SQLITE_LIBS) \
$(PK_LIBS) \
$(LIBNM_LIBS) \
$(POLKIT_LIBS) \
diff-tree b2e6a38966c7a3cd8c20e4288d8bcce7baf501b2 (from 124fa755bb295c68ef091d0723b3d05b0a12524a)
Author: Richard Hughes <richard at hughsie.com>
Date: Wed Sep 12 18:30:52 2007 +0100
don't segfault when we pass in null data to get_job_role
diff --git a/src/pk-backend.c b/src/pk-backend.c
index 03e18ab..9615c50 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -672,8 +672,12 @@ pk_backend_get_job_role (PkBackend *back
pk_warning ("Not assigned");
return FALSE;
}
- *role = backend->priv->role;
- *package_id = g_strdup (backend->priv->package_id);
+ if (role != NULL) {
+ *role = backend->priv->role;
+ }
+ if (package_id != NULL) {
+ *package_id = g_strdup (backend->priv->package_id);
+ }
return TRUE;
}
diff-tree 124fa755bb295c68ef091d0723b3d05b0a12524a (from 0d8041532589461b0850c14282df27428cc7f95e)
Author: Tim Lauridsen <tla at rasmil.dk>
Date: Wed Sep 12 09:26:53 2007 +0200
Implemented 'search-file' in yum backend
diff --git a/backends/BACKENDS b/backends/BACKENDS
index 6ee54b2..f6dcb13 100644
--- a/backends/BACKENDS
+++ b/backends/BACKENDS
@@ -11,7 +11,7 @@ install | | X |
remove | | X | | | |
get-deps | | X | | | |
get-description | X | X | X | X | |
-search-file | | | | X | |
+search-file | | X | | X | |
get-requeres | | | | | |
search-group | | | | | |
| | | | | |
diff --git a/backends/yum/helpers/search-file.py b/backends/yum/helpers/search-file.py
index 2066526..8241aee 100755
--- a/backends/yum/helpers/search-file.py
+++ b/backends/yum/helpers/search-file.py
@@ -18,6 +18,6 @@ searchterms = sys.argv[2]
from yumBackend import PackageKitYumBackend
backend = PackageKitYumBackend(sys.argv[1:])
-backend.search_group(options,searchterms)
+backend.search_file(options,searchterms)
sys.exit(0)
diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 34ad246..0456527 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -135,6 +135,7 @@ class PackageKitYumBackend(PackageKitBas
#
#
return isDevel == wantDevel
+
def search_name(self,filters,key):
'''
@@ -160,8 +161,29 @@ class PackageKitYumBackend(PackageKitBas
'''
Implement the {backend}-search-file functionality
'''
- self.error(ERROR_NOT_SUPPORTED,"This function is not implemented in this backend")
-
+ self._setup_yum()
+ #self.yumbase.conf.cache = 1 # Only look in cache.
+ fltlist = filters.split(';')
+ found = {}
+ if not '~installed' in fltlist:
+ # Check installed for file
+ for pkg in self.yumbase.rpmdb:
+ filelist = pkg.filelist
+ for fn in filelist:
+ if key in fn and not found.has_key(str(pkg)):
+ self._show_package(pkg, 1)
+ found[str(pkg)] = 1
+ if not 'installed' in fltlist:
+ # Check available for file
+ self.yumbase.repos.populateSack(mdtype='filelists')
+ for pkg in self.yumbase.pkgSack:
+ filelist = pkg.filelist
+ for fn in filelist:
+ if key in fn and not found.has_key(str(pkg)):
+ self._show_package(pkg, 1)
+ found[str(pkg)] = 1
+
+
def _getEVR(self,idver):
'''
get the e,v,r from the package id version
diff-tree 0d8041532589461b0850c14282df27428cc7f95e (from bee68b3a8b5d4f729a02bc765e38a083a7c04383)
Author: Tim Lauridsen <tla at rasmil.dk>
Date: Wed Sep 12 08:20:03 2007 +0200
Updated BACKENDS (yum)
diff --git a/backends/BACKENDS b/backends/BACKENDS
index 82ba119..6ee54b2 100644
--- a/backends/BACKENDS
+++ b/backends/BACKENDS
@@ -10,5 +10,9 @@ update-system | | X |
install | | X | | | |
remove | | X | | | |
get-deps | | X | | | |
-get-description | X | | X | X | |
+get-description | X | X | X | X | |
search-file | | | | X | |
+get-requeres | | | | | |
+search-group | | | | | |
+ | | | | | |
+
\ No newline at end of file
More information about the PackageKit
mailing list