[PackageKit-commit] packagekit: Branch 'master' - 42 commits
Richard Hughes
hughsient at kemper.freedesktop.org
Mon Jun 29 06:47:26 PDT 2009
Makefile.am | 1
backends/apt.deprecated/.gitignore | 10
backends/apt.deprecated/Makefile.am | 30 -
backends/apt.deprecated/aptBackend.py | 534 ---------------------
backends/apt.deprecated/packagekit | 1
backends/apt.deprecated/pk-apt-build-db.cpp | 284 -----------
backends/apt.deprecated/pk-apt-build-db.h | 30 -
backends/apt.deprecated/pk-apt-search-plain.c | 106 ----
backends/apt.deprecated/pk-apt-search-sqlite.cpp | 135 -----
backends/apt.deprecated/pk-apt-search.h | 36 -
backends/apt.deprecated/pk-backend-apt.c | 263 ----------
backends/apt.deprecated/pk-sqlite-pkg-cache.cpp | 215 --------
backends/apt.deprecated/pk-sqlite-pkg-cache.h | 42 -
backends/portage/portageBackend.py | 323 ++++++++----
backends/smart/pk-backend-smart.c | 1
backends/urpmi/helpers/urpmi-dispatched-backend.pl | 37 -
backends/urpmi/helpers/urpmi_backend/actions.pm | 10
backends/urpmi/helpers/urpmi_backend/groups.pm | 8
backends/yum/yumBackend.py | 56 --
backends/yum/yumFilter.py | 13
client/.gitignore | 2
client/Makefile.am | 27 +
client/pkcon.xml | 80 +++
client/pkgenpack.xml | 209 ++++++++
client/pkmon.xml | 80 +++
configure.ac | 1
contrib/PackageKit.spec.in | 5
contrib/debuginfo-install/.gitignore | 2
contrib/debuginfo-install/Makefile.am | 21
contrib/debuginfo-install/pk-debuginfo-install.c | 504 +++++++++++++++++--
contrib/debuginfo-install/pk-debuginfo-install.xml | 192 +++++++
lib/packagekit-glib/pk-client.c | 243 ++++++++-
lib/python/packagekit/backend.py | 17
man/.gitignore | 4
man/Makefile.am | 28 -
man/pkcon.xml | 80 ---
man/pkgenpack.xml | 209 --------
man/pkmon.xml | 80 ---
po/POTFILES.in | 1
po/mr.po | 477 +++++++++++++-----
po/pl.po | 204 +++++++-
src/org.freedesktop.PackageKit.Transaction.xml | 44 +
src/pk-polkit-action-lookup.c | 52 ++
src/pk-transaction.c | 100 ++-
44 files changed, 2258 insertions(+), 2539 deletions(-)
New commits:
commit 90f492b2dd0ae9ac3b93d092f5f80374c87f9136
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Jun 29 13:28:49 2009 +0100
Remove the apt.deprecated code, it's been broken for over a year
diff --git a/backends/apt.deprecated/.gitignore b/backends/apt.deprecated/.gitignore
deleted file mode 100644
index c851833..0000000
--- a/backends/apt.deprecated/.gitignore
+++ /dev/null
@@ -1,10 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-*.la
-*.lo
-*.loT
-*.o
-*~
-
diff --git a/backends/apt.deprecated/Makefile.am b/backends/apt.deprecated/Makefile.am
deleted file mode 100644
index 8262223..0000000
--- a/backends/apt.deprecated/Makefile.am
+++ /dev/null
@@ -1,30 +0,0 @@
-NULL =
-
-SUBDIRS = helpers
-plugindir = $(PK_PLUGIN_DIR)
-plugin_LTLIBRARIES = libpk_backend_apt.la
-
-libpk_backend_apt_la_LIBADD = $(PK_PLUGIN_LIBS)
-libpk_backend_apt_la_LDFLAGS = -module -avoid-version $(APT_LIBS)
-libpk_backend_apt_la_CFLAGS = $(PK_PLUGIN_CFLAGS) $(APT_CFLAGS) $(WARNINGFLAGS_CPP)
-libpk_backend_apt_la_CXXFLAGS = $(PK_PLUGIN_CFLAGS) $(APT_CFLAGS) -DPK_DB_DIR=\""$(PK_DB_DIR)"\"
-
-libpk_backend_apt_la_SOURCES = \
- pk-backend-apt.c \
- pk-apt-search.h \
- $(NULL)
-
-if APT_SEARCH_PLAIN
-libpk_backend_apt_la_SOURCES += \
- pk-apt-search-plain.c \
- $(NULL)
-endif
-
-if APT_SEARCH_SQLITE
-libpk_backend_apt_la_SOURCES += \
- pk-sqlite-pkg-cache.h \
- pk-sqlite-pkg-cache.cpp \
- pk-apt-build-db.cpp \
- pk-apt-search-sqlite.cpp \
- $(NULL)
-endif
diff --git a/backends/apt.deprecated/aptBackend.py b/backends/apt.deprecated/aptBackend.py
deleted file mode 100644
index 2f79238..0000000
--- a/backends/apt.deprecated/aptBackend.py
+++ /dev/null
@@ -1,534 +0,0 @@
-#
-# vim: ts=4 et sts=4
-#
-# Copyright (C) 2007 Ali Sabil <ali.sabil at gmail.com>
-# Copyright (C) 2007 Tom Parker <palfrey at tevp.net>
-#
-# Licensed under the GNU General Public License Version 2
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-
-import sys
-import os
-import re
-
-from packagekit.backend import *
-import apt_pkg,apt_inst
-
-import warnings
-warnings.filterwarnings(action='ignore', category=FutureWarning)
-import apt
-from aptsources.distro import get_distro
-from aptsources.sourceslist import SourcesList
-from sets import Set
-from os.path import join,exists
-from urlparse import urlparse
-from apt.debfile import DebPackage
-from os import system
-
-class Package(apt.Package):
- def __str__(self):
- return "Package %s, version %s"%(self.name,self._version)
-
- def _cmp_deps(self,deps, version):
- for (v,c) in deps:
- if not apt_pkg.CheckDep(version,c,v):
- return False
- return True
-
- def __init__(self, backend, pkg, data="",version=[]):
- apt.package.Package.__init__(self, pkg._cache, pkg._depcache,
- pkg._records, pkg._list, pkg._pcache,
- pkg._pkg)
- self._version = version
- self._data = data
- self._backend = backend
- wanted_ver = None
- if self.installedVersion!=None and self._cmp_deps(version,self.installedVersion):
- wanted_ver = self.installedVersion
- elif self.installedVersion == None and version == []:
- #self.markInstall(False,False)
- wanted_ver = self.candidateVersion
-
- for ver in pkg._pkg.VersionList:
- #print "vers",dir(ver),version,ver
- #print data
- if (wanted_ver == None or wanted_ver == ver.VerStr) and self._cmp_deps(version,ver.VerStr):
- f, index = ver.FileList.pop(0)
- if self._data == "":
- if f.Origin=="" and f.Archive=="now":
- self._data = "local_install"
- elif f.Origin!="" or f.Archive!="":
- self._data = "%s/%s"%(f.Origin.replace("/","_"),f.Archive.replace("/","_"))
- else:
- self._data = "%s/unknown"%f.Site
- self._version = ver.VerStr
- break
- else:
- print "wanted",wanted_ver
- for ver in pkg._pkg.VersionList:
- print "vers",version,ver.VerStr
- backend.error(ERROR_PACKAGE_NOT_FOUND, "Can't find version %s for %s"%(version,self.name))
-
- def setVersion(self,version,compare="="):
- if version!=None and (self.installedVersion == None or not apt_pkg.CheckDep(version,compare,self.installedVersion)):
- self.markInstall(False,False)
- if self.candidateVersion != version:
- if self._data == "":
- for ver in pkg._pkg.VersionList:
- f, index = ver.FileList.pop(0)
- self._data = "%s/%s"%(f.Origin,f.Archive)
- if ver.VerStr == version:
- break
-
- # FIXME: this is a nasty hack, assuming that the best way to resolve
- # deps for non-default repos is by switching the default release.
- # We really need a better resolver (but that's hard)
- assert self._data!=""
- origin = self._data[self._data.find("/")+1:]
- print "origin",origin
- name = self.name
- apt_pkg.Config.Set("APT::Default-Release",origin)
- if not self._backend._caches.has_key(origin):
- self._backend._caches[origin] = apt.Cache(PackageKitProgress(self))
- print "new cache for %s"%origin
- self.__setParent(self._backend._caches[origin][name])
- self.markInstall(False,False)
- if not apt_pkg.CheckDep(self.candidateVersion,compare,version):
- self._backend.error(ERROR_PACKAGE_NOT_FOUND,
- "Unable to locate package version %s (only got %s) for %s"%(version,self.candidateVersion,name))
- return
- self.markKeep()
-
- @property
- def group(self):
- section = self.section.split('/')[-1].lower()
- #if section in ():
- # return GROUP_ACCESSIBILITY
- if section in ('utils',):
- return "accessories"
- #if section in ():
- # return GROUP_EDUCATION
- if section in ('games',):
- return "games"
- if section in ('graphics',):
- return "graphics"
- if section in ('net', 'news', 'web', 'comm'):
- return "internet"
- if section in ('editors', 'tex'):
- return "office"
- if section in ('misc',):
- return "other"
- if section in ('devel', 'libdevel', 'interpreters', 'perl', 'python'):
- return "programming"
- if section in ('sound',):
- return "multimedia"
- if section in ('base', 'admin'):
- return "system"
- return "unknown"
-
- @property
- def isInstalled(self):
- return super(self.__class__,self).isInstalled and self.installedVersion == self._version
-
- @property
- def isDevelopment(self):
- name = self.name.lower()
- section = self.section.split('/')[-1].lower()
- return name.endswith('-dev') or name.endswith('-dbg') or \
- section in ('devel', 'libdevel')
-
- @property
- def isGui(self):
- section = self.section.split('/')[-1].lower()
- return section in ('x11', 'gnome', 'kde')
-
- _HYPHEN_PATTERN = re.compile(r'(\s|_)+')
-
- def matchName(self, name):
- needle = name.strip().lower()
- haystack = self.name.lower()
- needle = Package._HYPHEN_PATTERN.sub('-', needle)
- haystack = Package._HYPHEN_PATTERN.sub('-', haystack)
- if haystack.find(needle) >= 0:
- return True
- return False
-
- def matchDetails(self, details):
- if self.matchName(details):
- return True
- needle = details.strip().lower()
- haystack = self.description.lower()
- if haystack.find(needle) >= 0:
- return True
- return False
-
- def matchGroup(self, name):
- needle = name.strip().lower()
- haystack = self.group
- if haystack.startswith(needle):
- return True
- return False
-
-class PackageKitProgress(apt.progress.OpProgress, apt.progress.FetchProgress):
- def __init__(self, backend):
- self._backend = backend
- apt.progress.OpProgress.__init__(self)
- apt.progress.FetchProgress.__init__(self)
-
- # OpProgress callbacks
- def update(self, percent):
- pass
-
- def done(self):
- pass
-
- # FetchProgress callbacks
- def pulse(self):
- apt.progress.FetchProgress.pulse(self)
- self._backend.percentage(self.percent)
- return True
-
- def stop(self):
- self._backend.percentage(100)
-
- def mediaChange(self, medium, drive):
- # This probably should not be an error, but a Message.
- self._backend.error(ERROR_UNKNOWN,
- "Medium change needed")
-
-class PackageKitAptBackend(PackageKitBaseBackend):
- def __init__(self, args):
- PackageKitBaseBackend.__init__(self, args)
- self.status(STATUS_SETUP)
- self._caches = {}
- self._apt_cache = apt.Cache(PackageKitProgress(self))
- default = apt_pkg.Config.Find("APT::Default-Release")
- if default=="":
- d = get_distro()
- if d.id == "Debian":
- default = "stable"
- elif d.id == "Ubuntu":
- default = "main"
- else:
- raise Exception,d.id
-
- self._caches[default] = self._apt_cache
-
-
- def search_name(self, filters, key):
- '''
- Implement the {backend}-search-name functionality
- '''
- self.status(STATUS_INFO)
- self.allow_cancel(True)
- for package in self._do_search(filters,
- lambda pkg: pkg.matchName(key)):
- self._emit_package(package)
-
- def search_details(self, filters, key):
- '''
- Implement the {backend}-search-details functionality
- '''
- self.status(STATUS_INFO)
- self.allow_cancel(True)
- for package in self._do_search(filters,
- lambda pkg: pkg.matchDetails(key)):
- self._emit_package(package)
-
- def search_group(self, filters, key):
- '''
- Implement the {backend}-search-group functionality
- '''
- self.status(STATUS_INFO)
- self.allow_cancel(True)
- for package in self._do_search(filters,
- lambda pkg: pkg.matchGroup(key)):
- self._emit_package(package)
-
- def search_file(self, filters, key):
- '''
- Implement the {backend}-search-file functionality
- '''
- self.allow_cancel(True)
- self.percentage(None)
-
- self.error(ERROR_NOT_SUPPORTED,
- "This function is not implemented in this backend")
-
- def refresh_cache(self, force):
- '''
- Implement the {backend}-refresh_cache functionality
- '''
- # TODO: use force ?
- self.status(STATUS_REFRESH_CACHE)
- try:
- res = self._apt_cache.update(PackageKitProgress(self))
- except Exception, error_message:
- self.error(ERROR_UNKNOWN,
- "Failed to fetch the following items:\n%s" % error_message)
- return res
-
- def get_details(self, package):
- '''
- Implement the {backend}-get-details functionality
- '''
- self.status(STATUS_INFO)
- name, version, arch, data = self.get_package_from_id(package)
- pkg = Package(self, self._apt_cache[name])
- description = re.sub('\s+', ' ', pkg.description).strip()
- self.description(package, 'unknown', pkg.group, description,
- pkg.architecture, pkg.packageSize)
-
- def resolve(self, name):
- '''
- Implement the {backend}-resolve functionality
- '''
- self.status(STATUS_INFO)
- try:
- pkg = Package(self,self._apt_cache[name])
- self._emit_package(pkg)
- except KeyError:
- self.error(ERROR_PACKAGE_NOT_FOUND,"Can't find a package called '%s'"%name)
-
- def _do_deps(self,inp,deps,recursive):
- inp.markInstall()
- newkeys = []
- for x in inp.candidateDependencies:
- n = x.or_dependencies[0].name
- if not deps.has_key(n):
- deps[n] = []
- newkeys.append(n)
- deps[n].append((x.or_dependencies[0].version,x.or_dependencies[0].relation))
- if recursive:
- for n in newkeys:
- try:
- deps = self._do_deps(Package(self,self._apt_cache[n],version=deps[n]),deps,recursive)
- except KeyError: # FIXME: we're assuming this is a virtual package, which we can't cope with yet
- del deps[n]
- continue
- return deps
-
- def get_depends(self,filters,package, recursive):
- '''
- Implement the {backend}-get-depends functionality
- '''
- self.allow_cancel(True)
- self.status(STATUS_INFO)
- name, version, arch, data = self.get_package_from_id(package)
- pkg = Package(self,self._apt_cache[name],version=[(version,"=")],data=data)
- pkg.setVersion(version)
- deps = self._do_deps(pkg, {}, recursive)
- for n in deps.keys():
- self._emit_package(Package(self,self._apt_cache[n],version=deps[n]))
-
- def _do_reqs(self,inp,pkgs,recursive):
- extra = []
- fails = []
- for r in inp._pkg.RevDependsList:
- ch = apt_pkg.CheckDep(inp._version,r.CompType,r.TargetVer)
- v = (r.ParentPkg.Name,r.ParentVer.VerStr)
- if not ch or v in fails:
- #print "skip",r.TargetVer,r.CompType,r.ParentPkg.Name,r.ParentVer.VerStr
- fails.append(v)
- continue
- p = Package(self,self._apt_cache[r.ParentPkg.Name],r.ParentVer.VerStr)
- if v not in pkgs:
- extra.append(p)
- #print "new pkg",p
- self._emit_package(p)
- pkgs.add(v)
- if recursive:
- for e in extra:
- pkgs = self._do_reqs(p, pkgs,recursive)
- return pkgs
-
- def get_requires(self,package,recursive):
- '''
- Implement the {backend}-get-requires functionality
- '''
- self.allow_cancel(True)
- self.status(STATUS_INFO)
- name, version, arch, data = self.get_package_from_id(package)
- pkg = Package(self,self._apt_cache[name], version=[(version,"=")], data=data)
-
- pkgs = Set()
- self._do_reqs(pkg,pkgs, recursive)
-
- def _build_repo_list(self):
- repo = {}
-
- sources = SourcesList()
- repo["__sources"] = sources
-
- root = apt_pkg.Config.FindDir("Dir::State::Lists")
- #print root
- for entry in sources:
- if entry.type!="":
- url = entry.uri
- #if entry.template!=None:
- url +="/dists/"
- url += entry.dist
- url = url.replace("//dists","/dists")
- #print url
- path = join(root,"%s_Release"%(apt_pkg.URItoFileName(url)))
- if not exists(path):
- #print path
- name = "%s/unknown"%urlparse(entry.uri)[1]
- else:
- lines = file(path).readlines()
- origin = ""
- suite = ""
- for l in lines:
- if l.find("Origin: ")==0:
- origin = l.split(" ",1)[1].strip()
- elif l.find("Suite: ")==0:
- suite = l.split(" ",1)[1].strip()
- assert origin!="" and suite!=""
- name = "%s/%s"%(origin,suite)
- if entry.type == "deb-src":
- name += "-src"
-
- repo[name] = {"entry":entry}
- return repo
-
- def get_repo_list(self, filters):
- '''
- Implement the {backend}-get-repo-list functionality
- '''
- self.allow_interrupt(True)
- self.status(STATUS_INFO)
- repo = self._build_repo_list()
- for e in repo.keys():
- if e == "__sources":
- continue
- self.repo_detail(repo[e]["entry"].line.strip(),e,not repo[e]["entry"].disabled)
-
- def repo_enable(self, repoid, enable):
- '''
- Implement the {backend}-repo-enable functionality
- '''
- repo = self._build_repo_list()
- if not repo.has_key(repoid):
- self.error(ERROR_REPO_NOT_FOUND,"Couldn't find repo '%s'"%repoid)
- return
- r = repo[repoid]
- if not r["entry"].disabled == enable: # already there
- return
- r["entry"].set_enabled(enable)
- try:
- repo["__sources"].save()
- except IOError,e:
- self.error(ERROR_UNKNOWN, "Problem while trying to save repo settings to %s: %s"%(e.filename,e.strerror))
-
- def get_updates(self, filter):
- self._apt_cache.upgrade(False)
- for pkg in self._apt_cache.getChanges():
- self._emit_package(Package(self, pkg))
-
- def get_update_detail(self, package):
- self.allow_cancel(True)
- self.percentage(None)
- self.status(STATUS_INFO)
- name, version, arch, data = self.get_package_from_id(package)
- update = ""
- obsolete = ""
- cve_url = ""
- bz_url = ""
- vendor_url = ""
- reboot = "none"
- desc = self._apt_cache[name].description
- self.update_detail(package,update,obsolete,vendor_url,bz_url,cve_url,reboot,desc)
-
-
- def install_files (self, inst_files):
- '''
- Implement the {backend}-install_files functionality
- Install the package containing the inst_file file
- '''
- if not exists(inst_file):
- self.error(ERROR_PACKAGE_NOT_FOUND,"Can't find %s"%inst_file)
- return
- deb = DebPackage(inst_file)
- deps = {}
- for k in ["Depends","Recommends"]:
- if not deb._sections.has_key(k):
- continue
- for items in apt_pkg.ParseDepends(deb[k]):
- assert len(items) == 1,"Can't handle or deps properly yet"
- (pkg,ver,comp) = items[0]
- if not deps.has_key(pkg):
- deps[pkg] = []
- deps[pkg].append((ver,comp))
- for n in deps.keys():
- p = Package(self,self._apt_cache[n],version=deps[n])
- if not p.isInstalled:
- p.markInstall()
- assert self._apt_cache.getChanges()==[],"Don't handle install changes yet"
- # FIXME: nasty hack. Need a better way in
- ret = system("dpkg -i %s"%inst_file)
- if ret!=0:
- self.error(ERROR_UNKNOWN,"Can't install package")
-
- ### Helpers ###
- def _emit_package(self, package):
- id = self.get_package_id(package.name,
- package._version,
- package.architecture,
- package._data)
- if package.isInstalled:
- status = INFO_INSTALLED
- else:
- status = INFO_AVAILABLE
- summary = package.summary
- self.package(id, status, summary)
-
- def _do_search(self, filters, condition):
- filters = filters.split(';')
- size = len(self._apt_cache)
- percentage = 0
- for i, pkg in enumerate(self._apt_cache):
- new_percentage = i / float(size) * 100
- if new_percentage - percentage >= 5:
- percentage = new_percentage
- self.percentage(percentage)
- package = Package(self, pkg)
- if package.installedVersion is None and \
- package.candidateVersion is None:
- continue
- if not condition(package):
- continue
- continue
- vers = [x.VerStr for x in package._pkg.VersionList]
- if package.installedVersion!=None:
- i = package.installedVersion
- if i in vers and vers[0]!=i:
- del vers[vers.index(i)]
- vers.insert(0,i)
-
- for ver in vers:
- p = Package(self, package, version=[[ver,"="]])
- if self._do_filtering(p, filters):
- yield p
- self.percentage(100)
-
- def _do_filtering(self, package, filters):
- if len(filters) == 0 or filters == ['none']:
- return True
- if (FILTER_INSTALLED in filters) and (not package.isInstalled):
- return False
- if (FILTER_NOT_INSTALLED in filters) and package.isInstalled:
- return False
- if (FILTER_GUI in filters) and (not package.isGui):
- return False
- if (FILTER_NOT_GUI in filters) and package.isGui:
- return False
- if (FILTER_DEVELOPMENT in filters) and (not package.isDevelopment):
- return False
- if (FILTER_NOT_DEVELOPMENT in filters) and package.isDevelopment:
- return False
- return True
-
diff --git a/backends/apt.deprecated/packagekit b/backends/apt.deprecated/packagekit
deleted file mode 120000
index 2e8d949..0000000
--- a/backends/apt.deprecated/packagekit
+++ /dev/null
@@ -1 +0,0 @@
-../../lib/python/packagekit
\ No newline at end of file
diff --git a/backends/apt.deprecated/pk-apt-build-db.cpp b/backends/apt.deprecated/pk-apt-build-db.cpp
deleted file mode 100644
index 8e8699c..0000000
--- a/backends/apt.deprecated/pk-apt-build-db.cpp
+++ /dev/null
@@ -1,284 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2007 Tom Parker <palfrey at tevp.net>
- *
- * Licensed under the GNU General Public License Version 2
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-//#include "pk-backend-apt.h"
-#include <pk-backend.h>
-#include <apt-pkg/configuration.h>
-#include <sqlite3.h>
-
-typedef enum {FIELD_PKG=1,FIELD_VER,FIELD_DEPS,FIELD_ARCH,FIELD_SHORT,FIELD_LONG,FIELD_REPO} Fields;
-
-void apt_build_db(PkBackend * backend, sqlite3 *db)
-{
- GMatchInfo *match_info;
- GError *error = NULL;
- gchar *contents = NULL;
- gchar *sdir;
- const gchar *fname;
- GRegex *origin, *suite;
- GDir *dir;
- GHashTable *releases;
- int res;
- sqlite3_stmt *package = NULL;
-
- pk_backend_set_status(backend, PK_STATUS_ENUM_QUERY);
- pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID);
-
- sdir = g_build_filename(_config->Find("Dir").c_str(),_config->Find("Dir::State").c_str(),_config->Find("Dir::State::lists").c_str(), NULL);
- dir = g_dir_open(sdir,0,&error);
- if (error!=NULL)
- {
- pk_backend_error_code(backend, PK_ERROR_ENUM_INTERNAL_ERROR, "can't open %s",dir);
- g_error_free(error);
- goto search_task_cleanup;
- }
-
- origin = g_regex_new("^Origin: (\\S+)",(GRegexCompileFlags)(G_REGEX_CASELESS|G_REGEX_OPTIMIZE|G_REGEX_MULTILINE),(GRegexMatchFlags)0,NULL);
- suite = g_regex_new("^Suite: (\\S+)",(GRegexCompileFlags)(G_REGEX_CASELESS|G_REGEX_OPTIMIZE|G_REGEX_MULTILINE),(GRegexMatchFlags)0,NULL);
-
- releases = g_hash_table_new_full(g_str_hash,g_str_equal,g_free,g_free);
- while ((fname = g_dir_read_name(dir))!=NULL)
- {
- gchar *temp, *parsed_name;
- gchar** items = g_strsplit(fname,"_",-1);
- guint len = g_strv_length(items);
- if(len<=3) // minimum is <source>_<type>_<group>
- {
- g_strfreev(items);
- continue;
- }
-
- /* warning: nasty hack with g_strjoinv */
- temp = items[len-2];
- items[len-2] = NULL;
- parsed_name = g_strjoinv("_",items);
- items[len-2] = temp;
-
- if (g_ascii_strcasecmp(items[len-1],"Release")==0 && g_ascii_strcasecmp(items[len-2],"source")!=0)
- {
- gchar * repo = NULL, *fullname;
- fullname = g_build_filename(sdir,fname,NULL);
- if (g_file_get_contents(fullname,&contents,NULL,NULL) == FALSE)
- {
- pk_backend_error_code(backend, PK_ERROR_ENUM_INTERNAL_ERROR, "error loading %s",fullname);
- goto search_task_cleanup;
- }
- g_free(fullname);
-
- g_regex_match (origin, contents, (GRegexMatchFlags)0, &match_info);
- if (!g_match_info_matches(match_info))
- {
- pk_backend_error_code(backend, PK_ERROR_ENUM_INTERNAL_ERROR, "origin regex failure in %s",fname);
- goto search_task_cleanup;
- }
- repo = g_match_info_fetch (match_info, 1);
-
- g_regex_match (suite, contents, (GRegexMatchFlags)0, &match_info);
- if (g_match_info_matches(match_info))
- {
- temp = g_strconcat(repo,"/",g_match_info_fetch (match_info, 1),NULL);
- g_free(repo);
- repo = temp;
- }
-
- temp = parsed_name;
- parsed_name = g_strconcat(temp,"_",items[len-2],NULL);
- g_free(temp);
-
- egg_debug("type is %s, group is %s, parsed_name is %s",items[len-2],items[len-1],parsed_name);
-
- g_hash_table_insert(releases, parsed_name, repo);
- g_free(contents);
- contents = NULL;
- }
- else
- g_free(parsed_name);
- g_strfreev(items);
- }
- g_dir_close(dir);
-
- /* and then we need to do this again, but this time we're looking for the packages */
- dir = g_dir_open(sdir,0,&error);
- res = sqlite3_prepare_v2(db, "insert or replace into packages values (?,?,?,?,?,?,?)", -1, &package, NULL);
- if (res!=SQLITE_OK)
- egg_error("sqlite error during insert prepare: %s", sqlite3_errmsg(db));
- else
- egg_debug("insert prepare ok for %p",package);
- while ((fname = g_dir_read_name(dir))!=NULL)
- {
- gchar** items = g_strsplit(fname,"_",-1);
- guint len = g_strv_length(items);
- if(len<=3) // minimum is <source>_<type>_<group>
- {
- g_strfreev(items);
- continue;
- }
-
- if (g_ascii_strcasecmp(items[len-1],"Packages")==0)
- {
- const gchar *repo;
- gchar *temp=NULL, *parsed_name=NULL;
- gchar *fullname= NULL;
- gchar *begin=NULL, *next=NULL, *description = NULL;
- glong count = 0;
- gboolean haspk = FALSE;
-
- /* warning: nasty hack with g_strjoinv */
- if (g_str_has_prefix(items[len-2],"binary-"))
- {
- temp = items[len-3];
- items[len-3] = NULL;
- parsed_name = g_strjoinv("_",items);
- items[len-3] = temp;
- }
- else
- {
- temp = items[len-1];
- items[len-1] = NULL;
- parsed_name = g_strjoinv("_",items);
- items[len-1] = temp;
- }
-
- egg_debug("type is %s, group is %s, parsed_name is %s",items[len-2],items[len-1],parsed_name);
-
- repo = (const gchar *)g_hash_table_lookup(releases,parsed_name);
- if (repo == NULL)
- {
- egg_debug("Can't find repo for %s, marking as \"unknown\"",parsed_name);
- repo = g_strdup("unknown");
- //g_assert(0);
- }
- else
- egg_debug("repo for %s is %s",parsed_name,repo);
- g_free(parsed_name);
-
- fullname = g_build_filename(sdir,fname,NULL);
- egg_debug("loading %s",fullname);
- if (g_file_get_contents(fullname,&contents,NULL,NULL) == FALSE)
- {
- pk_backend_error_code(backend, PK_ERROR_ENUM_INTERNAL_ERROR, "error loading %s",fullname);
- goto search_task_cleanup;
- }
- /*else
- egg_debug("loaded");*/
-
- res = sqlite3_bind_text(package,FIELD_REPO,repo,-1,SQLITE_TRANSIENT);
- if (res!=SQLITE_OK)
- egg_error("sqlite error during repo bind: %s", sqlite3_errmsg(db));
- /*else
- egg_debug("repo bind ok");*/
-
- res = sqlite3_exec(db,"begin",NULL,NULL,NULL);
- g_assert(res == SQLITE_OK);
-
- begin = contents;
-
- while (true)
- {
- next = strstr(begin,"\n");
- if (next!=NULL)
- {
- next[0] = '\0';
- next++;
- }
-
- if (begin[0]=='\0')
- {
- if (haspk)
- {
- if (description!=NULL)
- {
- res=sqlite3_bind_text(package,FIELD_LONG,description,-1,SQLITE_TRANSIENT);
- if (res!=SQLITE_OK)
- egg_error("sqlite error during description bind: %s", sqlite3_errmsg(db));
- g_free(description);
- description = NULL;
- }
- res = sqlite3_step(package);
- if (res!=SQLITE_DONE)
- egg_error("sqlite error during step: %s", sqlite3_errmsg(db));
- sqlite3_reset(package);
- //egg_debug("added package");
- haspk = FALSE;
- }
- //g_assert(0);
- }
- else if (begin[0]==' ')
- {
- if (description == NULL)
- description = g_strdup(&begin[1]);
- else
- {
- gchar *oldval = description;
- description = g_strconcat(oldval, "\n",&begin[1],NULL);
- g_free(oldval);
- }
- }
- else
- {
- gchar *colon = strchr(begin,':');
- g_assert(colon!=NULL);
- colon[0] = '\0';
- colon+=2;
- /*if (strlen(colon)>3000)
- egg_error("strlen(colon) = %d\ncolon = %s",strlen(colon),colon);*/
- //egg_debug("entry = '%s','%s'",begin,colon);
- if (begin[0] == 'P' && g_strcasecmp("Package",begin)==0)
- {
- res=sqlite3_bind_text(package,FIELD_PKG,colon,-1,SQLITE_STATIC);
- haspk = TRUE;
- count++;
- if (count%1000==0)
- egg_debug("Package %ld (%s)",count,colon);
- }
- else if (begin[0] == 'V' && g_strcasecmp("Version",begin)==0)
- res=sqlite3_bind_text(package,FIELD_VER,colon,-1,SQLITE_STATIC);
- else if (begin[0] == 'D' && g_strcasecmp("Depends",begin)==0)
- res=sqlite3_bind_text(package,FIELD_DEPS,colon,-1,SQLITE_STATIC);
- else if (begin[0] == 'A' && g_strcasecmp("Architecture",begin)==0)
- res=sqlite3_bind_text(package,FIELD_ARCH,colon,-1,SQLITE_STATIC);
- else if (begin[0] == 'D' && g_strcasecmp("Description",begin)==0)
- res=sqlite3_bind_text(package,FIELD_SHORT,colon,-1,SQLITE_STATIC);
- if (res!=SQLITE_OK)
- egg_error("sqlite error during %s bind: %s", begin, sqlite3_errmsg(db));
- }
- if (next == NULL)
- break;
- begin = next;
- }
- res = sqlite3_exec(db,"commit",NULL,NULL,NULL);
- if (res!=SQLITE_OK)
- egg_error("sqlite error during commit: %s", sqlite3_errmsg(db));
- res = sqlite3_clear_bindings(package);
- if (res!=SQLITE_OK)
- egg_error("sqlite error during clear: %s", sqlite3_errmsg(db));
- g_free(contents);
- contents = NULL;
- }
- }
- sqlite3_finalize(package);
-
-search_task_cleanup:
- g_dir_close(dir);
- g_free(sdir);
- g_free(contents);
-}
-
diff --git a/backends/apt.deprecated/pk-apt-build-db.h b/backends/apt.deprecated/pk-apt-build-db.h
deleted file mode 100644
index bb786a9..0000000
--- a/backends/apt.deprecated/pk-apt-build-db.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef PK_APT_BUILD_DB
-#define PK_APT_BUILD_DB
-
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2007 Tom Parker <palfrey at tevp.net>
- *
- * Licensed under the GNU General Public License Version 2
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <sqlite3.h>
-#include <pk-backend.h>
-
-void apt_build_db(PkBackend * backend, sqlite3 *db);
-
-#endif
diff --git a/backends/apt.deprecated/pk-apt-search-plain.c b/backends/apt.deprecated/pk-apt-search-plain.c
deleted file mode 100644
index 24517fe..0000000
--- a/backends/apt.deprecated/pk-apt-search-plain.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2007 Ali Sabil <ali.sabil at gmail.com>
- *
- * Licensed under the GNU General Public License Version 2
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <gmodule.h>
-#include <glib.h>
-#include <string.h>
-#include <pk-backend.h>
-#include <pk-backend-spawn.h>
-
-extern PkBackendSpawn *spawn;
-
-/**
- * backend_get_groups:
- */
-static PkBitfield
-backend_get_groups (PkBackend *backend)
-{
- return (PK_GROUP_ENUM_ACCESSORIES |
- PK_GROUP_ENUM_GAMES |
- PK_GROUP_ENUM_GRAPHICS |
- PK_GROUP_ENUM_INTERNET |
- PK_GROUP_ENUM_OFFICE |
- PK_GROUP_ENUM_OTHER |
- PK_GROUP_ENUM_PROGRAMMING |
- PK_GROUP_ENUM_MULTIMEDIA |
- PK_GROUP_ENUM_SYSTEM);
-}
-
-/**
- * backend_get_filters:
- */
-static PkBitfield
-backend_get_filters (PkBackend *backend)
-{
- return (PK_FILTER_ENUM_GUI |
- PK_FILTER_ENUM_INSTALLED |
- PK_FILTER_ENUM_DEVELOPMENT);
-}
-
-/**
- * backend_get_details:
- */
-
-void
-backend_get_details (PkBackend *backend, const gchar *package_id)
-{
- pk_backend_spawn_helper (spawn, "get-details.py", package_id, NULL);
-}
-
-/**
- * backend_search_details:
- */
-
-void
-backend_search_details (PkBackend *backend, PkBitfield filters, const gchar *search)
-{
- gchar *filters_text;
- filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "search-details.py", filters_texts_text, search, NULL);
- g_free (filters_text);
-}
-
-/**
- * backend_search_name:
- */
-void
-backend_search_name (PkBackend *backend, PkBitfield filters, const gchar *search)
-{
- gchar *filters_text;
- filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "search-name.py", filters_text, search, NULL);
- g_free (filters_text);
-}
-
-/**
- * backend_search_group:
- */
-void
-backend_search_group (PkBackend *backend, PkBitfield filters, const gchar *search)
-{
- gchar *filters_text;
- pk_backend_spawn_helper (spawn, "search-group.py", filters_text, search, NULL);
- g_free (filters_text);
-}
-
-/* don't need to do any setup/finalize in the plain search mode */
-void backend_init_search(PkBackend *backend) {}
-void backend_finish_search(PkBackend *backend) {}
diff --git a/backends/apt.deprecated/pk-apt-search-sqlite.cpp b/backends/apt.deprecated/pk-apt-search-sqlite.cpp
deleted file mode 100644
index 1ab68a5..0000000
--- a/backends/apt.deprecated/pk-apt-search-sqlite.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2007 Ali Sabil <ali.sabil at gmail.com>
- *
- * Licensed under the GNU General Public License Version 2
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <gmodule.h>
-#include <glib.h>
-#include <string.h>
-#include <pk-backend.h>
-#include <pk-backend-spawn.h>
-#include "pk-sqlite-pkg-cache.h"
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/init.h>
-#include "pk-apt-build-db.h"
-
-static PkBackendSpawn *spawn;
-
-/**
- * backend_get_groups:
- */
-extern "C" PkGroupEnum
-backend_get_groups (PkBackend *backend)
-{
- return (PK_GROUP_ENUM_ACCESSORIES |
- PK_GROUP_ENUM_GAMES |
- PK_GROUP_ENUM_GRAPHICS |
- PK_GROUP_ENUM_INTERNET |
- PK_GROUP_ENUM_OFFICE |
- PK_GROUP_ENUM_OTHER |
- PK_GROUP_ENUM_PROGRAMMING |
- PK_GROUP_ENUM_MULTIMEDIA |
- PK_GROUP_ENUM_SYSTEM);
-}
-
-/**
- * backend_get_filters:
- */
-extern "C" PkBitfield
-backend_get_filters (PkBackend *backend)
-{
- return (PK_FILTER_ENUM_GUI |
- PK_FILTER_ENUM_INSTALLED |
- PK_FILTER_ENUM_DEVELOPMENT);
-}
-
-/**
- * backend_get_details:
- */
-
-extern "C" void
-backend_get_details (PkBackend *backend, const gchar *package_id)
-{
- sqlite_get_details(backend,package_id);
-}
-
-/**
- * backend_search_details:
- */
-
-extern "C" void
-backend_search_details (PkBackend *backend, const gchar *filter, const gchar *search)
-{
- sqlite_search_details(backend,filter,search);
-}
-
-/**
- * backend_search_name:
- */
-extern "C" void
-backend_search_name (PkBackend *backend, const gchar *filter, const gchar *search)
-{
- sqlite_search_name(backend,filter,search);
-}
-
-/**
- * backend_search_group:
- */
-extern "C" void
-backend_search_group (PkBackend *backend, const gchar *filter, const gchar *search)
-{
- pk_backend_set_allow_cancel (backend, TRUE);
- pk_backend_spawn_helper (spawn, "search-group.py", filter, search, NULL);
-}
-
-static gboolean inited = FALSE;
-
-#define APT_DB PK_DB_DIR "/apt.db"
-
-extern "C" void backend_init_search(PkBackend *backend)
-{
- if (!inited)
- {
- gchar *apt_fname = NULL;
- if (pkgInitConfig(*_config) == false)
- egg_debug("pkginitconfig was false");
- if (pkgInitSystem(*_config, _system) == false)
- egg_debug("pkginitsystem was false");
-
- apt_fname = g_strconcat(
- _config->Find("Dir").c_str(),
- _config->Find("Dir::Cache").c_str(),
- _config->Find("Dir::Cache::pkgcache").c_str(),
- NULL);
-
- //sqlite_set_installed_check(is_installed);
- sqlite_init_cache(backend, APT_DB, apt_fname, apt_build_db);
- g_free(apt_fname);
-
- spawn = pk_backend_spawn_new ();
- pk_backend_spawn_set_name (spawn, "apt-sqlite");
-
- inited = TRUE;
- }
-}
-
-extern "C" void backend_finish_search(PkBackend *backend)
-{
- sqlite_finish_cache(backend);
-}
diff --git a/backends/apt.deprecated/pk-apt-search.h b/backends/apt.deprecated/pk-apt-search.h
deleted file mode 100644
index e36e89f..0000000
--- a/backends/apt.deprecated/pk-apt-search.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2007 Tom Parker <palfrey at tevp.net>
- *
- * Licensed under the GNU General Public License Version 2
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __PK_APT_SEARCH_H
-#define __PK_APT_SEARCH_H
-
-#include <glib.h>
-#include <pk-backend.h>
-
-void backend_init_search(PkBackend *backend);
-void backend_finish_search(PkBackend *backend);
-
-void backend_get_details (PkBackend *backend, const gchar *package_id);
-void backend_search_details (PkBackend *backend, const gchar *filter, const gchar *search);
-void backend_search_name (PkBackend *backend, const gchar *filter, const gchar *search);
-void backend_search_group (PkBackend *backend, const gchar *filter, const gchar *search);
-
-#endif
diff --git a/backends/apt.deprecated/pk-backend-apt.c b/backends/apt.deprecated/pk-backend-apt.c
deleted file mode 100644
index 7b57637..0000000
--- a/backends/apt.deprecated/pk-backend-apt.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2007 Ali Sabil <ali.sabil at gmail.com>
- * Copyright (C) 2007 Tom Parker <palfrey at tevp.net>
- *
- * Licensed under the GNU General Public License Version 2
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <gmodule.h>
-#include <glib.h>
-#include <string.h>
-#include <pk-backend.h>
-#include <pk-backend-spawn.h>
-#include <packagekit-glib/packagekit.h>
-#include "pk-apt-search.h"
-#include "config.h"
-
-PkBackendSpawn *spawn;
-
-/**
- * backend_initialize:
- * This should only be run once per backend load, i.e. not every transaction
- */
-static void
-backend_initialize (PkBackend *backend)
-{
- egg_debug ("backend: initialize");
- spawn = pk_backend_spawn_new ();
- pk_backend_spawn_set_name (spawn, "apt");
- backend_init_search (backend);
-}
-
-/**
- * backend_destroy:
- * This should only be run once per backend load, i.e. not every transaction
- */
-static void
-backend_destroy (PkBackend *backend)
-{
- egg_debug ("backend: destroy");
- backend_finish_search (backend);
- g_object_unref (spawn);
-}
-
-/**
- * backend_get_groups:
- */
-static PkBitfield
-backend_get_groups (PkBackend *backend)
-{
- return pk_bitfield_from_enums (
- PK_GROUP_ENUM_ACCESSORIES,
- PK_GROUP_ENUM_GAMES,
- PK_GROUP_ENUM_GRAPHICS,
- PK_GROUP_ENUM_INTERNET,
- PK_GROUP_ENUM_OFFICE,
- PK_GROUP_ENUM_OTHER,
- PK_GROUP_ENUM_PROGRAMMING,
- PK_GROUP_ENUM_MULTIMEDIA,
- PK_GROUP_ENUM_SYSTEM,
- -1);
-}
-
-/**
- * backend_get_filters:
- */
-static PkBitfield
-backend_get_filters (PkBackend *backend)
-{
- return pk_bitfield_from_enums (
- PK_FILTER_ENUM_GUI,
- PK_FILTER_ENUM_INSTALLED,
- PK_FILTER_ENUM_DEVELOPMENT,
- -1);
-}
-
-/**
- * backend_get_depends:
- */
-static void
-backend_get_depends (PkBackend *backend, PkBitfield filters, gchar **package_ids, gboolean recursive)
-{
- gchar *filters_text;
- filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "aptBackend.py", "get-depends", filters_text, package_id, pk_backend_bool_to_text (recursive), NULL);
- g_free (filters_text);
-}
-
-/**
- * backend_get_updates:
- */
-static void
-backend_get_updates (PkBackend *backend, PkBitfield filters)
-{
- gchar *filters_text;
- filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "aptBackend.py", "get-updates", filters_text, NULL);
- g_free (filters_text);
-}
-
-/**
- * backend_get_update_detail:
- */
-static void
-backend_get_update_detail (PkBackend *backend, gchar **package_ids)
-{
- pk_backend_spawn_helper (spawn, "aptBackend.py", "get-update-detail", package_id, NULL);
-}
-
-/**
- * backend_install_packages:
- */
-static void
-backend_install_packages (PkBackend *backend, gchar **package_ids)
-{
- gchar *package_ids_temp;
-
- /* check network state */
- if (!pk_backend_is_online (backend)) {
- pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot install when offline");
- pk_backend_finished (backend);
- return;
- }
-
- /* send the complete list as stdin */
- package_ids_temp = pk_package_ids_to_text (package_ids);
- pk_backend_spawn_helper (spawn, "aptBackend.py", "install-packages", package_ids_temp, NULL);
- g_free (package_ids_temp);
-}
-
-/**
- * backend_refresh_cache:
- */
-static void
-backend_refresh_cache (PkBackend *backend, gboolean force)
-{
- /* check network state */
- if (!pk_backend_is_online (backend)) {
- pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot refresh cache whilst offline");
- pk_backend_finished (backend);
- return;
- }
-
- pk_backend_spawn_helper (spawn, "aptBackend.py", "refresh-cache", pk_backend_bool_to_text (force), NULL);
-}
-
-/**
- * pk_backend_remove_packages:
- *
-static void
-backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
-{
- gchar *package_ids_temp;
- package_ids_temp = pk_package_ids_to_text (package_ids);
- pk_backend_spawn_helper (spawn, "aptBackend.py", "remove-packages", pk_backend_bool_to_text (allow_deps), package_ids_temp, NULL);
- g_free (package_ids_temp);
-} */
-
-/**
- * pk_backend_update_packages:
- */
-static void
-backend_update_packages (PkBackend *backend, gchar **package_ids)
-{
- gchar *package_ids_temp;
-
- /* check network state */
- if (!pk_backend_is_online (backend)) {
- pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot install when offline");
- pk_backend_finished (backend);
- return;
- }
-
- /* send the complete list as stdin */
- package_ids_temp = pk_package_ids_to_text (package_ids);
- pk_backend_spawn_helper (spawn, "aptBackend.py", "update-packages", package_ids_temp, NULL);
- g_free (package_ids_temp);
-}
-
-/**
- * pk_backend_update_system:
- */
-static void
-backend_update_system (PkBackend *backend)
-{
- pk_backend_spawn_helper (spawn, "aptBackend.py", "update-system", NULL);
-}
-
-/**
- * pk_backend_resolve:
- */
-static void
-backend_resolve (PkBackend *backend, PkBitfield filters, gchar **package_ids)
-{
- gchar *filters_text;
- filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "aptBackend.py", "resolve", filters_text, package_id, NULL);
- g_free (filters_text);
-}
-
-/**
- * pk_backend_get_repo_list:
- */
-static void
-backend_get_repo_list (PkBackend *backend, PkBitfield filters)
-{
- gchar *filters_text;
- filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "aptBackend.py", "get-repo-list", filters_text, NULL);
- g_free (filters_text);
-}
-
-PK_BACKEND_OPTIONS (
- "Apt (with " APT_SEARCH " searching)", /* description */
- "Ali Sabil <ali.sabil at gmail.com>; Tom Parker <palfrey at tevp.net>", /* author */
- backend_initialize, /* initalize */
- backend_destroy, /* destroy */
- backend_get_groups, /* get_groups */
- backend_get_filters, /* get_filters */
- NULL, /* get_mime_types */
- NULL, /* cancel */
- NULL, /* download_packages */
- NULL, /* get_categories */
- backend_get_depends, /* get_depends */
- backend_get_details, /* get_details */
- NULL, /* get_distro_upgrades */
- NULL, /* get_files */
- NULL, /* get_packages */
- backend_get_repo_list, /* get_repo_list */
- NULL, /* get_requires */
- backend_get_update_detail, /* get_update_detail */
- backend_get_updates, /* get_updates */
- NULL, /* install_files */
- backend_install_packages, /* install_packages */
- NULL, /* install_signature */
- backend_refresh_cache, /* refresh_cache */
- NULL, /* remove_packages */
- NULL, /* repo_enable */
- NULL, /* repo_set_data */
- backend_resolve, /* resolve */
- NULL, /* rollback */
- backend_search_details, /* search_details */
- NULL, /* search_file */
- backend_search_group, /* search_group */
- backend_search_name, /* search_name */
- backend_update_package, /* update_package */
- backend_update_system, /* update_system */
- NULL /* what_provides */
-);
diff --git a/backends/apt.deprecated/pk-sqlite-pkg-cache.cpp b/backends/apt.deprecated/pk-sqlite-pkg-cache.cpp
deleted file mode 100644
index b4ec001..0000000
--- a/backends/apt.deprecated/pk-sqlite-pkg-cache.cpp
+++ /dev/null
@@ -1,215 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2007 Tom Parker <palfrey at tevp.net>
- *
- * Licensed under the GNU General Public License Version 2
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <glib.h>
-#include <glib/gstdio.h>
-#include "pk-sqlite-pkg-cache.h"
-
-static sqlite3 *db = NULL;
-static PkBackend *backend;
-static gboolean(*is_installed) (const PkPackageId *) = NULL;
-
-void sqlite_set_installed_check(gboolean(*func) (const PkPackageId *))
-{
- is_installed = func;
-}
-
-void
-sqlite_init_cache(PkBackend *backend, const char* dbname, const char *compare_fname, void (*build_db)(PkBackend *, sqlite3 *))
-{
- int ret;
- struct stat st;
- time_t db_age;
-
- ret = sqlite3_open (dbname, &db);
- g_assert(ret == SQLITE_OK);
- g_assert(db!=NULL);
- ret = sqlite3_exec(db,"PRAGMA synchronous = OFF",NULL,NULL,NULL);
- g_assert(ret == SQLITE_OK);
-
- g_stat(dbname, &st);
- db_age = st.st_mtime;
- g_stat(compare_fname, &st);
- if (db_age>=st.st_mtime)
- {
- ret = sqlite3_exec(db, "select value from params where name = 'build_complete'", NULL, NULL, NULL);
- if (ret != SQLITE_ERROR)
- return;
- egg_debug("ages are %lu for db, and %lu for comparism",db_age,st.st_mtime);
- }
- ret = sqlite3_exec(db,"drop table packages",NULL,NULL,NULL); // wipe it!
- //g_assert(ret == SQLITE_OK);
- egg_debug("wiped db");
- ret = sqlite3_exec(db,"create table packages (name text, version text, deps text, arch text, short_desc text, long_desc text, repo string, primary key(name,version,arch,repo))",NULL,NULL,NULL);
- g_assert(ret == SQLITE_OK);
-
- build_db(backend,db);
-
- sqlite3_exec(db,"create table params (name text primary key, value integer)", NULL, NULL, NULL);
- sqlite3_exec(db,"insert into params values ('build_complete',1)", NULL, NULL, NULL);
-}
-
-void sqlite_finish_cache(PkBackend *backend)
-{
- sqlite3_close(db);
-}
-
-// sqlite_search_packages_thread
-static gboolean
-sqlite_search_packages_thread (PkBackend *backend)
-{
- int res;
- gchar *sel;
- const gchar *search;
-
- pk_backend_set_status(backend, PK_STATUS_ENUM_QUERY);
- pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID);
- type = pk_backend_get_uint (backend, "type");
- search = pk_backend_get_string (backend, "search");
-
- egg_debug("finding %s", search);
-
- sqlite3_stmt *package = NULL;
- g_strdelimit(search," ",'%');
-
- if (type == SEARCH_NAME)
- sel = g_strdup_printf("select name,version,arch,repo,short_desc from packages where name like '%%%s%%'",search);
- else if (type == SEARCH_DETAILS)
- sel = g_strdup_printf("select name,version,arch,repo,short_desc from packages where name like '%%%s%%' or short_desc like '%%%s%%' or long_desc like '%%%s%%'",search, search, search);
- else
- {
- pk_backend_error_code(backend, PK_ERROR_ENUM_INTERNAL_ERROR, "Unknown search task type");
- goto end_search_packages;
- }
-
- egg_debug("statement is '%s'",sel);
- res = sqlite3_prepare_v2(db,sel, -1, &package, NULL);
- g_free(sel);
- if (res!=SQLITE_OK)
- egg_error("sqlite error during select prepare: %s", sqlite3_errmsg(db));
- res = sqlite3_step(package);
- while (res == SQLITE_ROW)
- {
- PkPackageId *pid = pk_package_id_new_from_list((const gchar*)sqlite3_column_text(package,0),
- (const gchar*)sqlite3_column_text(package,1),
- (const gchar*)sqlite3_column_text(package,2),
- (const gchar*)sqlite3_column_text(package,3));
-
- gchar *cpid = pk_package_id_to_string(pid);
- PkInfoEnum pie = PK_INFO_ENUM_UNKNOWN;
-
- if (is_installed != NULL)
- pie = is_installed(pid)?PK_INFO_ENUM_INSTALLED:PK_INFO_ENUM_AVAILABLE;
-
- pk_backend_package(backend, pie, cpid, (const gchar*)sqlite3_column_text(package,4));
-
- g_free(cpid);
- pk_package_id_free(pid);
-
- if (res==SQLITE_ROW)
- res = sqlite3_step(package);
- }
- if (res!=SQLITE_DONE)
- {
- egg_debug("sqlite error during step (%d): %s", res, sqlite3_errmsg(db));
- g_assert(0);
- }
-
-end_search_packages:
- pk_backend_finished (backend);
- return TRUE;
-}
-
-/**
- * sqlite_search_details:
- */
-void
-sqlite_search_details (PkBackend *backend, const gchar *filter, const gchar *search)
-{
- pk_backend_set_uint (backend, "type", SEARCH_DETAILS);
- pk_backend_thread_create (backend, sqlite_search_packages_thread);
-}
-
-/**
- * sqlite_search_name:
- */
-void
-sqlite_search_name (PkBackend *backend, const gchar *filter, const gchar *search)
-{
- pk_backend_set_uint (backend, "type", SEARCH_NAME);
- pk_backend_thread_create (backend, sqlite_search_packages_thread);
-}
-
-// sqlite_get_details_thread
-static gboolean
-sqlite_get_details_thread (PkBackend *backend)
-{
- PkPackageId *pi;
- const gchar *package_id;
- int res;
-
- package_id = pk_backend_get_string (backend, "package_id");
- pi = pk_package_id_new_from_string(package_id);
- if (pi == NULL)
- {
- pk_backend_error_code(backend, PK_ERROR_ENUM_PACKAGE_ID_INVALID, "invalid package id");
- pk_backend_finished(backend);
- return;
- }
-
- pk_backend_set_status(backend, PK_STATUS_ENUM_QUERY);
- pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID);
-
- egg_debug("finding %s", pi->name);
-
- sqlite3_stmt *package = NULL;
- gchar *sel = g_strdup_printf("select long_desc from packages where name = '%s' and version = '%s' and repo = '%s'",pi->name,pi->version,pi->data);
- egg_debug("statement is '%s'",sel);
- res = sqlite3_prepare_v2(db,sel, -1, &package, NULL);
- g_free(sel);
- if (res!=SQLITE_OK)
- egg_error("sqlite error during select prepare: %s", sqlite3_errmsg(db));
- res = sqlite3_step(package);
- pk_backend_details(backend,pi->name, "unknown", PK_GROUP_ENUM_OTHER,(const gchar*)sqlite3_column_text(package,0),"",0);
- res = sqlite3_step(package);
- if (res==SQLITE_ROW)
- egg_error("multiple matches for that package!");
- if (res!=SQLITE_DONE)
- {
- egg_debug("sqlite error during step (%d): %s", res, sqlite3_errmsg(db));
- g_assert(0);
- }
-
- g_free(dt);
-
- return TRUE;
-}
-
-/**
- * sqlite_get_details:
- */
-extern "C++" void
-sqlite_get_details (PkBackend *backend, const gchar *package_id)
-{
- pk_backend_thread_create (backend, sqlite_get_details_thread);
- return;
-}
-
diff --git a/backends/apt.deprecated/pk-sqlite-pkg-cache.h b/backends/apt.deprecated/pk-sqlite-pkg-cache.h
deleted file mode 100644
index 68fad42..0000000
--- a/backends/apt.deprecated/pk-sqlite-pkg-cache.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef SQLITE_PKT_CACHE
-#define SQLITE_PKT_CACHE
-
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2007 Tom Parker <palfrey at tevp.net>
- *
- * Licensed under the GNU General Public License Version 2
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-typedef enum {
- SEARCH_NAME = 1,
- SEARCH_DETAILS,
- SEARCH_FILE
-} SearchDepth;
-
-#include <pk-backend.h>
-#include <sqlite3.h>
-
-void sqlite_init_cache(PkBackend *backend, const char* dbname, const char* compare_fname, void (*build_db)(PkBackend *, sqlite3 *db));
-void sqlite_finish_cache(PkBackend *backend);
-
-void sqlite_search_details (PkBackend *backend, const gchar *filter, const gchar *search);
-void sqlite_search_name (PkBackend *backend, const gchar *filter, const gchar *search);
-void backend_search_common(PkBackend * backend, const gchar * filter, const gchar * search, SearchDepth which, PkBackendThreadFunc func);
-void sqlite_get_details (PkBackend *backend, const gchar *package_id);
-
-#endif
commit bdaeeed12aa0316889911213d56ba3e9ebf071aa
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Jun 29 12:42:02 2009 +0100
yum: do newest filtering when the list isn't ordered
diff --git a/backends/yum/yumFilter.py b/backends/yum/yumFilter.py
index e3cb3f3..70a12ba 100644
--- a/backends/yum/yumFilter.py
+++ b/backends/yum/yumFilter.py
@@ -90,8 +90,17 @@ class YumFilter(PackagekitFilter):
# only key on name and not arch
inst = self._pkg_is_installed(pkg)
key = (pkg.name, inst)
- if key in newest and pkg <= newest[key][0]:
- continue
+
+ # we've already come across this package
+ if key in newest:
+
+ # the current package is older (or the same) than the one we have stored
+ if pkg <= newest[key][0]:
+ continue
+
+ # the current package is newer than what we have stored, so nuke the old package
+ del newest[key]
+
newest[key] = (pkg, state)
return newest.values()
commit 93820ed2bd4037c75fdd21d1f9d3018aeacb84dd
Author: Aurelien Lefebvre <alefebvre at mandriva.com>
Date: Mon Jun 29 14:19:21 2009 +0200
urpmi: trivial fix in perform_installation()
diff --git a/backends/urpmi/helpers/urpmi_backend/actions.pm b/backends/urpmi/helpers/urpmi_backend/actions.pm
index 8331f0e..af3dcb1 100644
--- a/backends/urpmi/helpers/urpmi_backend/actions.pm
+++ b/backends/urpmi/helpers/urpmi_backend/actions.pm
@@ -156,7 +156,7 @@ sub perform_installation {
print "Install current mode = ", $mode, "\n";
},
bad_signature => sub {
- if($options{auto_select} eq "yes") {
+ if($options{only_trusted} eq "yes") {
pk_print_error(PK_ERROR_ENUM_GPG_FAILURE, "Bad or missing GPG signatures");
undef $lock;
undef $rpm_lock;
commit 23c8984a9e0f1ca1cda9ecf68b43a2ac17e1e1fd
Author: sandeeps <sandeeps at fedoraproject.org>
Date: Mon Jun 29 11:41:24 2009 +0000
Sending translation for Marathi
diff --git a/po/mr.po b/po/mr.po
index e8d2dd4..c76694c 100644
--- a/po/mr.po
+++ b/po/mr.po
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: packagekit.master.mr\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-06-01 08:18+0000\n"
-"PO-Revision-Date: 2009-06-01 17:34+0530\n"
+"POT-Creation-Date: 2009-06-29 08:34+0000\n"
+"PO-Revision-Date: 2009-06-29 17:09+0530\n"
"Last-Translator: Sandeep Shedmake <sandeep.shedmake at gmail.com>\n"
"Language-Team: marathi\n"
"MIME-Version: 1.0\n"
@@ -18,230 +18,235 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n!=1);\n"
#. TRANSLATORS: this is an atomic transaction
-#: ../client/pk-console.c:234
+#: ../client/pk-console.c:231
msgid "Transaction"
msgstr "वà¥à¤¯à¤µà¤¹à¤¾à¤°"
#. TRANSLATORS: this is the time the transaction was started in system timezone
-#: ../client/pk-console.c:236
+#: ../client/pk-console.c:233
msgid "System time"
msgstr "पà¥à¤°à¤£à¤¾à¤²à¥ वà¥à¤³"
#. TRANSLATORS: this is if the transaction succeeded or not
-#: ../client/pk-console.c:238
+#: ../client/pk-console.c:235
msgid "Succeeded"
msgstr "यशसà¥à¤µà¥"
#. TRANSLATORS: if the repo is enabled
-#: ../client/pk-console.c:238 ../client/pk-console.c:405
+#: ../client/pk-console.c:235 ../client/pk-console.c:402
msgid "True"
msgstr "True"
-#: ../client/pk-console.c:238 ../client/pk-console.c:405
+#: ../client/pk-console.c:235 ../client/pk-console.c:402
msgid "False"
msgstr "False"
#. TRANSLATORS: this is the transactions role, e.g. "update-system"
-#: ../client/pk-console.c:240
+#. TRANSLATORS: the trasaction role, e.g. update-system
+#: ../client/pk-console.c:237 ../src/pk-polkit-action-lookup.c:256
msgid "Role"
msgstr "Role"
#. TRANSLATORS: this is The duration of the transaction
-#: ../client/pk-console.c:245
+#: ../client/pk-console.c:242
msgid "Duration"
msgstr "à¤à¤¾à¤²à¤¾à¤µà¤§à¥"
-#: ../client/pk-console.c:245
+#: ../client/pk-console.c:242
msgid "(seconds)"
msgstr "(सà¥à¤à¤à¤¦)"
#. TRANSLATORS: this is The command line used to do the action
-#: ../client/pk-console.c:249
+#. TRANSLATORS: the command line of the thing that wants the authentication
+#: ../client/pk-console.c:246 ../src/pk-polkit-action-lookup.c:270
msgid "Command line"
msgstr "à¤à¤¦à¥à¤¶ à¤à¤³"
#. TRANSLATORS: this is the user ID of the user that started the action
-#: ../client/pk-console.c:251
+#: ../client/pk-console.c:248
msgid "User ID"
msgstr "वापरà¤à¤°à¥à¤¤à¤¾ ID"
#. TRANSLATORS: this is the username, e.g. hughsie
-#: ../client/pk-console.c:258
+#: ../client/pk-console.c:255
msgid "Username"
msgstr "वापरà¤à¤°à¥à¤¤à¤¾ नाव"
#. TRANSLATORS: this is the users real name, e.g. "Richard Hughes"
-#: ../client/pk-console.c:262
+#: ../client/pk-console.c:259
msgid "Real name"
msgstr "वासà¥à¤¤à¤µà¤¿à¤ नाव"
-#: ../client/pk-console.c:270
+#: ../client/pk-console.c:267
msgid "Affected packages:"
msgstr "पà¥à¤°à¤à¤¾à¤µà¥à¤¤ सà¤à¤à¥à¤²:"
-#: ../client/pk-console.c:272
+#: ../client/pk-console.c:269
msgid "Affected packages: None"
msgstr "पà¥à¤°à¤à¤¾à¤µà¥à¤¤ सà¤à¤à¥à¤²: à¤à¤¾à¤¹à¤¿à¤ नाहà¥"
#. TRANSLATORS: this is the distro, e.g. Fedora 10
-#: ../client/pk-console.c:297
+#: ../client/pk-console.c:294
msgid "Distribution"
msgstr "वितरण"
#. TRANSLATORS: this is type of update, stable or testing
-#: ../client/pk-console.c:299
+#: ../client/pk-console.c:296
msgid "Type"
msgstr "पà¥à¤°à¤à¤¾à¤°"
#. TRANSLATORS: this is any summary text describing the upgrade
#. TRANSLATORS: this is the summary of the group
-#: ../client/pk-console.c:301 ../client/pk-console.c:324
+#: ../client/pk-console.c:298 ../client/pk-console.c:321
msgid "Summary"
msgstr "साराà¤à¤¶"
#. TRANSLATORS: this is the group category name
-#: ../client/pk-console.c:313
+#: ../client/pk-console.c:310
msgid "Category"
msgstr "पà¥à¤°à¤µà¤°à¥à¤"
#. TRANSLATORS: this is group identifier
-#: ../client/pk-console.c:315
+#: ../client/pk-console.c:312
msgid "ID"
msgstr "ID"
#. TRANSLATORS: this is the parent group
-#: ../client/pk-console.c:318
+#: ../client/pk-console.c:315
msgid "Parent"
msgstr "मà¥à¤à¥à¤¯"
#. TRANSLATORS: this is the name of the parent group
-#: ../client/pk-console.c:321
+#: ../client/pk-console.c:318
msgid "Name"
msgstr "नाव"
#. TRANSLATORS: this is preferred icon for the group
-#: ../client/pk-console.c:327
+#: ../client/pk-console.c:324
msgid "Icon"
msgstr "à¤à¤¿à¤¨à¥à¤¹"
#. TRANSLATORS: this is a header for the package that can be updated
-#: ../client/pk-console.c:342
+#: ../client/pk-console.c:339
msgid "Details about the update:"
msgstr "à¤
दà¥à¤¯à¤¯à¤¾à¤µà¤¤ विषयॠतपशà¥à¤²:"
#. TRANSLATORS: details about the update, package name and version
-#: ../client/pk-console.c:344
+#: ../client/pk-console.c:341
msgid "Package"
msgstr "सà¤à¤à¥à¤²"
#. TRANSLATORS: details about the update, any packages that this update updates
-#: ../client/pk-console.c:347
+#: ../client/pk-console.c:344
msgid "Updates"
msgstr "à¤
दà¥à¤¯à¤¯à¤¾à¤µà¤¤"
#. TRANSLATORS: details about the update, any packages that this update obsoletes
-#: ../client/pk-console.c:351
+#: ../client/pk-console.c:348
msgid "Obsoletes"
msgstr "à¤à¥à¤£à¥"
#. TRANSLATORS: details about the update, the vendor URLs
-#: ../client/pk-console.c:355
+#: ../client/pk-console.c:352
msgid "Vendor"
msgstr "विà¤à¥à¤°à¥à¤¤à¤¾"
#. TRANSLATORS: details about the update, the bugzilla URLs
-#: ../client/pk-console.c:359
+#: ../client/pk-console.c:356
msgid "Bugzilla"
msgstr "बà¤à¤à¥à¤²à¤¾"
#. TRANSLATORS: details about the update, the CVE URLs
-#: ../client/pk-console.c:363
+#: ../client/pk-console.c:360
msgid "CVE"
msgstr "CVE"
#. TRANSLATORS: details about the update, if the package requires a restart
-#: ../client/pk-console.c:367
+#: ../client/pk-console.c:364
msgid "Restart"
msgstr "पà¥à¤¨à¥à¤¹à¤¾ सà¥à¤°à¥ à¤à¤°à¤¾"
#. TRANSLATORS: details about the update, any description of the update
-#: ../client/pk-console.c:371
+#: ../client/pk-console.c:368
msgid "Update text"
msgstr "à¤
दà¥à¤¯à¤¯à¤¾à¤µà¤¤ पाठà¥à¤¯"
#. TRANSLATORS: details about the update, the changelog for the package
-#: ../client/pk-console.c:375
+#: ../client/pk-console.c:372
msgid "Changes"
msgstr "बदल"
#. TRANSLATORS: details about the update, the ongoing state of the update
-#: ../client/pk-console.c:379
+#: ../client/pk-console.c:376
msgid "State"
msgstr "सà¥à¤¤à¤°"
#. TRANSLATORS: details about the update, date the update was issued
-#: ../client/pk-console.c:384
+#: ../client/pk-console.c:381
msgid "Issued"
msgstr "वितरण दिनाà¤à¤"
#. TRANSLATORS: details about the update, date the update was updated
-#: ../client/pk-console.c:389
+#: ../client/pk-console.c:386
msgid "Updated"
msgstr "à¤
दà¥à¤¯à¤¯à¤¾à¤µà¤¤à¥à¤¤"
-#: ../client/pk-console.c:476 ../client/pk-console.c:478
+#: ../client/pk-console.c:473 ../client/pk-console.c:475
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:392
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:394
msgid "Percentage"
msgstr "à¤à¤à¥à¤à¥à¤µà¤¾à¤°à¥"
-#: ../client/pk-console.c:478
+#: ../client/pk-console.c:475
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:394
msgid "Unknown"
msgstr "à¤
परिà¤à¥à¤¤"
#. TRANSLATORS: a package requires the system to be restarted
-#: ../client/pk-console.c:529
+#: ../client/pk-console.c:517
msgid "System restart required by:"
msgstr "पà¥à¤°à¤£à¤¾à¤²à¥ पà¥à¤¨à¥à¤¹à¤¾ à¤à¤¾à¤²à¥ à¤à¤°à¤£à¥ à¤à¤µà¤¶à¥à¤¯à¤:"
#. TRANSLATORS: a package requires the session to be restarted
-#: ../client/pk-console.c:532
+#: ../client/pk-console.c:520
msgid "Session restart required:"
msgstr "सतà¥à¤° पà¥à¤¨à¥à¤¹à¤¾ à¤à¤¾à¤²à¥ à¤à¤°à¤£à¥ à¤à¤µà¤¶à¥à¤¯à¤:"
#. TRANSLATORS: a package requires the application to be restarted
-#: ../client/pk-console.c:535
+#: ../client/pk-console.c:523
msgid "Application restart required by:"
msgstr "à¤
नà¥à¤ªà¥à¤°à¤¯à¥à¤ पà¥à¤¨à¥à¤¹à¤¾ à¤à¤¾à¤²à¥ à¤à¤°à¤£à¥ à¤à¤µà¤¶à¥à¤¯à¤:"
#. TRANSLATORS: a package needs to restart they system
-#: ../client/pk-console.c:572
+#: ../client/pk-console.c:578
msgid "Please restart the computer to complete the update."
msgstr "à¤
दà¥à¤¯à¤¯à¤¾à¤µà¤¤ पà¥à¤°à¥à¤£ à¤à¤°à¤£à¥à¤¯à¤¾à¤à¤°à¥à¤¤à¤¾ à¤à¥à¤ªà¤¯à¤¾ सà¤à¤à¤£à¤ पà¥à¤¨à¥à¤¹à¤¾ à¤à¤¾à¤²à¥ à¤à¤°à¤¾."
#. TRANSLATORS: a package needs to restart the session
-#: ../client/pk-console.c:575
+#: ../client/pk-console.c:581
msgid "Please logout and login to complete the update."
msgstr "à¤à¥à¤ªà¤¯à¤¾ वापरà¤à¤°à¥à¤¤à¤¾ बदला व à¤
दà¥à¤¯à¤¯à¤¾à¤µà¤¤ पà¥à¤°à¥à¤£ à¤à¤°à¤£à¥à¤¯à¤¾à¤à¤°à¥à¤¤à¤¾ पà¥à¤°à¤µà¥à¤¶ à¤à¤°à¤¾."
#. TRANSLATORS: a package needs to restart the application
-#: ../client/pk-console.c:578
+#: ../client/pk-console.c:584
msgid "Please restart the application as it is being used."
msgstr "à¤à¥à¤ªà¤¯à¤¾ à¤
नà¥à¤ªà¥à¤°à¤¯à¥à¤ à¤à¥à¤¯à¤¾à¤¨à¥à¤°à¥à¤ª वापरलॠà¤à¤¾à¤¤à¥ तà¥à¤¯à¤¾à¤¨à¥à¤°à¥à¤ª पà¥à¤¨à¥à¤¹à¤¾ à¤à¤¾à¤²à¥ à¤à¤°à¤¾."
#. TRANSLATORS: The package is already installed on the system
-#: ../client/pk-console.c:691
+#: ../client/pk-console.c:711
#, c-format
msgid "The package %s is already installed"
msgstr "सà¤à¤à¥à¤² %s à¤à¤§à¤¿à¤ªà¤¾à¤¸à¥à¤¨à¤ पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापà¥à¤¤ à¤à¤¹à¥"
#. TRANSLATORS: The package name was not found in any software sources. The detailed error follows
-#: ../client/pk-console.c:699
+#: ../client/pk-console.c:719
#, c-format
msgid "The package %s could not be installed: %s"
msgstr "सà¤à¤à¥à¤² %s à¤à¥ पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापन शà¤à¥à¤¯ नाहà¥: %s"
#. TRANSLATORS: There was a programming error that shouldn't happen. The detailed error follows
-#: ../client/pk-console.c:724 ../client/pk-console.c:751
-#: ../client/pk-console.c:847 ../client/pk-console.c:964
+#: ../client/pk-console.c:744 ../client/pk-console.c:767
+#: ../client/pk-console.c:863 ../client/pk-console.c:980
#: ../client/pk-tools-common.c:62 ../client/pk-tools-common.c:81
#: ../client/pk-tools-common.c:89
#, c-format
@@ -249,298 +254,297 @@ msgid "Internal error: %s"
msgstr "à¤à¤à¤¤à¤°à¥à¤ तà¥à¤°à¥à¤à¥: %s"
#. TRANSLATORS: There was an error installing the packages. The detailed error follows
-#: ../client/pk-console.c:732 ../client/pk-console.c:1360
+#: ../client/pk-console.c:752 ../client/pk-console.c:1376
#, c-format
msgid "This tool could not install the packages: %s"
msgstr "हॠसाधन सà¤à¤à¥à¤² पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापà¥à¤¤ à¤à¤°à¥ शà¤à¤²à¥ नाहà¥: %s"
#. TRANSLATORS: There was an error installing the files. The detailed error follows
-#: ../client/pk-console.c:759
+#: ../client/pk-console.c:775
#, c-format
msgid "This tool could not install the files: %s"
msgstr "हॠसाधन फाà¤à¤² पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापà¥à¤¤ à¤à¤°à¥ शà¤à¤²à¥ नाहà¥: %s"
#. TRANSLATORS: The package name was not found in the installed list. The detailed error follows
-#: ../client/pk-console.c:815
+#: ../client/pk-console.c:831
#, c-format
msgid "This tool could not remove %s: %s"
msgstr "या साधन दà¥à¤µà¤¾à¤°à¥ %s à¤à¤¾à¤¢à¥à¤£ à¤à¤¾à¤à¤£à¥ शà¤à¥à¤¯ नाहà¥: %s"
#. TRANSLATORS: There was an error removing the packages. The detailed error follows
-#: ../client/pk-console.c:838 ../client/pk-console.c:876
-#: ../client/pk-console.c:909
+#: ../client/pk-console.c:854 ../client/pk-console.c:892
+#: ../client/pk-console.c:925
#, c-format
msgid "This tool could not remove the packages: %s"
msgstr "या साधन दà¥à¤µà¤¾à¤°à¥ सà¤à¤à¥à¤² à¤à¤¾à¤¢à¥à¤£ à¤à¤¾à¤à¤£à¥ à¤
शà¤à¥à¤¯: %s"
#. TRANSLATORS: When removing, we might have to remove other dependencies
-#: ../client/pk-console.c:888
+#: ../client/pk-console.c:904
msgid "The following packages have to be removed:"
msgstr "à¤à¤¾à¤²à¤¿à¤² सà¤à¤à¥à¤² à¤à¤¾à¤¢à¥à¤£ à¤à¤¾à¤à¤£à¥ à¤à¤µà¤¶à¥à¤¯à¤ à¤à¤¹à¥:"
#. TRANSLATORS: We are checking if it's okay to remove a list of packages
-#: ../client/pk-console.c:895
+#: ../client/pk-console.c:911
msgid "Proceed removing additional packages?"
msgstr "à¤
à¤à¤¾à¤ सà¤à¤à¥à¤² à¤à¤¾à¤¢à¥à¤£ à¤à¤¾à¤à¤£à¥ à¤à¤¾à¤²à¥ ठà¥à¤µà¤¾à¤¯à¤à¥?"
#. TRANSLATORS: We did not remove any packages
-#: ../client/pk-console.c:900
+#: ../client/pk-console.c:916
msgid "The package removal was canceled!"
msgstr "सà¤à¤à¥à¤² à¤à¤¾à¤¢à¥à¤£ à¤à¤¾à¤à¤£à¥ रदà¥à¤¦ à¤à¥à¤²à¥ à¤à¥à¤²à¥!"
#. TRANSLATORS: The package name was not found in any software sources
-#: ../client/pk-console.c:941
+#: ../client/pk-console.c:957
#, c-format
msgid "This tool could not download the package %s as it could not be found"
msgstr "हॠसाधन सà¤à¤à¥à¤² %s न à¤à¤¢à¤³à¤²à¥à¤¯à¤¾à¤®à¥à¤³à¥ डाà¤à¤¨à¤²à¥à¤¡ à¤à¤°à¥ शà¤à¤²à¥ नाहà¥"
#. TRANSLATORS: Could not download the packages for some reason. The detailed error follows
-#: ../client/pk-console.c:972
+#: ../client/pk-console.c:988
#, c-format
msgid "This tool could not download the packages: %s"
msgstr "हॠसाधन सà¤à¤à¥à¤² डाà¤à¤¨à¤²à¥à¤¡ à¤à¤°à¥ शà¤à¤²à¥ नाहà¥: %s"
#. TRANSLATORS: There was an error getting the list of files for the package. The detailed error follows
-#: ../client/pk-console.c:999 ../client/pk-console.c:1008
+#: ../client/pk-console.c:1015 ../client/pk-console.c:1024
#, c-format
msgid "This tool could not update %s: %s"
msgstr "हॠसाधन %s à¤
दà¥à¤¯à¤¯à¤¾à¤µà¤¤à¥à¤¤ à¤à¤°à¥ शà¤à¤²à¥ नाहà¥: %s"
#. TRANSLATORS: There was an error getting the list of files for the package. The detailed error follows
-#: ../client/pk-console.c:1030 ../client/pk-console.c:1038
+#: ../client/pk-console.c:1046 ../client/pk-console.c:1054
#, c-format
msgid "This tool could not get the requirements for %s: %s"
msgstr "हॠसाधन %s à¤à¤°à¥à¤¤à¤¾ à¤à¤µà¤¶à¥à¤¯à¤à¤¤à¤¾ पà¥à¤°à¤¾à¤ªà¥à¤¤ à¤à¤°à¥ शà¤à¤²à¥ नाहà¥: %s"
#. TRANSLATORS: There was an error getting the dependencies for the package. The detailed error follows
-#: ../client/pk-console.c:1060 ../client/pk-console.c:1068
+#: ../client/pk-console.c:1076 ../client/pk-console.c:1084
#, c-format
msgid "This tool could not get the dependencies for %s: %s"
msgstr "हॠसाधन %s à¤à¤°à¥à¤¤à¤¾ à¤
वलà¤à¤¬à¤¨ पà¥à¤°à¤¾à¤ªà¥à¤¤ à¤à¤°à¥ शà¤à¤¨à¥ नाहà¥: %s"
#. TRANSLATORS: There was an error getting the details about the package. The detailed error follows
-#: ../client/pk-console.c:1090 ../client/pk-console.c:1098
+#: ../client/pk-console.c:1106 ../client/pk-console.c:1114
#, c-format
msgid "This tool could not get package details for %s: %s"
msgstr "हॠसाधन %s à¤à¤°à¥à¤¤à¤¾ सà¤à¤à¥à¤² तपशà¥à¤² पà¥à¤°à¤¾à¤ªà¥à¤¤ à¤à¤°à¥ शà¤à¤²à¥ नाहà¥: %s"
#. TRANSLATORS: The package name was not found in any software sources. The detailed error follows
-#: ../client/pk-console.c:1120
+#: ../client/pk-console.c:1136
#, c-format
msgid "This tool could not find the files for %s: %s"
msgstr "हॠसाधन %s à¤à¤°à¥à¤¤à¤¾ फाà¤à¤² शà¥à¤§à¥ शà¤à¤²à¥ नाहà¥: %s"
#. TRANSLATORS: There was an error getting the list of files for the package. The detailed error follows
-#: ../client/pk-console.c:1128
+#: ../client/pk-console.c:1144
#, c-format
msgid "This tool could not get the file list for %s: %s"
msgstr "हॠसाधन %s à¤à¤°à¥à¤¤à¤¾ फाà¤à¤² यादॠपà¥à¤°à¤¾à¤ªà¥à¤¤ à¤à¤°à¥ शà¤à¤²à¥ नाहà¥: %s"
#. TRANSLATORS: There was an error getting the list of packages. The filename follows
-#: ../client/pk-console.c:1150
+#: ../client/pk-console.c:1166
#, c-format
msgid "File already exists: %s"
msgstr "फाà¤à¤² à¤à¤§à¤¿à¤ªà¤¾à¤¸à¥à¤¨à¤ à¤
सà¥à¤¤à¤¿à¤¤à¥à¤µà¤¾à¤¤ à¤à¤¹à¥: %s"
#. TRANSLATORS: follows a list of packages to install
-#: ../client/pk-console.c:1155 ../client/pk-console.c:1211
-#: ../client/pk-console.c:1286
+#: ../client/pk-console.c:1171 ../client/pk-console.c:1227
+#: ../client/pk-console.c:1302
msgid "Getting package list"
msgstr "सà¤à¤à¥à¤² यादॠपà¥à¤°à¤¾à¤ªà¥à¤¤ à¤à¤°à¤¤ à¤à¤¹à¥"
#. TRANSLATORS: There was an error getting the list of packages. The detailed error follows
-#: ../client/pk-console.c:1161 ../client/pk-console.c:1217
-#: ../client/pk-console.c:1292
+#: ../client/pk-console.c:1177 ../client/pk-console.c:1233
+#: ../client/pk-console.c:1308
#, c-format
msgid "This tool could not get package list: %s"
msgstr "हॠसाधन सà¤à¤à¥à¤² यादॠपà¥à¤°à¤¾à¤ªà¥à¤¤ à¤à¤°à¥ शà¤à¤²à¥ नाहà¥: %s"
#. TRANSLATORS: There was an error saving the list
-#: ../client/pk-console.c:1172
+#: ../client/pk-console.c:1188
#, c-format
msgid "Failed to save to disk"
msgstr "डिसà¥à¤ वर साठविणà¥à¤¯à¤¾à¤¸ à¤
पयशà¥"
#. TRANSLATORS: There was an error getting the list. The filename follows
-#: ../client/pk-console.c:1206 ../client/pk-console.c:1281
+#: ../client/pk-console.c:1222 ../client/pk-console.c:1297
#, c-format
msgid "File does not exist: %s"
msgstr "फाà¤à¤² à¤
सà¥à¤¤à¤¿à¤¤à¥à¤µà¤¾à¤¤ नाहà¥: %s"
#. TRANSLATORS: header to a list of packages newly added
-#: ../client/pk-console.c:1238
+#: ../client/pk-console.c:1254
msgid "Packages to add"
msgstr "समावà¥à¤· à¤à¤°à¤£à¥à¤¯à¤¾à¤à¥à¤à¥ सà¤à¤à¥à¤²"
#. TRANSLATORS: header to a list of packages removed
-#: ../client/pk-console.c:1246
+#: ../client/pk-console.c:1262
msgid "Packages to remove"
msgstr "à¤à¤¾à¤¢à¥à¤£ à¤à¤¾à¤à¤£à¥à¤¯à¤¾à¤à¥à¤à¥ सà¤à¤à¥à¤²"
#. TRANSLATORS: We didn't find any differences
-#: ../client/pk-console.c:1314
+#: ../client/pk-console.c:1330
#, c-format
msgid "No new packages need to be installed"
msgstr "à¤à¥à¤ लà¥à¤¹à¥ नवà¥à¤¨ सà¤à¤à¥à¤² पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापà¥à¤¤ à¤à¤°à¤£à¥à¤¯à¤¾à¤à¥ à¤à¤µà¤¶à¥à¤¯à¤à¤¤à¤¾ नाहà¥"
#. TRANSLATORS: follows a list of packages to install
-#: ../client/pk-console.c:1320
+#: ../client/pk-console.c:1336
msgid "To install"
msgstr "पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापन à¤à¤°à¤¾"
#. TRANSLATORS: searching takes some time....
-#: ../client/pk-console.c:1332
+#: ../client/pk-console.c:1348
msgid "Searching for package: "
msgstr "सà¤à¤à¥à¤² à¤à¤°à¥à¤¤à¤¾ शà¥à¤§à¤¤ à¤à¤¹à¥: "
#. TRANSLATORS: package was not found -- this is the end of a string ended in ...
-#: ../client/pk-console.c:1336
+#: ../client/pk-console.c:1352
msgid "not found."
msgstr "à¤à¤¢à¤³à¤²à¥ नाहà¥."
#. TRANSLATORS: We didn't find any packages to install
-#: ../client/pk-console.c:1347
+#: ../client/pk-console.c:1363
#, c-format
msgid "No packages can be found to install"
msgstr "पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापन à¤à¤°à¥à¤¤à¤¾ à¤à¥à¤ लà¥à¤¹à¥ सà¤à¤à¥à¤² à¤à¤¢à¤³à¤²à¥ नाहà¥"
#. TRANSLATORS: installing new packages from package list
-#: ../client/pk-console.c:1353
+#. TRANSLATORS: we are now installing the debuginfo packages we found earlier
+#: ../client/pk-console.c:1369
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:698
+#, c-format
msgid "Installing packages"
msgstr "सà¤à¤à¥à¤² पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापà¥à¤¤ à¤à¤°à¤¤ à¤à¤¹à¥"
#. TRANSLATORS: The package name was not found in any software sources. The detailed error follows
-#: ../client/pk-console.c:1389
+#: ../client/pk-console.c:1405
#, c-format
msgid "This tool could not find the update details for %s: %s"
msgstr "हॠसाधन %s à¤à¤°à¥à¤¤à¤¾ à¤
दà¥à¤¯à¤¯à¤¾à¤µà¤¤ तपशà¥à¤² शà¥à¤§à¥ शà¤à¤²à¥ नाहà¥: %s"
#. TRANSLATORS: There was an error getting the details about the update for the package. The detailed error follows
-#: ../client/pk-console.c:1397
+#: ../client/pk-console.c:1413
#, c-format
msgid "This tool could not get the update details for %s: %s"
msgstr "हॠसाधन %s à¤à¤°à¥à¤¤à¤¾ à¤
दà¥à¤¯à¤¯à¤¾à¤µà¤¤ तपशà¥à¤² पà¥à¤°à¤¾à¤ªà¥à¤¤ à¤à¤°à¥ शà¤à¤²à¥ नाहà¥: %s"
#. TRANSLATORS: This was an unhandled error, and we don't have _any_ context
-#: ../client/pk-console.c:1443
+#: ../client/pk-console.c:1444
msgid "Error:"
msgstr "तà¥à¤°à¥à¤à¥:"
#. TRANSLATORS: This a list of details about the package
-#: ../client/pk-console.c:1457
+#: ../client/pk-console.c:1458
msgid "Package description"
msgstr "सà¤à¤à¥à¤² वरà¥à¤£à¤¨"
#. TRANSLATORS: This a message (like a little note that may be of interest) from the transaction
-#: ../client/pk-console.c:1473
+#: ../client/pk-console.c:1474
msgid "Message:"
msgstr "सà¤à¤¦à¥à¤¶:"
#. TRANSLATORS: This a list files contained in the package
-#: ../client/pk-console.c:1501
+#: ../client/pk-console.c:1502
msgid "Package files"
msgstr "सà¤à¤à¥à¤² फाà¤à¤²"
#. TRANSLATORS: This where the package has no files
-#: ../client/pk-console.c:1509
+#: ../client/pk-console.c:1510
msgid "No files"
msgstr "फाà¤à¤¨ नाहà¥"
#. TRANSLATORS: This a request for a GPG key signature from the backend, which the client will prompt for later
-#: ../client/pk-console.c:1532
+#: ../client/pk-console.c:1533
msgid "Repository signature required"
msgstr "रà¥à¤ªà¥à¤à¤à¤°à¥ सà¥à¤µà¤¾à¤à¥à¤·à¤°à¥ à¤à¤µà¤¶à¥à¤¯à¤ à¤à¤¹à¥"
#. TRANSLATORS: This a prompt asking the user to import the security key
-#: ../client/pk-console.c:1542
+#: ../client/pk-console.c:1543
msgid "Do you accept this signature?"
msgstr "तà¥à¤®à¥à¤¹à¥ हॠसà¥à¤µà¤¾à¤à¥à¤·à¤°à¥ सà¥à¤µà¥à¤à¤¾à¤°à¤¤à¤¾?"
#. TRANSLATORS: This is where the user declined the security key
-#: ../client/pk-console.c:1546
+#: ../client/pk-console.c:1547
msgid "The signature was not accepted."
msgstr "सà¥à¤µà¤¾à¤à¥à¤·à¤°à¥ सà¥à¤µà¥à¤à¤¾à¤°à¤²à¥ à¤à¥à¤²à¥ नाहà¥."
#. TRANSLATORS: This a request for a EULA
-#: ../client/pk-console.c:1580
+#: ../client/pk-console.c:1581
msgid "End user license agreement required"
msgstr "वापरà¤à¤°à¥à¤¤à¤¾ परवाना à¤à¤°à¤¾à¤° à¤à¤µà¤¶à¥à¤¯à¤ à¤à¤¹à¥"
#. TRANSLATORS: This a prompt asking the user to agree to the license
-#: ../client/pk-console.c:1587
+#: ../client/pk-console.c:1588
msgid "Do you agree to this license?"
msgstr "तà¥à¤®à¥à¤¹à¥ हा परवाना सà¥à¤µà¥à¤à¤¾à¤°à¤£à¥à¤¯à¤¾à¤à¥ à¤à¤¾à¤¤à¥à¤°à¥ दà¥à¤¤à¤¾?"
#. TRANSLATORS: This is where the user declined the license
-#: ../client/pk-console.c:1591
+#: ../client/pk-console.c:1592
msgid "The license was refused."
msgstr "परवाना फà¥à¤à¤¾à¤³à¤²à¥ à¤à¥à¤²à¥."
#. TRANSLATORS: This is when the daemon crashed, and we are up shit creek without a paddle
-#: ../client/pk-console.c:1620
+#: ../client/pk-console.c:1621
msgid "The daemon crashed mid-transaction!"
msgstr "डिमन वà¥à¤¯à¤µà¤¹à¤¾à¤°à¤à¥à¤¯à¤¾ मधà¥à¤®à¤§ à¤à¥à¤°à¥
श à¤à¤¾à¤²à¥!"
#. TRANSLATORS: This is the header to the --help menu
-#: ../client/pk-console.c:1673
+#: ../client/pk-console.c:1674
msgid "PackageKit Console Interface"
msgstr "PackageKit à¤à¤¨à¥à¤¸à¥à¤² सà¤à¤µà¤¾à¤¦"
#. these are commands we can use with pkcon
-#: ../client/pk-console.c:1675
+#: ../client/pk-console.c:1676
msgid "Subcommands:"
msgstr "à¤à¤ªà¤à¤¦à¥à¤¶:"
#. TRANSLATORS: command line argument, if we should show debugging information
#. TRANSLATORS: if we should show debugging data
-#: ../client/pk-console.c:1767 ../client/pk-generate-pack.c:185
+#: ../client/pk-console.c:1768 ../client/pk-generate-pack.c:185
#: ../client/pk-monitor.c:125
-#: ../contrib/command-not-found/pk-command-not-found.c:520
+#: ../contrib/command-not-found/pk-command-not-found.c:521
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:426
#: ../src/pk-main.c:211
msgid "Show extra debugging information"
msgstr "à¤
à¤à¤¾à¤ डिबà¤à¥à¤à¤ माहितॠदाà¤à¤µà¤¾"
#. TRANSLATORS: command line argument, just show the version string
-#: ../client/pk-console.c:1770 ../client/pk-monitor.c:127
+#: ../client/pk-console.c:1771 ../client/pk-monitor.c:127
msgid "Show the program version and exit"
msgstr "à¤à¤¾à¤°à¥à¤¯à¤à¥à¤°à¤® à¤à¤µà¥à¤¤à¥à¤¤à¥ दाà¤à¤µà¤¾ व बाहà¥à¤° पडा"
#. TRANSLATORS: command line argument, use a filter to narrow down results
-#: ../client/pk-console.c:1773
+#: ../client/pk-console.c:1774
msgid "Set the filter, e.g. installed"
msgstr "à¤à¤¾à¤³à¤£à¥ निशà¥à¤à¤¿à¤¤ à¤à¤°à¤¾, à¤.दा. पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापà¥à¤¤"
#. TRANSLATORS: command line argument, work asynchronously
-#: ../client/pk-console.c:1776
+#: ../client/pk-console.c:1777
msgid "Exit without waiting for actions to complete"
msgstr "à¤à¥à¤¤à¥ पà¥à¤°à¥à¤£ à¤à¥à¤²à¥à¤¯à¤¾à¤µà¤¿à¤¨à¤¾ बाहà¥à¤° पडा"
#. TRANSLATORS: This is when we could not connect to the system bus, and is fatal
-#: ../client/pk-console.c:1803
+#: ../client/pk-console.c:1804
msgid "This tool could not connect to system DBUS."
msgstr "हॠसाधन पà¥à¤°à¤£à¤¾à¤²à¥ DBUS शॠà¤à¥à¤³à¤µà¤£à¥ सà¥à¤¥à¤¾à¤ªà¥à¤¤ à¤à¤°à¤£à¥à¤¯à¤¾à¤¸ à¤
शà¤à¥à¤¯."
#. TRANSLATORS: The user specified an incorrect filter
-#: ../client/pk-console.c:1894
+#: ../client/pk-console.c:1893
msgid "The filter specified was invalid"
msgstr "निशà¥à¤à¤¿à¤¤ à¤à¤¾à¤³à¤£à¥ à¤
वà¥à¤§ नà¥à¤°à¥à¤ª à¤à¤¢à¤³à¤²à¥"
#. TRANSLATORS: a search type can be name, details, file, etc
-#: ../client/pk-console.c:1912
+#: ../client/pk-console.c:1911
msgid "A search type is required, e.g. name"
msgstr "शà¥à¤§ पà¥à¤°à¤à¤¾à¤° à¤à¤µà¤¶à¥à¤¯à¤, à¤.दा. नाव"
#. TRANSLATORS: the user needs to provide a search term
-#: ../client/pk-console.c:1918 ../client/pk-console.c:1926
-#: ../client/pk-console.c:1941
+#: ../client/pk-console.c:1917 ../client/pk-console.c:1925
+#: ../client/pk-console.c:1933 ../client/pk-console.c:1941
msgid "A search term is required"
msgstr "शà¥à¤§ सà¤à¤à¥à¤à¤¾ à¤à¤µà¤¶à¥à¤¯à¤"
-#: ../client/pk-console.c:1933
-msgctxt "A search term is required"
-msgid "the user needs to provide a search term"
-msgstr "वापरà¤à¤°à¥à¤¤à¥à¤¯à¤¾à¤²à¤¾ शà¥à¤§ सà¤à¤à¥à¤à¤¾ पà¥à¤°à¤µà¤£à¥à¤¯à¤¾à¤à¥ à¤à¤µà¤¶à¥à¤¯à¤à¤¤à¤¾ à¤à¤¹à¥"
-
#. TRANSLATORS: the search type was provided, but invalid
#: ../client/pk-console.c:1947
msgid "Invalid search type"
@@ -793,128 +797,302 @@ msgid "Please enter a number from 1 to %i: "
msgstr "à¤à¥à¤ªà¤¯à¤¾ 1 तॠ%i à¤à¥à¤°à¤®à¤¾à¤à¤ निवडा: "
#. TRANSLATORS: we failed to find the package, this shouldn't happen
-#: ../contrib/command-not-found/pk-command-not-found.c:371
+#: ../contrib/command-not-found/pk-command-not-found.c:372
msgid "Failed to search for file"
msgstr "फाà¤à¤² à¤à¤°à¥à¤¤à¤¾ शà¥à¤§ à¤à¤°à¤£à¥à¤¯à¤¾à¤¸ à¤
पयशà¥"
#. TRANSLATORS: we failed to launch the executable, the error follows
-#: ../contrib/command-not-found/pk-command-not-found.c:495
+#: ../contrib/command-not-found/pk-command-not-found.c:496
msgid "Failed to launch:"
msgstr "पà¥à¤°à¤à¥à¤·à¥à¤ªà¥à¤¤ à¤à¤°à¤£à¥à¤¯à¤¾à¤¸ à¤
पयशà¥:"
#. TRANSLATORS: tool that gets called when the command is not found
-#: ../contrib/command-not-found/pk-command-not-found.c:536
+#: ../contrib/command-not-found/pk-command-not-found.c:537
msgid "PackageKit Command Not Found"
msgstr "PackageKit à¤à¤¦à¥à¤¶ à¤à¤¢à¤³à¤²à¥ नाहà¥"
#. TRANSLATORS: the prefix of all the output telling the user why it's not executing
-#: ../contrib/command-not-found/pk-command-not-found.c:559
+#: ../contrib/command-not-found/pk-command-not-found.c:560
msgid "Command not found."
msgstr "à¤à¤¦à¥à¤¶ à¤à¤¢à¤³à¤²à¥ नाहà¥."
#. TRANSLATORS: tell the user what we think the command is
-#: ../contrib/command-not-found/pk-command-not-found.c:566
+#: ../contrib/command-not-found/pk-command-not-found.c:567
msgid "Similar command is:"
msgstr "समान à¤à¤¦à¥à¤¶ यानà¥à¤°à¥à¤ª à¤à¤¹à¥:"
#. TRANSLATORS: Ask the user if we should run the similar command
-#: ../contrib/command-not-found/pk-command-not-found.c:575
+#: ../contrib/command-not-found/pk-command-not-found.c:576
msgid "Run similar command:"
msgstr "समान à¤à¤¦à¥à¤¶ à¤à¤¾à¤²à¤µà¤¾:"
#. TRANSLATORS: show the user a list of commands that they could have meant
#. TRANSLATORS: show the user a list of commands we could run
-#: ../contrib/command-not-found/pk-command-not-found.c:587
-#: ../contrib/command-not-found/pk-command-not-found.c:596
+#: ../contrib/command-not-found/pk-command-not-found.c:588
+#: ../contrib/command-not-found/pk-command-not-found.c:597
msgid "Similar commands are:"
msgstr "समान à¤à¤¦à¥à¤¶ यानà¥à¤°à¥à¤ª à¤à¤¹à¥:"
#. TRANSLATORS: ask the user to choose a file to run
-#: ../contrib/command-not-found/pk-command-not-found.c:603
+#: ../contrib/command-not-found/pk-command-not-found.c:604
msgid "Please choose a command to run"
msgstr "à¤à¥à¤ªà¤¯à¤¾ à¤à¤¾à¤²à¤µà¤¿à¤£à¥à¤¯à¤¾à¤à¥à¤à¥ à¤à¤¦à¥à¤¶ निवडा"
#. TRANSLATORS: tell the user what package provides the command
-#: ../contrib/command-not-found/pk-command-not-found.c:618
+#: ../contrib/command-not-found/pk-command-not-found.c:619
msgid "The package providing this file is:"
msgstr "हॠफाà¤à¤² या सà¤à¤à¥à¤² दà¥à¤µà¤¾à¤°à¥ पà¥à¤°à¤µà¤¿à¤²à¥ à¤à¤¾à¤¤à¥:"
#. TRANSLATORS: as the user if we want to install a package to provide the command
-#: ../contrib/command-not-found/pk-command-not-found.c:623
+#: ../contrib/command-not-found/pk-command-not-found.c:624
#, c-format
msgid "Install package '%s' to provide command '%s'?"
msgstr "à¤à¤¦à¥à¤¶ '%2$s' पà¥à¤°à¤µà¤¿à¤£à¥à¤¯à¤¾à¤à¤°à¥à¤¤à¤¾ सà¤à¤à¥à¤² '%1$s' पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापà¥à¤¤ à¤à¤°à¤¾à¤¯à¤à¥?"
#. TRANSLATORS: Show the user a list of packages that provide this command
-#: ../contrib/command-not-found/pk-command-not-found.c:644
+#: ../contrib/command-not-found/pk-command-not-found.c:645
msgid "Packages providing this file are:"
msgstr "हॠफाà¤à¤² या सà¤à¤à¥à¤² दà¥à¤µà¤¾à¤°à¥ पà¥à¤°à¤µà¤¿à¤²à¥ à¤à¤¾à¤¤à¥:"
#. TRANSLATORS: Show the user a list of packages that they can install to provide this command
-#: ../contrib/command-not-found/pk-command-not-found.c:653
+#: ../contrib/command-not-found/pk-command-not-found.c:654
msgid "Suitable packages are:"
msgstr "यà¥à¤à¥à¤¯ सà¤à¤à¥à¤² यानà¥à¤°à¥à¤ª à¤à¤¹à¥:"
#. get selection
#. TRANSLATORS: ask the user to choose a file to install
-#: ../contrib/command-not-found/pk-command-not-found.c:661
+#: ../contrib/command-not-found/pk-command-not-found.c:662
msgid "Please choose a package to install"
msgstr "पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापन à¤à¤°à¥à¤¤à¤¾ à¤à¥à¤ªà¤¯à¤¾ सà¤à¤à¥à¤² निवडा"
#. TRANSLATORS: when we are getting data from the daemon
-#: ../contrib/browser-plugin/src/contents.cpp:298
+#: ../contrib/browser-plugin/src/contents.cpp:299
msgid "Getting package information..."
msgstr "सà¤à¤à¥à¤² माहितॠपà¥à¤°à¤¾à¤ªà¥à¤¤ à¤à¤°à¤¤ à¤à¤¹à¥..."
#. TRANSLATORS: run an applicaiton
-#: ../contrib/browser-plugin/src/contents.cpp:304
+#: ../contrib/browser-plugin/src/contents.cpp:305
#, c-format
msgid "Run %s"
msgstr "%s à¤à¤¾à¤²à¤µà¤¾"
#. TRANSLATORS: show the installed version of a package
-#: ../contrib/browser-plugin/src/contents.cpp:310
+#: ../contrib/browser-plugin/src/contents.cpp:311
msgid "Installed version"
msgstr "पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापà¥à¤¤ à¤à¤µà¥à¤¤à¥à¤¤à¥"
#. TRANSLATORS: run the application now
-#: ../contrib/browser-plugin/src/contents.cpp:318
+#: ../contrib/browser-plugin/src/contents.cpp:319
#, c-format
msgid "Run version %s now"
msgstr "à¤à¤¤à¤¾ à¤à¤µà¥à¤¤à¥à¤¤à¥ %s à¤à¤¾à¤²à¤µà¤¾"
#. TRANSLATORS: run the application now
-#: ../contrib/browser-plugin/src/contents.cpp:324
+#: ../contrib/browser-plugin/src/contents.cpp:325
msgid "Run now"
msgstr "à¤à¤¤à¤¾ à¤à¤¾à¤²à¤µà¤¾"
#. TRANSLATORS: update to a new version of the package
-#: ../contrib/browser-plugin/src/contents.cpp:330
+#: ../contrib/browser-plugin/src/contents.cpp:331
#, c-format
msgid "Update to version %s"
msgstr "à¤à¤µà¥à¤¤à¥à¤¤à¥ %s à¤à¤°à¥à¤¤à¤¾ à¤
दà¥à¤¯à¤¯à¤¾à¤µà¤¤ à¤à¤°à¤¾"
#. TRANSLATORS: To install a package
-#: ../contrib/browser-plugin/src/contents.cpp:336
+#: ../contrib/browser-plugin/src/contents.cpp:337
#, c-format
msgid "Install %s now"
msgstr "%s à¤à¤¤à¤¾ पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापà¥à¤¤ à¤à¤°à¤¾"
#. TRANSLATORS: the version of the package
-#: ../contrib/browser-plugin/src/contents.cpp:339
+#: ../contrib/browser-plugin/src/contents.cpp:340
msgid "Version"
msgstr "à¤à¤µà¥à¤¤à¥à¤¤à¥"
#. TRANSLATORS: noting found, so can't install
-#: ../contrib/browser-plugin/src/contents.cpp:344
+#: ../contrib/browser-plugin/src/contents.cpp:345
msgid "No packages found for your system"
msgstr "तà¥à¤®à¤à¥à¤¯à¤¾ पà¥à¤°à¤£à¤¾à¤²à¥ à¤à¤°à¥à¤¤à¤¾ सà¤à¤à¥à¤² à¤à¤¢à¤³à¤²à¥ नाहà¥"
#. TRANSLATORS: package is being installed
-#: ../contrib/browser-plugin/src/contents.cpp:349
+#: ../contrib/browser-plugin/src/contents.cpp:350
msgid "Installing..."
msgstr "पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापन à¤à¤°à¤¤ à¤à¤¹à¥..."
+#. TRANSLATORS: we couldn't find the package name, non-fatal
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:352
+#, c-format
+msgid "Failed to find the package %s, or already installed: %s"
+msgstr "सà¤à¤à¥à¤² %s शà¥à¤§à¤£à¥à¤¯à¤¾à¤¸ à¤
पयशà¥, à¤à¤¿à¤à¤µà¤¾ à¤à¤§à¤¿à¤ªà¤¾à¤¸à¥à¤¨à¤ पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापà¥à¤¤ à¤
सà¥à¤²: %s"
+
+#. command line argument, simulate what would be done, but don't actually do it
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:429
+msgid "Don't actually install any packages, only simulate"
+msgstr "à¤à¥à¤ लà¥à¤¹à¥ सà¤à¤à¥à¤² पà¥à¤°à¤¤à¥à¤¯à¤à¥à¤·à¤°à¤¿à¤¤à¥à¤¯à¤¾ पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापà¥à¤¤ à¤à¤°à¥ नà¤à¤¾, फà¤à¥à¤¤ सिमà¥à¤¯à¥à¤²à¥à¤ à¤à¤°à¤¾"
+
+#. command line argument, do we skip packages that depend on the ones specified
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:432
+msgid "Do not install dependencies of the core packages"
+msgstr "à¤à¥à¤° सà¤à¤à¥à¤²à¤à¥ à¤
वलà¤à¤¬à¤¨ पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापà¥à¤¤ à¤à¤°à¥ नà¤à¤¾"
+
+#. TRANSLATORS: tool that gets called when the command is not found
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:450
+msgid "PackageKit Debuginfo Installer"
+msgstr "PackageKit Debuginfo Installer"
+
+#. TRANSLATORS: the use needs to specify a list of package names on the command line
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:460
+#, c-format
+msgid "ERROR: Specify package names to install."
+msgstr "ERROR: पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापनà¤à¥à¤à¥ सà¤à¤à¥à¤² नाव निशà¥à¤à¤¿à¤¤ à¤à¤°à¤¾."
+
+#. TRANSLATORS: we are getting the list of repositories
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:483
+#, c-format
+msgid "Getting sources list"
+msgstr "सà¥à¤¤à¥à¤°à¥à¤¤ यादॠपà¥à¤°à¤¾à¤ªà¥à¤¤ à¤à¤°à¤¤ à¤à¤¹à¥"
+
+#. TRANSLATORS: all completed 100%
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:495
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:532
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:559
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:634
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:666
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:715
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:748
+#, c-format
+msgid "OK."
+msgstr "ठिà¤."
+
+#. TRANSLATORS: tell the user what we found
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:498
+#, c-format
+msgid "Found %i enabled and %i disabled sources."
+msgstr "%i à¤à¤¾à¤°à¥à¤¯à¤¾à¤¨à¥à¤µà¥à¤¤ व %i à¤
à¤à¤¾à¤°à¥à¤¯à¤¾à¤¨à¥à¤µà¥à¤¤ सà¥à¤¤à¥à¤°à¥à¤¤ à¤à¤¢à¤³à¤²à¥."
+
+#. TRANSLATORS: we're finding repositories that match out pattern
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:505
+#, c-format
+msgid "Finding debugging sources"
+msgstr "डिबà¤à¥à¤à¤ सà¥à¤¤à¥à¤°à¥à¤¤ शà¥à¤§à¤¤ à¤à¤¹à¥"
+
+#. TRANSLATORS: tell the user what we found
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:535
+#, c-format
+msgid "Found %i disabled debuginfo repos."
+msgstr "%i à¤
à¤à¤¾à¤°à¥à¤¯à¤¾à¤¨à¥à¤µà¥à¤¤ debuginfo repos à¤à¤¢à¤³à¤²à¥."
+
+#. TRANSLATORS: we're now enabling all the debug sources we found
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:542
+#, c-format
+msgid "Enabling debugging sources"
+msgstr "डिबà¤à¥à¤à¤ सà¥à¤¤à¥à¤°à¥à¤¤ à¤à¤¾à¤°à¥à¤¯à¤¾à¤¨à¥à¤µà¥à¤¤ à¤à¤°à¤¤ à¤à¤¹à¥"
+
+#. TRANSLATORS: operation was not successful
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:549
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:625
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:656
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:705
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:739
+msgid "FAILED."
+msgstr "à¤
पयशà¥."
+
+#. TRANSLATORS: tell the user how many we enabled
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:562
+#, c-format
+msgid "Enabled %i debugging sources."
+msgstr "%i डिबà¤à¥à¤à¤ सà¥à¤¤à¥à¤°à¥à¤¤ à¤à¤¾à¤°à¥à¤¯à¤¾à¤¨à¥à¤µà¥à¤¤ à¤à¥à¤²à¥."
+
+#. TRANSLATORS: we're now finding packages that match in all the repos
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:569
+#, c-format
+msgid "Finding debugging packages"
+msgstr "डिबà¤à¥à¤à¤ सà¤à¤à¥à¤² शà¥à¤§à¤¤ à¤à¤¹à¥"
+
+#. TRANSLATORS: we couldn't find the package name, non-fatal
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:580
+#, c-format
+msgid "Failed to find the package %s: %s"
+msgstr "सà¤à¤à¥à¤² %s शà¥à¤§à¤£à¥à¤¯à¤¾à¤¸ à¤
पयशà¥: %s"
+
+#. TRANSLATORS: we couldn't find the debuginfo package name, non-fatal
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:603
+#, c-format
+msgid "Failed to find the debuginfo package %s: %s"
+msgstr "debuginfo सà¤à¤à¥à¤² %s शà¥à¤§à¤£à¥à¤¯à¤¾à¤¸ à¤
पयशà¥: %s"
+
+#. TRANSLATORS: no debuginfo packages could be found to be installed
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:628
+#, c-format
+msgid "Found no packages to install."
+msgstr "पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापन à¤à¤°à¥à¤¤à¤¾ सà¤à¤à¥à¤² à¤à¤¢à¤³à¤²à¥ नाहà¥."
+
+#. TRANSLATORS: tell the user we found some packages, and then list them
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:637
+#, c-format
+msgid "Found %i packages:"
+msgstr "%i सà¤à¤à¥à¤² à¤à¤¢à¤³à¤²à¥:"
+
+#. TRANSLATORS: tell the user we are searching for deps
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:650
+#, c-format
+msgid "Finding packages that depend on these packages"
+msgstr "या सà¤à¤à¥à¤²à¤µà¤° à¤
वलà¤à¤¬à¥à¤¤ सà¤à¤à¥à¤² शà¥à¤§à¤¤ à¤à¤¹à¥"
+
+#. TRANSLATORS: could not install, detailed error follows
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:659
+#, c-format
+msgid "Could not find dependant packages: %s"
+msgstr "à¤
वलà¤à¤¬à¤¨ सà¤à¤à¥à¤² à¤à¤¢à¤³à¤²à¥ नाहà¥: %s"
+
+#. TRANSLATORS: tell the user we found some more packages
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:670
+#, c-format
+msgid "Found %i extra packages."
+msgstr "%i à¤
à¤à¤¾à¤ सà¤à¤à¥à¤² शà¥à¤§à¤¤ à¤à¤¹à¥."
+
+#. TRANSLATORS: tell the user we found some more packages
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:674
+#, c-format
+msgid "No extra packages required."
+msgstr "à¤
à¤à¤¾à¤ सà¤à¤à¥à¤² à¤à¤µà¤¶à¥à¤¯à¤ नाहà¥."
+
+#. TRANSLATORS: tell the user we found some packages (and deps), and then list them
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:680
+#, c-format
+msgid "Found %i packages to install:"
+msgstr "पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापन à¤à¤°à¥à¤¤à¤¾ %i सà¤à¤à¥à¤² à¤à¤¢à¤³à¤²à¥:"
+
+#. TRANSLATORS: simulate mode is a testing mode where we quit before the action
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:689
+#, c-format
+msgid "Not installing packages in simulate mode"
+msgstr "सिमà¥à¤¯à¥à¤²à¥à¤ पदà¥à¤§à¤¤à¥ नà¥à¤°à¥à¤ª सà¤à¤à¥à¤² पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापà¥à¤¤ à¤à¤°à¤¤ नाहà¥"
+
+#. TRANSLATORS: coul dnot install, detailed error follows
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:708
+#, c-format
+msgid "Could not install packages: %s"
+msgstr "सà¤à¤à¥à¤² पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापà¥à¤¤ à¤à¤°à¤£à¥ à¤
शà¤à¥à¤¯: %s"
+
+#. TRANSLATORS: we are now disabling all debuginfo repos we previously enabled
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:732
+#, c-format
+msgid "Disabling sources previously enabled"
+msgstr "पà¥à¤°à¥à¤µà¥ à¤à¤¾à¤°à¥à¤¯à¤¾à¤¨à¥à¤µà¥à¤¤ à¤à¥à¤²à¥à¤²à¥ सà¥à¤¤à¥à¤°à¥à¤¤ à¤
à¤à¤¾à¤°à¥à¤¯à¤¾à¤¨à¥à¤µà¥à¤¤ à¤à¤°à¤¤ à¤à¤¹à¥"
+
+#. TRANSLATORS: no debuginfo packages could be found to be installed, detailed error follows
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:742
+#, c-format
+msgid "Could not disable the debugging sources: %s"
+msgstr "डिबà¤à¥à¤à¤ सà¥à¤¤à¥à¤°à¥à¤¤ à¤
à¤à¤¾à¤°à¥à¤¯à¤¾à¤¨à¥à¤µà¥à¤¤ à¤à¤°à¤£à¥à¤¯à¤¾à¤¸ à¤
शà¤à¥à¤¯: %s"
+
+#. TRANSLATORS: we disabled all the debugging repos that we enabled before
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:751
+#, c-format
+msgid "Disabled %i debugging sources."
+msgstr "%i डिबà¤à¥à¤à¤ सà¥à¤¤à¥à¤°à¥à¤¤ à¤
à¤à¤¾à¤°à¥à¤¯à¤¾à¤¨à¥à¤µà¥à¤¤ à¤à¥à¤²à¥."
+
#: ../data/packagekit-catalog.xml.in.h:1
msgid "PackageKit Catalog"
msgstr "PackageKit सà¥à¤à¥"
@@ -1086,3 +1264,32 @@ msgstr "पà¥à¤°à¤£à¤¾à¤²à¥ बस सह à¤à¥à¤³à¤µà¤£à¥ सà¥à¤¥à¤ªà¥à¤
msgid "Error trying to start:"
msgstr "सà¥à¤°à¥ à¤à¤°à¤¤à¥à¤µà¥à¤³à¥ तà¥à¤°à¥à¤à¥ à¤à¤¢à¤³à¤²à¥:"
+#: ../src/pk-polkit-action-lookup.c:143
+msgid "To install debugging packages, extra sources need to be enabled"
+msgstr "डिबà¤à¥à¤à¤ सà¤à¤à¥à¤² पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापà¥à¤¤ à¤à¤°à¤£à¥à¤¯à¤¾à¤à¤°à¥à¤¤à¤¾, à¤
à¤à¤¾à¤ सà¥à¤¤à¥à¤°à¥à¤¤ à¤à¤¾à¤°à¥à¤¯à¤¾à¤¨à¥à¤µà¥à¤¤ à¤à¤°à¤£à¥ à¤à¤µà¤¶à¥à¤¯à¤ à¤à¤¹à¥"
+
+#. TRANSLATORS: is not GPG signed
+#: ../src/pk-polkit-action-lookup.c:156 ../src/pk-polkit-action-lookup.c:175
+msgid "The software is not from a trusted source."
+msgstr "सà¥à¤«à¥à¤à¤µà¥à¤
रà¤à¥ सà¥à¤¤à¥à¤°à¥à¤¤ विशà¥à¤µà¤¾à¤¸à¤°à¥à¤¹ नाहà¥."
+
+#. TRANSLATORS: user has to trust provider -- I know, this sucks
+#: ../src/pk-polkit-action-lookup.c:160
+msgid "Do not update this package unless you are sure it is safe to do so."
+msgstr "à¤
सॠà¤à¤°à¤£à¥ सà¥à¤°à¤à¥à¤·à¥à¤¤ à¤à¤¹à¥ याà¤à¥ à¤à¤¾à¤¤à¥à¤°à¥ à¤
सà¥à¤ªà¤°à¥à¤¯à¤à¤¤ या सà¤à¤à¥à¤²à¤²à¤¾ à¤
दà¥à¤¯à¤¯à¤¾à¤µà¤¤ à¤à¤°à¥ नà¤à¤¾."
+
+#. TRANSLATORS: warn the user that all bets are off
+#: ../src/pk-polkit-action-lookup.c:164 ../src/pk-polkit-action-lookup.c:183
+msgid "Malicious software can damage your computer or cause other harm."
+msgstr "सदà¥à¤·à¥à¤¤ सà¥à¤«à¥à¤à¤µà¥à¤
र तà¥à¤®à¤à¥à¤¯à¤¾ सà¤à¤à¤£à¤à¤¾à¤²à¤¾ हानॠपà¥à¤°à¤µà¥ शà¤à¤¤à¥ à¤à¤¿à¤à¤µà¤¾ दà¥à¤·à¥à¤¤ à¤à¤°à¥ शà¤à¤¤à¥."
+
+#. TRANSLATORS: user has to trust provider -- I know, this sucks
+#: ../src/pk-polkit-action-lookup.c:179
+msgid "Do not install this package unless you are sure it is safe to do so."
+msgstr "à¤
सॠà¤à¤°à¤£à¥ सà¥à¤°à¤à¥à¤·à¤¿à¤¤ à¤à¤¹à¥ याà¤à¥ à¤à¤¾à¤¤à¥à¤°à¥ à¤
सà¥à¤ªà¤°à¥à¤¯à¤à¤¤ या सà¤à¤à¥à¤²à¤²à¤¾ पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापà¥à¤¤ à¤à¤°à¥ नà¤à¤¾."
+
+#. TRANSLATORS: if the transaction is forced to install only trusted packages
+#: ../src/pk-polkit-action-lookup.c:263
+msgid "Only trusted"
+msgstr "फà¤à¥à¤¤ विशà¥à¤µà¤¾à¤¸à¤°à¥à¤¹"
+
commit 14742c6c7629a97c7ff763eb4b4843c539689758
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Jun 29 12:09:54 2009 +0100
add a man page for pk-debuginfo-install
diff --git a/contrib/PackageKit.spec.in b/contrib/PackageKit.spec.in
index 8be4d5f..9439b2c 100644
--- a/contrib/PackageKit.spec.in
+++ b/contrib/PackageKit.spec.in
@@ -295,7 +295,9 @@ update-mime-database %{_datadir}/mime &> /dev/null || :
%dir %{_datadir}/PackageKit/helpers/test_spawn
%dir %{_datadir}/PackageKit/icons
%{_datadir}/PackageKit/helpers/test_spawn/*
-%{_datadir}/man/man1/*.1.gz
+%{_datadir}/man/man1/pkcon.1.gz
+%{_datadir}/man/man1/pkmon.1.gz
+%{_datadir}/man/man1/pkgenpack.1.gz
%{_datadir}/polkit-1/actions/*.policy
%{_datadir}/mime/packages/packagekit-*.xml
%{_datadir}/PackageKit/pk-upgrade-distro.sh
@@ -364,6 +366,7 @@ update-mime-database %{_datadir}/mime &> /dev/null || :
%defattr(-,root,root,-)
%doc README AUTHORS NEWS COPYING
%{_libexecdir}/pk-debuginfo-install
+%{_datadir}/man/man1/pk-debuginfo-install.1.gz
%files browser-plugin
%defattr(-,root,root,-)
diff --git a/contrib/debuginfo-install/.gitignore b/contrib/debuginfo-install/.gitignore
index 53ecb7a..59b3b82 100644
--- a/contrib/debuginfo-install/.gitignore
+++ b/contrib/debuginfo-install/.gitignore
@@ -2,4 +2,6 @@
.libs
*.o
pk-debuginfo-install
+manpage.*
+*.1
diff --git a/contrib/debuginfo-install/Makefile.am b/contrib/debuginfo-install/Makefile.am
index 00e6779..e0a6e0a 100644
--- a/contrib/debuginfo-install/Makefile.am
+++ b/contrib/debuginfo-install/Makefile.am
@@ -1,6 +1,21 @@
## We require new-style dependency handling.
AUTOMAKE_OPTIONS = 1.7
+EXTRA_DIST = \
+ pk-debuginfo-install.xml \
+ $(NULL)
+
+if HAVE_XSLTPROC
+man_MANS = \
+ pk-debuginfo-install.1 \
+ $(NULL)
+endif
+
+if HAVE_XSLTPROC
+pk-debuginfo-install.1: pk-debuginfo-install.xml
+ xsltproc http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $? &> /dev/null
+endif
+
INCLUDES = \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
@@ -33,3 +48,9 @@ pk_debuginfo_install_CFLAGS = \
$(WARNINGFLAGS_C) \
$(NULL)
+clean-local:
+ rm -f *~
+ rm -f *.1
+ rm -f manpage.*
+ rm -f *.out
+
diff --git a/contrib/debuginfo-install/pk-debuginfo-install.c b/contrib/debuginfo-install/pk-debuginfo-install.c
index 4999025..ca146d8 100644
--- a/contrib/debuginfo-install/pk-debuginfo-install.c
+++ b/contrib/debuginfo-install/pk-debuginfo-install.c
@@ -30,6 +30,24 @@
#include "egg-debug.h"
+/* Reserved exit codes:
+ * 1 miscellaneous errors, such as "divide by zero"
+ * 2 misuse of shell builtins
+ * 126 command invoked cannot execute
+ * 127 "command not found"
+ * 128 invalid argument to exit
+ * 128+n fatal error signal "n"
+ * 130 script terminated by Control-C
+ * 255 exit status out of range
+ */
+#define PK_DEBUGINFO_EXIT_CODE_FAILED 1
+#define PK_DEBUGINFO_EXIT_CODE_FAILED_TO_GET_REPOLIST 3
+#define PK_DEBUGINFO_EXIT_CODE_FAILED_TO_ENABLE 4
+#define PK_DEBUGINFO_EXIT_CODE_NOTHING_TO_DO 5
+#define PK_DEBUGINFO_EXIT_CODE_FAILED_TO_FIND_DEPS 6
+#define PK_DEBUGINFO_EXIT_CODE_FAILED_TO_INSTALL 7
+#define PK_DEBUGINFO_EXIT_CODE_FAILED_TO_DISABLE 8
+
typedef struct {
GPtrArray *enabled;
GPtrArray *disabled;
@@ -408,6 +426,8 @@ main (int argc, char *argv[])
GPtrArray *package_ids_recognised = NULL;
GPtrArray *package_ids_to_install = NULL;
guint i;
+ guint /* return correct failure retval */
+ retval = 0;
gchar *package_id;
gchar *name;
gchar *name_debuginfo;
@@ -426,7 +446,7 @@ main (int argc, char *argv[])
_("Show extra debugging information"), NULL },
{ "simulate", 's', 0, G_OPTION_ARG_NONE, &simulate,
/* command line argument, simulate what would be done, but don't actually do it */
- _("Don't actually install any packages, only simulate"), NULL },
+ _("Don't actually install any packages, only simulate what would be installed"), NULL },
{ "no-depends", 'n', 0, G_OPTION_ARG_NONE, &no_depends,
/* command line argument, do we skip packages that depend on the ones specified */
_("Do not install dependencies of the core packages"), NULL },
@@ -459,6 +479,9 @@ main (int argc, char *argv[])
/* TRANSLATORS: the use needs to specify a list of package names on the command line */
g_print (_("ERROR: Specify package names to install."));
g_print ("\n");
+
+ /* return correct failure retval */
+ retval = PK_DEBUGINFO_EXIT_CODE_FAILED;
goto out;
}
@@ -488,6 +511,9 @@ main (int argc, char *argv[])
if (!ret) {
g_print ("failed to get repo list: %s", error->message);
g_error_free (error);
+
+ /* return correct failure retval */
+ retval = PK_DEBUGINFO_EXIT_CODE_FAILED_TO_GET_REPOLIST;
goto out;
}
@@ -552,6 +578,9 @@ main (int argc, char *argv[])
g_print ("Failed to enable debugging sources: %s", error->message);
g_print ("\n");
g_error_free (error);
+
+ /* return correct failure retval */
+ retval = PK_DEBUGINFO_EXIT_CODE_FAILED_TO_ENABLE;
goto out;
}
@@ -627,6 +656,9 @@ not_found:
/* TRANSLATORS: no debuginfo packages could be found to be installed */
g_print (_("Found no packages to install."));
g_print ("\n");
+
+ /* return correct failure retval */
+ retval = PK_DEBUGINFO_EXIT_CODE_NOTHING_TO_DO;
goto out;
}
@@ -659,6 +691,9 @@ not_found:
g_print (_("Could not find dependant packages: %s"), error->message);
g_print ("\n");
g_error_free (error);
+
+ /* return correct failure retval */
+ retval = PK_DEBUGINFO_EXIT_CODE_FAILED_TO_FIND_DEPS;
goto out;
}
@@ -708,6 +743,9 @@ not_found:
g_print (_("Could not install packages: %s"), error->message);
g_print ("\n");
g_error_free (error);
+
+ /* return correct failure retval */
+ retval = PK_DEBUGINFO_EXIT_CODE_FAILED_TO_INSTALL;
goto out;
}
@@ -742,6 +780,10 @@ out:
g_print (_("Could not disable the debugging sources: %s"), error->message);
g_print ("\n");
g_error_free (error);
+
+ /* return correct failure retval */
+ retval = PK_DEBUGINFO_EXIT_CODE_FAILED_TO_DISABLE;
+
} else {
/* TRANSLATORS: all completed 100% */
@@ -765,6 +807,6 @@ out:
}
if (priv->client != NULL)
g_object_unref (priv->client);
- return 0;
+ return retval;
}
diff --git a/contrib/debuginfo-install/pk-debuginfo-install.xml b/contrib/debuginfo-install/pk-debuginfo-install.xml
new file mode 100644
index 0000000..f518be8
--- /dev/null
+++ b/contrib/debuginfo-install/pk-debuginfo-install.xml
@@ -0,0 +1,192 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
+
+<!-- Process this file with docbook-to-man to generate an nroff manual
+ page: `docbook-to-man manpage.xml > manpage.1'. You may view
+ the manual page with: `docbook-to-man manpage.xml | nroff -man |
+ less'. A typical entry in a Makefile or Makefile.am is:
+
+manpage.1: manpage.xml
+ docbook-to-man $< > $@
+
+ The docbook-to-man binary is found in the docbook-to-man package.
+ Please remember that if you create the nroff version in one of the
+ debian/rules file targets (such as build), you will need to include
+ docbook-to-man in your Build-Depends control field.
+ -->
+
+ <!-- Please adjust the date whenever revising the manpage. -->
+ <!ENTITY date "<date>29 July,2009</date>">
+ <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
+ allowed: see man(7), man(1). -->
+ <!ENTITY package "pk-debuginfo-install">
+ <!ENTITY gnu "<acronym>GNU</acronym>">
+ <!ENTITY gpl "&gnu; <acronym>GPL</acronym>">
+]>
+
+<refentry>
+ <refentryinfo>
+ <copyright>
+ <year>2009</year>
+ <holder>Richard Hughes</holder>
+ </copyright>
+ &date;
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>pk-debuginfo-install</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>&package;</refname>
+ <refpurpose>Debugging Packages Installer</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>&package;</command>
+ <arg><option>--help</option></arg>
+ <arg><option>--verbose</option></arg>
+ <arg><option>--simulate</option></arg>
+ <arg><option>--no-depends</option></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ This manual page documents briefly the <command>&package;</command> command.
+ </para>
+ <para>
+ <command>&package;</command> is the command line client for installing debuginfo packages.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Why do I need debuginfo packages?</title>
+ <para>
+ When a program crashes, it's often useful to send the developer a backtrace
+ which contains symbol names and variable contents, rather than memory addresses.
+ To make this possible, extra packages called debug packages can be installed.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Options</title>
+ <para>
+ This program follows the usual &gnu; command line syntax, with long options
+ starting with two dashes (`-').
+ A summary of options is included below.
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <option>--help</option>
+ </term>
+ <listitem>
+ <para>Show summary of options.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <option>--verbose</option>
+ </term>
+ <listitem>
+ <para>Show extra debugging information.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <option>--simulate</option>
+ </term>
+ <listitem>
+ <para>Don't actually install any packages, only simulate what would be installed.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <option>--no-depends</option>
+ </term>
+ <listitem>
+ <para>Do not scan for, or install dependencies of the core packages.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Return values</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <option>0</option>
+ </term>
+ <listitem>
+ <para>Success, at least one package was installed</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <option>1</option>
+ </term>
+ <listitem>
+ <para>Miscellaneous internal errors.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <option>3</option>
+ </term>
+ <listitem>
+ <para>Failed to get software sources list.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <option>4</option>
+ </term>
+ <listitem>
+ <para>Failed to enable software sources.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <option>5</option>
+ </term>
+ <listitem>
+ <para>Nothing to do.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <option>6</option>
+ </term>
+ <listitem>
+ <para>Failed to find dependant packages.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <option>7</option>
+ </term>
+ <listitem>
+ <para>Failed to install.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <option>8</option>
+ </term>
+ <listitem>
+ <para>Failed to disable software sources.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+
+ <refsect1>
+ <title>See Also</title>
+ <para><command>pkmon</command> (1). <command>pkcon</command>(1).</para>
+ </refsect1>
+ <refsect1>
+ <title>Author</title>
+ <para>
+ This manual page was written by Richard Hughes <email>richard at hughsie.com</email>.
+ </para>
+ </refsect1>
+</refentry>
commit 5db499893160093c67c70e2bffbb986f3eaaf73b
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Jun 29 11:12:16 2009 +0100
Move the client man pages from man/ to client/
diff --git a/Makefile.am b/Makefile.am
index f1d1d39..985dcea 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,7 +6,6 @@ SUBDIRS = \
po \
policy \
etc \
- man \
data \
lib \
src \
diff --git a/client/.gitignore b/client/.gitignore
index 443b31d..f2c5429 100644
--- a/client/.gitignore
+++ b/client/.gitignore
@@ -12,4 +12,6 @@ pk-self-test
*.gladep
*.gladep.bak
*.servicepack
+manpage.*
+*.1
diff --git a/client/Makefile.am b/client/Makefile.am
index ccd24e4..5772125 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -3,6 +3,31 @@ AUTOMAKE_OPTIONS = 1.7
NULL =
+EXTRA_DIST = \
+ pkcon.xml \
+ pkmon.xml \
+ pkgenpack.xml \
+ $(NULL)
+
+if HAVE_XSLTPROC
+man_MANS = \
+ pkcon.1 \
+ pkmon.1 \
+ pkgenpack.1 \
+ $(NULL)
+endif
+
+if HAVE_XSLTPROC
+pkcon.1: pkcon.xml
+ xsltproc http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $? &> /dev/null
+
+pkmon.1: pkmon.xml
+ xsltproc http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $? &> /dev/null
+
+pkgenpack.1: pkgenpack.xml
+ xsltproc http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $? &> /dev/null
+endif
+
INCLUDES = \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
@@ -121,6 +146,8 @@ endif
clean-local:
rm -f *~
+ rm -f *.1
+ rm -f manpage.*
rm -f *.out
CLEANFILES = $(BUILT_SOURCES)
diff --git a/client/pkcon.xml b/client/pkcon.xml
new file mode 100644
index 0000000..f550f59
--- /dev/null
+++ b/client/pkcon.xml
@@ -0,0 +1,80 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
+
+<!-- Process this file with docbook-to-man to generate an nroff manual
+ page: `docbook-to-man manpage.xml > manpage.1'. You may view
+ the manual page with: `docbook-to-man manpage.xml | nroff -man |
+ less'. A typical entry in a Makefile or Makefile.am is:
+
+manpage.1: manpage.xml
+ docbook-to-man $< > $@
+
+ The docbook-to-man binary is found in the docbook-to-man package.
+ Please remember that if you create the nroff version in one of the
+ debian/rules file targets (such as build), you will need to include
+ docbook-to-man in your Build-Depends control field.
+ -->
+
+ <!-- Please adjust the date whenever revising the manpage. -->
+ <!ENTITY date "<date>29 March,2006</date>">
+ <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
+ allowed: see man(7), man(1). -->
+ <!ENTITY package "pkcon">
+ <!ENTITY gnu "<acronym>GNU</acronym>">
+ <!ENTITY gpl "&gnu; <acronym>GPL</acronym>">
+]>
+
+<refentry>
+ <refentryinfo>
+ <address>
+ <email>richard at hughsie.com</email>;
+ </address>
+ <author>
+ <firstname>Richard</firstname>
+ <surname>Hughes</surname>
+ </author>
+ <copyright>
+ <year>2007</year>
+ <holder>Richard Hughes</holder>
+ </copyright>
+ &date;
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>pkcon</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>&package;</refname>
+ <refpurpose>PackageKit console client</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>&package;</command>
+ <arg><option>search</option></arg>
+ <arg><option>debug install</option></arg>
+ <arg><option>remove</option></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ This manual page documents briefly the <command>&package;</command> command.
+ </para>
+ <para>
+ <command>&package;</command> is the command line client for PackageKit.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>pkmon (1).</para>
+ <para>
+ The programs are documented fully on http://www.packagekit.org.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+ <para>This manual page was written by Richard Hughes <email>richard at hughsie.com</email>.
+ </para>
+ </refsect1>
+</refentry>
diff --git a/client/pkgenpack.xml b/client/pkgenpack.xml
new file mode 100644
index 0000000..aa8640d
--- /dev/null
+++ b/client/pkgenpack.xml
@@ -0,0 +1,209 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
+
+<!-- Process this file with docbook-to-man to generate an nroff manual
+ page: `docbook-to-man manpage.xml > manpage.1'. You may view
+ the manual page with: `docbook-to-man manpage.xml | nroff -man |
+ less'. A typical entry in a Makefile or Makefile.am is:
+
+manpage.1: manpage.xml
+ docbook-to-man $< > $@
+
+ The docbook-to-man binary is found in the docbook-to-man package.
+ Please remember that if you create the nroff version in one of the
+ debian/rules file targets (such as build), you will need to include
+ docbook-to-man in your Build-Depends control field.
+ -->
+
+ <!-- Please adjust the date whenever revising the manpage. -->
+ <!ENTITY date "<date>31 July,2008</date>">
+ <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
+ allowed: see man(7), man(1). -->
+ <!ENTITY package "pkgenpack">
+ <!ENTITY gnu "<acronym>GNU</acronym>">
+ <!ENTITY gpl "&gnu; <acronym>GPL</acronym>">
+]>
+
+<refentry>
+ <refentryinfo>
+ <copyright>
+ <year>2008</year>
+ <holder>Shishir Goel</holder>
+ </copyright>
+ &date;
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>pkgenpack</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>&package;</refname>
+ <refpurpose>PackageKit Pack Generator</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>&package;</command>
+ <arg><option>--help</option></arg>
+ <arg><option>--verbose</option></arg>
+ <arg><option>--with-package-list</option></arg>
+ <arg><option>--output</option></arg>
+ <arg><option>--package</option></arg>
+ <arg><option>--updates</option></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>Description</title>
+ <para>
+ This manual page documents briefly the <command>&package;</command> command.
+ </para>
+ <para>
+ <command>&package;</command> is the command line client for PackageKit for creating service packs.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>What is a Service Pack?</title>
+ <para>
+ A service pack is a tarball which contains a set of packages and their dependencies.
+ The user can reduce the dependencies to be packed using the --with-package-list option.
+ Along with the dependencies, a service pack has a file named metadata.conf which contains
+ the information about the distribution and creation date of the pack.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Creating a Service Pack?</title>
+ <para>
+ A service pack is created using the command <command>pkgenpack</command>.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Options</title>
+ <para>
+ This program follows the usual &gnu; command line syntax, with long options
+ starting with two dashes (`-').
+ A summary of options is included below.
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <option>--help</option>
+ </term>
+ <listitem>
+ <para>Show summary of options.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <option>--verbose</option>
+ </term>
+ <listitem>
+ <para>Show extra debugging information.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <option>--with-package-list</option>
+ </term>
+ <listitem>
+ <para>Set the filename of dependencies to be excluded.</para>
+ <para>
+ Generally, the file list of packages is generated
+ when doing a PackageKit refresh on the target system.
+ If not specified, <command>pkgenpack</command> uses
+ <filename>/var/lib/PackageKit/system.package-list</filename> by default.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <option>--output</option>
+ </term>
+ <listitem>
+ <para>The directory to put the pack file, or the current directory if omitted.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <option>--package</option>
+ </term>
+ <listitem>
+ <para>The package to be put into the ServicePack.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <option>--update</option>
+ </term>
+ <listitem>
+ <para>Put all updates available in the ServicePack.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>Naming a Service Pack</title>
+ <para>
+ The only valid extension for a service pack is ".servicepack".
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Examples</title>
+ <para>
+ 1. Tim is facing problems with his Internet connection at home.
+ He needs a service pack with valgrind and it's dependencies for his system.
+ He asks James to generate a pack for him.
+ Both know James's system should contain similar packages as Tim's system,
+ as both of them have installed Fedora 9 two days ago.
+ </para>
+ <para>
+ James simply runs:
+ </para>
+<programlisting>
+[james at jamesbook:~]$ pkgenpack --output=/media/USB/TimPacks --package=valgrind
+</programlisting>
+ <para>
+ This generates a file <filename>/media/USB/TimPacks/valgrind-fedora-9-i686.servicepack</filename>
+ on the USB key Tim gave to James.
+ Tim can now go home, insert the USB key and double clicks on the
+ <filename>valgrind-fedora-9-i686.servicepack</filename> file to be prompted
+ to install these packages.
+ </para>
+ <para>
+ 2. Bill wants to create a service pack named <filename>kdegames-fedora-9-i686.servicepack</filename>
+ for his new system which does not have an internet connection.
+ He generates a list of packages on his system using <command>pkcon list-create</command>
+ and copies that list to his USB key.
+ He then gives that USB to Rishi who has a good internet connectivity.
+ Rishi runs the following command on his system:
+ </para>
+<programlisting>
+[rishi at devils-temple:~]$ pkgenpack --with-package-list=/media/USB/bill.package-list \
+ --output=/home/rishi/Desktop --program=kdegames
+</programlisting>
+ <para>
+ This generates a service pack, kdegames-fedora-9-i686.servicepack, on Rishi's
+ Desktop, which can be distributed to Bill and users with similar requirements.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>Installing A Service Pack</title>
+ <para>
+ Service Packs can be installed using pkcon.
+ For example:
+ </para>
+<programlisting>
+[hacker at tim-lounge:~]$ pkcon install /media/USB/TimPacks/valgrind-fedora-9-i686.servicepack
+</programlisting>
+ </refsect1>
+ <refsect1>
+ <title>See Also</title>
+ <para><command>pkmon</command> (1). <command>pkcon</command>(1).</para>
+ </refsect1>
+ <refsect1>
+ <title>Author</title>
+ <para>
+ This manual page was written by Shishir Goel <email>crazyontheedge at gmail.com</email> and
+ Richard Hughes <email>richard at hughsie.com</email>.
+ </para>
+ </refsect1>
+</refentry>
diff --git a/client/pkmon.xml b/client/pkmon.xml
new file mode 100644
index 0000000..7e50a16
--- /dev/null
+++ b/client/pkmon.xml
@@ -0,0 +1,80 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
+
+<!-- Process this file with docbook-to-man to generate an nroff manual
+ page: `docbook-to-man manpage.xml > manpage.1'. You may view
+ the manual page with: `docbook-to-man manpage.xml | nroff -man |
+ less'. A typical entry in a Makefile or Makefile.am is:
+
+manpage.1: manpage.xml
+ docbook-to-man $< > $@
+
+ The docbook-to-man binary is found in the docbook-to-man package.
+ Please remember that if you create the nroff version in one of the
+ debian/rules file targets (such as build), you will need to include
+ docbook-to-man in your Build-Depends control field.
+ -->
+
+ <!-- Please adjust the date whenever revising the manpage. -->
+ <!ENTITY date "<date>29 March,2006</date>">
+ <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
+ allowed: see man(7), man(1). -->
+ <!ENTITY package "pkmon">
+ <!ENTITY gnu "<acronym>GNU</acronym>">
+ <!ENTITY gpl "&gnu; <acronym>GPL</acronym>">
+]>
+
+<refentry>
+ <refentryinfo>
+ <address>
+ <email>richard at hughsie.com</email>;
+ </address>
+ <author>
+ <firstname>Richard</firstname>
+ <surname>Hughes</surname>
+ </author>
+ <copyright>
+ <year>2007</year>
+ <holder>Richard Hughes</holder>
+ </copyright>
+ &date;
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>pkmon</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>&package;</refname>
+ <refpurpose>PackageKit console client</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>&package;</command>
+ <arg><option>search</option></arg>
+ <arg><option>debug install</option></arg>
+ <arg><option>remove</option></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ This manual page documents briefly the <command>&package;</command> command.
+ </para>
+ <para>
+ <command>&package;</command> is the command line client for PackageKit.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>pkcon (1).</para>
+ <para>
+ The programs are documented fully on http://www.packagekit.org.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+ <para>This manual page was written by Richard Hughes <email>richard at hughsie.com</email>.
+ </para>
+ </refsect1>
+</refentry>
diff --git a/configure.ac b/configure.ac
index 8a19e96..cfa8b80 100644
--- a/configure.ac
+++ b/configure.ac
@@ -704,7 +704,6 @@ dnl ---------------------------------------------------------------------------
AC_OUTPUT([
Makefile
etc/Makefile
-man/Makefile
docs/Makefile
docs/html/Makefile
docs/html/img/Makefile
diff --git a/man/.gitignore b/man/.gitignore
deleted file mode 100644
index b88437c..0000000
--- a/man/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-manpage.links
-manpage.refs
-*.1
-
diff --git a/man/Makefile.am b/man/Makefile.am
deleted file mode 100644
index ecb50bc..0000000
--- a/man/Makefile.am
+++ /dev/null
@@ -1,28 +0,0 @@
-EXTRA_DIST = \
- pkcon.xml \
- pkmon.xml \
- pkgenpack.xml
-
-if HAVE_XSLTPROC
-man_MANS = \
- pkcon.1 \
- pkmon.1 \
- pkgenpack.1
-endif
-
-if HAVE_XSLTPROC
-pkcon.1: pkcon.xml
- xsltproc http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $? &> /dev/null
-
-pkmon.1: pkmon.xml
- xsltproc http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $? &> /dev/null
-
-pkgenpack.1: pkgenpack.xml
- xsltproc http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $? &> /dev/null
-endif
-
-clean-local :
- rm -f *~
- rm -f *.1
- rm -f manpage.*
-
diff --git a/man/pkcon.xml b/man/pkcon.xml
deleted file mode 100644
index f550f59..0000000
--- a/man/pkcon.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version='1.0' encoding='ISO-8859-1'?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
-"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
-
-<!-- Process this file with docbook-to-man to generate an nroff manual
- page: `docbook-to-man manpage.xml > manpage.1'. You may view
- the manual page with: `docbook-to-man manpage.xml | nroff -man |
- less'. A typical entry in a Makefile or Makefile.am is:
-
-manpage.1: manpage.xml
- docbook-to-man $< > $@
-
- The docbook-to-man binary is found in the docbook-to-man package.
- Please remember that if you create the nroff version in one of the
- debian/rules file targets (such as build), you will need to include
- docbook-to-man in your Build-Depends control field.
- -->
-
- <!-- Please adjust the date whenever revising the manpage. -->
- <!ENTITY date "<date>29 March,2006</date>">
- <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
- allowed: see man(7), man(1). -->
- <!ENTITY package "pkcon">
- <!ENTITY gnu "<acronym>GNU</acronym>">
- <!ENTITY gpl "&gnu; <acronym>GPL</acronym>">
-]>
-
-<refentry>
- <refentryinfo>
- <address>
- <email>richard at hughsie.com</email>;
- </address>
- <author>
- <firstname>Richard</firstname>
- <surname>Hughes</surname>
- </author>
- <copyright>
- <year>2007</year>
- <holder>Richard Hughes</holder>
- </copyright>
- &date;
- </refentryinfo>
- <refmeta>
- <refentrytitle>pkcon</refentrytitle>
- <manvolnum>1</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>&package;</refname>
- <refpurpose>PackageKit console client</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>&package;</command>
- <arg><option>search</option></arg>
- <arg><option>debug install</option></arg>
- <arg><option>remove</option></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>DESCRIPTION</title>
- <para>
- This manual page documents briefly the <command>&package;</command> command.
- </para>
- <para>
- <command>&package;</command> is the command line client for PackageKit.
- </para>
- </refsect1>
- <refsect1>
- <title>SEE ALSO</title>
- <para>pkmon (1).</para>
- <para>
- The programs are documented fully on http://www.packagekit.org.
- </para>
- </refsect1>
- <refsect1>
- <title>AUTHOR</title>
- <para>This manual page was written by Richard Hughes <email>richard at hughsie.com</email>.
- </para>
- </refsect1>
-</refentry>
diff --git a/man/pkgenpack.xml b/man/pkgenpack.xml
deleted file mode 100644
index aa8640d..0000000
--- a/man/pkgenpack.xml
+++ /dev/null
@@ -1,209 +0,0 @@
-<?xml version='1.0' encoding='ISO-8859-1'?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
-"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
-
-<!-- Process this file with docbook-to-man to generate an nroff manual
- page: `docbook-to-man manpage.xml > manpage.1'. You may view
- the manual page with: `docbook-to-man manpage.xml | nroff -man |
- less'. A typical entry in a Makefile or Makefile.am is:
-
-manpage.1: manpage.xml
- docbook-to-man $< > $@
-
- The docbook-to-man binary is found in the docbook-to-man package.
- Please remember that if you create the nroff version in one of the
- debian/rules file targets (such as build), you will need to include
- docbook-to-man in your Build-Depends control field.
- -->
-
- <!-- Please adjust the date whenever revising the manpage. -->
- <!ENTITY date "<date>31 July,2008</date>">
- <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
- allowed: see man(7), man(1). -->
- <!ENTITY package "pkgenpack">
- <!ENTITY gnu "<acronym>GNU</acronym>">
- <!ENTITY gpl "&gnu; <acronym>GPL</acronym>">
-]>
-
-<refentry>
- <refentryinfo>
- <copyright>
- <year>2008</year>
- <holder>Shishir Goel</holder>
- </copyright>
- &date;
- </refentryinfo>
- <refmeta>
- <refentrytitle>pkgenpack</refentrytitle>
- <manvolnum>1</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>&package;</refname>
- <refpurpose>PackageKit Pack Generator</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>&package;</command>
- <arg><option>--help</option></arg>
- <arg><option>--verbose</option></arg>
- <arg><option>--with-package-list</option></arg>
- <arg><option>--output</option></arg>
- <arg><option>--package</option></arg>
- <arg><option>--updates</option></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>Description</title>
- <para>
- This manual page documents briefly the <command>&package;</command> command.
- </para>
- <para>
- <command>&package;</command> is the command line client for PackageKit for creating service packs.
- </para>
- </refsect1>
- <refsect1>
- <title>What is a Service Pack?</title>
- <para>
- A service pack is a tarball which contains a set of packages and their dependencies.
- The user can reduce the dependencies to be packed using the --with-package-list option.
- Along with the dependencies, a service pack has a file named metadata.conf which contains
- the information about the distribution and creation date of the pack.
- </para>
- </refsect1>
- <refsect1>
- <title>Creating a Service Pack?</title>
- <para>
- A service pack is created using the command <command>pkgenpack</command>.
- </para>
- </refsect1>
- <refsect1>
- <title>Options</title>
- <para>
- This program follows the usual &gnu; command line syntax, with long options
- starting with two dashes (`-').
- A summary of options is included below.
- </para>
- <variablelist>
- <varlistentry>
- <term>
- <option>--help</option>
- </term>
- <listitem>
- <para>Show summary of options.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <option>--verbose</option>
- </term>
- <listitem>
- <para>Show extra debugging information.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <option>--with-package-list</option>
- </term>
- <listitem>
- <para>Set the filename of dependencies to be excluded.</para>
- <para>
- Generally, the file list of packages is generated
- when doing a PackageKit refresh on the target system.
- If not specified, <command>pkgenpack</command> uses
- <filename>/var/lib/PackageKit/system.package-list</filename> by default.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <option>--output</option>
- </term>
- <listitem>
- <para>The directory to put the pack file, or the current directory if omitted.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <option>--package</option>
- </term>
- <listitem>
- <para>The package to be put into the ServicePack.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <option>--update</option>
- </term>
- <listitem>
- <para>Put all updates available in the ServicePack.</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- <title>Naming a Service Pack</title>
- <para>
- The only valid extension for a service pack is ".servicepack".
- </para>
- </refsect1>
- <refsect1>
- <title>Examples</title>
- <para>
- 1. Tim is facing problems with his Internet connection at home.
- He needs a service pack with valgrind and it's dependencies for his system.
- He asks James to generate a pack for him.
- Both know James's system should contain similar packages as Tim's system,
- as both of them have installed Fedora 9 two days ago.
- </para>
- <para>
- James simply runs:
- </para>
-<programlisting>
-[james at jamesbook:~]$ pkgenpack --output=/media/USB/TimPacks --package=valgrind
-</programlisting>
- <para>
- This generates a file <filename>/media/USB/TimPacks/valgrind-fedora-9-i686.servicepack</filename>
- on the USB key Tim gave to James.
- Tim can now go home, insert the USB key and double clicks on the
- <filename>valgrind-fedora-9-i686.servicepack</filename> file to be prompted
- to install these packages.
- </para>
- <para>
- 2. Bill wants to create a service pack named <filename>kdegames-fedora-9-i686.servicepack</filename>
- for his new system which does not have an internet connection.
- He generates a list of packages on his system using <command>pkcon list-create</command>
- and copies that list to his USB key.
- He then gives that USB to Rishi who has a good internet connectivity.
- Rishi runs the following command on his system:
- </para>
-<programlisting>
-[rishi at devils-temple:~]$ pkgenpack --with-package-list=/media/USB/bill.package-list \
- --output=/home/rishi/Desktop --program=kdegames
-</programlisting>
- <para>
- This generates a service pack, kdegames-fedora-9-i686.servicepack, on Rishi's
- Desktop, which can be distributed to Bill and users with similar requirements.
- </para>
- </refsect1>
- <refsect1>
- <title>Installing A Service Pack</title>
- <para>
- Service Packs can be installed using pkcon.
- For example:
- </para>
-<programlisting>
-[hacker at tim-lounge:~]$ pkcon install /media/USB/TimPacks/valgrind-fedora-9-i686.servicepack
-</programlisting>
- </refsect1>
- <refsect1>
- <title>See Also</title>
- <para><command>pkmon</command> (1). <command>pkcon</command>(1).</para>
- </refsect1>
- <refsect1>
- <title>Author</title>
- <para>
- This manual page was written by Shishir Goel <email>crazyontheedge at gmail.com</email> and
- Richard Hughes <email>richard at hughsie.com</email>.
- </para>
- </refsect1>
-</refentry>
diff --git a/man/pkmon.xml b/man/pkmon.xml
deleted file mode 100644
index 7e50a16..0000000
--- a/man/pkmon.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version='1.0' encoding='ISO-8859-1'?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
-"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
-
-<!-- Process this file with docbook-to-man to generate an nroff manual
- page: `docbook-to-man manpage.xml > manpage.1'. You may view
- the manual page with: `docbook-to-man manpage.xml | nroff -man |
- less'. A typical entry in a Makefile or Makefile.am is:
-
-manpage.1: manpage.xml
- docbook-to-man $< > $@
-
- The docbook-to-man binary is found in the docbook-to-man package.
- Please remember that if you create the nroff version in one of the
- debian/rules file targets (such as build), you will need to include
- docbook-to-man in your Build-Depends control field.
- -->
-
- <!-- Please adjust the date whenever revising the manpage. -->
- <!ENTITY date "<date>29 March,2006</date>">
- <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
- allowed: see man(7), man(1). -->
- <!ENTITY package "pkmon">
- <!ENTITY gnu "<acronym>GNU</acronym>">
- <!ENTITY gpl "&gnu; <acronym>GPL</acronym>">
-]>
-
-<refentry>
- <refentryinfo>
- <address>
- <email>richard at hughsie.com</email>;
- </address>
- <author>
- <firstname>Richard</firstname>
- <surname>Hughes</surname>
- </author>
- <copyright>
- <year>2007</year>
- <holder>Richard Hughes</holder>
- </copyright>
- &date;
- </refentryinfo>
- <refmeta>
- <refentrytitle>pkmon</refentrytitle>
- <manvolnum>1</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>&package;</refname>
- <refpurpose>PackageKit console client</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>&package;</command>
- <arg><option>search</option></arg>
- <arg><option>debug install</option></arg>
- <arg><option>remove</option></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>DESCRIPTION</title>
- <para>
- This manual page documents briefly the <command>&package;</command> command.
- </para>
- <para>
- <command>&package;</command> is the command line client for PackageKit.
- </para>
- </refsect1>
- <refsect1>
- <title>SEE ALSO</title>
- <para>pkcon (1).</para>
- <para>
- The programs are documented fully on http://www.packagekit.org.
- </para>
- </refsect1>
- <refsect1>
- <title>AUTHOR</title>
- <para>This manual page was written by Richard Hughes <email>richard at hughsie.com</email>.
- </para>
- </refsect1>
-</refentry>
commit ebe393d1ff0bda49d168a4a399c1a968f619e29a
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Jun 29 11:05:36 2009 +0100
Fix the options list of pk-debuginfo-install
diff --git a/contrib/debuginfo-install/pk-debuginfo-install.c b/contrib/debuginfo-install/pk-debuginfo-install.c
index e1039d5..4999025 100644
--- a/contrib/debuginfo-install/pk-debuginfo-install.c
+++ b/contrib/debuginfo-install/pk-debuginfo-install.c
@@ -427,7 +427,7 @@ main (int argc, char *argv[])
{ "simulate", 's', 0, G_OPTION_ARG_NONE, &simulate,
/* command line argument, simulate what would be done, but don't actually do it */
_("Don't actually install any packages, only simulate"), NULL },
- { "--no-depends", 'n', 0, G_OPTION_ARG_NONE, &no_depends,
+ { "no-depends", 'n', 0, G_OPTION_ARG_NONE, &no_depends,
/* command line argument, do we skip packages that depend on the ones specified */
_("Do not install dependencies of the core packages"), NULL },
{ NULL}
commit 120052b29af3205ba5bc6fd9397f733685566172
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Jun 29 11:01:59 2009 +0100
yum: remove custom hacking in Resolve(), and treat like precise search
diff --git a/backends/yum/yumBackend.py b/backends/yum/yumBackend.py
index b253819..6ec5bd1 100755
--- a/backends/yum/yumBackend.py
+++ b/backends/yum/yumBackend.py
@@ -1429,34 +1429,38 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
self.status(STATUS_QUERY)
fltlist = filters.split(';')
+ pkgfilter = YumFilter(fltlist)
+ package_list = []
+
+ # OR search
for package in packages:
# Get installed packages
- try:
- installedByKey = self.yumbase.rpmdb.searchNevra(name=package)
- except Exception, e:
- self.error(ERROR_INTERNAL_ERROR, _format_str(traceback.format_exc()))
if FILTER_NOT_INSTALLED not in fltlist:
- for pkg in installedByKey:
- self._show_package(pkg, INFO_INSTALLED)
+ try:
+ pkgs = self.yumbase.rpmdb.searchNevra(name=package)
+ except Exception, e:
+ self.error(ERROR_INTERNAL_ERROR, _format_str(traceback.format_exc()))
+ else:
+ pkgfilter.add_installed(pkgs)
+
# Get available packages
if FILTER_INSTALLED not in fltlist:
try:
- pkgs = self.yumbase.pkgSack.returnNewestByNameArch()
+ pkgs = self.yumbase.pkgSack.returnNewestByName(name=package)
+ except yum.Errors.PackageSackError, e:
+ # no package of this name found, which is okay
+ pass
except yum.Errors.RepoError, e:
self.error(ERROR_NO_CACHE, "failed to return newest by package sack: %s" %_to_unicode(e), exit=False)
return
except Exception, e:
self.error(ERROR_INTERNAL_ERROR, _format_str(traceback.format_exc()))
else:
- for pkg in pkgs:
- if pkg.name == package:
- show = True
- for instpo in installedByKey:
- # Check if package has equal EVR to a inst pkg
- if pkg.EVR == instpo.EVR:
- show = False
- if show:
- self._show_package(pkg, INFO_AVAILABLE)
+ pkgfilter.add_available(pkgs)
+
+ # we couldn't do this when generating the list
+ package_list = pkgfilter.post_process()
+ self._show_package_list(package_list)
def install_packages(self, only_trusted, package_ids):
'''
commit 53630d6578b1a703e304a59b0f090376739b48ee
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Jun 29 10:41:47 2009 +0100
yum: don't do unconditional NEWEST filtering on resolve
diff --git a/backends/yum/yumBackend.py b/backends/yum/yumBackend.py
index 9c8644e..b253819 100755
--- a/backends/yum/yumBackend.py
+++ b/backends/yum/yumBackend.py
@@ -1452,8 +1452,8 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
if pkg.name == package:
show = True
for instpo in installedByKey:
- # Check if package have a smaller & equal EVR to a inst pkg
- if pkg.EVR < instpo.EVR or pkg.EVR == instpo.EVR:
+ # Check if package has equal EVR to a inst pkg
+ if pkg.EVR == instpo.EVR:
show = False
if show:
self._show_package(pkg, INFO_AVAILABLE)
commit 70734c2eef90aa625789edddc8067bb754a5ef39
Author: raven <raven at fedoraproject.org>
Date: Sun Jun 28 16:52:16 2009 +0000
Sending translation for Polish
diff --git a/po/pl.po b/po/pl.po
index ca87674..a3c08ce 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -5,8 +5,8 @@ msgid ""
msgstr ""
"Project-Id-Version: pl\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-06-28 01:46+0000\n"
-"PO-Revision-Date: 2009-06-28 03:58+0200\n"
+"POT-Creation-Date: 2009-06-28 14:26+0000\n"
+"PO-Revision-Date: 2009-06-28 18:50+0200\n"
"Last-Translator: Piotr DrÄ
g <piotrdrag at gmail.com>\n"
"Language-Team: Polish <pl at li.org>\n"
"MIME-Version: 1.0\n"
@@ -188,10 +188,13 @@ msgid "Updated"
msgstr "Zaktualizowano"
#: ../client/pk-console.c:473 ../client/pk-console.c:475
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:392
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:394
msgid "Percentage"
msgstr "Procentowo"
#: ../client/pk-console.c:475
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:394
msgid "Unknown"
msgstr "Nieznane"
@@ -403,7 +406,10 @@ msgid "No packages can be found to install"
msgstr "Nie można znaleÅºÄ pakietów do zainstalowania"
#. TRANSLATORS: installing new packages from package list
+#. TRANSLATORS: we are now installing the debuginfo packages we found earlier
#: ../client/pk-console.c:1369
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:698
+#, c-format
msgid "Installing packages"
msgstr "Instalowanie pakietów"
@@ -494,7 +500,7 @@ msgstr "Podpolecenia:"
#: ../client/pk-console.c:1768 ../client/pk-generate-pack.c:185
#: ../client/pk-monitor.c:125
#: ../contrib/command-not-found/pk-command-not-found.c:521
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:303
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:426
#: ../src/pk-main.c:211
msgid "Show extra debugging information"
msgstr "WyÅwietla dodatkowe informacje o debugowaniu"
@@ -916,117 +922,179 @@ msgstr "Nie znaleziono pakietów dla systemu"
msgid "Installing..."
msgstr "Instalowanie..."
+#. TRANSLATORS: we couldn't find the package name, non-fatal
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:352
+#, c-format
+msgid "Failed to find the package %s, or already installed: %s"
+msgstr "Znalezienie pakietu %s nie powiodÅo siÄ lub jest już zainstalowany: %s"
+
#. command line argument, simulate what would be done, but don't actually do it
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:306
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:429
msgid "Don't actually install any packages, only simulate"
msgstr "Nie instaluje żadnych pakietów, tylko symuluje"
+#. command line argument, do we skip packages that depend on the ones specified
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:432
+msgid "Do not install dependencies of the core packages"
+msgstr "Nie instaluje zależnoÅci podstawowych pakietów"
+
#. TRANSLATORS: tool that gets called when the command is not found
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:324
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:450
msgid "PackageKit Debuginfo Installer"
msgstr "Instalator pakietów debugowania PackageKit"
#. TRANSLATORS: the use needs to specify a list of package names on the command line
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:334
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:460
#, c-format
msgid "ERROR: Specify package names to install."
msgstr "BÅÄD: proszÄ podaÄ nazwy pakietów do zainstalowania."
#. TRANSLATORS: we are getting the list of repositories
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:355
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:483
#, c-format
-msgid "Getting sources list..."
-msgstr "Pobieranie listy źródeÅ..."
+msgid "Getting sources list"
+msgstr "Pobieranie listy źródeÅ"
#. TRANSLATORS: all completed 100%
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:366
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:402
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:428
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:483
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:515
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:544
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:495
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:532
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:559
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:634
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:666
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:715
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:748
#, c-format
msgid "OK."
msgstr "OK."
#. TRANSLATORS: tell the user what we found
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:369
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:498
#, c-format
msgid "Found %i enabled and %i disabled sources."
msgstr "Znaleziono %i wÅÄ
czone i %i wyÅÄ
czone źródÅa."
#. TRANSLATORS: we're finding repositories that match out pattern
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:376
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:505
#, c-format
-msgid "Finding debugging sources..."
-msgstr "Wyszukiwanie źródeŠpakietów debugowania..."
+msgid "Finding debugging sources"
+msgstr "Wyszukiwanie źródeŠpakietów debugowania"
#. TRANSLATORS: tell the user what we found
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:405
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:535
#, c-format
msgid "Found %i disabled debuginfo repos."
-msgstr "Znaleziono %i wyÅÄ
czonych repozytoriów pakietów debugowania."
+msgstr "Znaleziono %i wyÅÄ
czone repozytoria pakietów debugowania."
#. TRANSLATORS: we're now enabling all the debug sources we found
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:412
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:542
#, c-format
-msgid "Enabling debugging sources..."
-msgstr "WÅÄ
czanie źródeŠpakietów debugowania..."
+msgid "Enabling debugging sources"
+msgstr "WÅÄ
czanie źródeŠpakietów debugowania"
#. TRANSLATORS: operation was not successful
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:418
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:474
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:535
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:549
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:625
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:656
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:705
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:739
msgid "FAILED."
msgstr "NIEUDANE."
#. TRANSLATORS: tell the user how many we enabled
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:431
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:562
#, c-format
msgid "Enabled %i debugging sources."
msgstr "WÅÄ
czono %i źródÅa pakietów debugowania."
+#. TRANSLATORS: we're now finding packages that match in all the repos
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:569
+#, c-format
+msgid "Finding debugging packages"
+msgstr "Wyszukiwanie źródeŠpakietów debugowania"
+
#. TRANSLATORS: we couldn't find the package name, non-fatal
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:454
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:580
+#, c-format
+msgid "Failed to find the package %s: %s"
+msgstr "Znalezienie pakietu %s nie powiodÅo siÄ: %s"
+
+#. TRANSLATORS: we couldn't find the debuginfo package name, non-fatal
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:603
#, c-format
-msgid "Failed to find a package of that name: %s"
-msgstr "Znalezienie pakietu o tej nazwie nie powiodÅo siÄ: %s"
+msgid "Failed to find the debuginfo package %s: %s"
+msgstr "Znalezienie pakietu debugowania %s nie powiodÅo siÄ: %s"
#. TRANSLATORS: no debuginfo packages could be found to be installed
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:477
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:628
#, c-format
msgid "Found no packages to install."
msgstr "Nie znaleziono pakietów do zainstalowania."
#. TRANSLATORS: tell the user we found some packages, and then list them
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:486
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:637
#, c-format
msgid "Found %i packages:"
msgstr "Znaleziono %i pakiety:"
+#. TRANSLATORS: tell the user we are searching for deps
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:650
+#, c-format
+msgid "Finding packages that depend on these packages"
+msgstr "Wyszukiwanie pakietów zależnych od tych pakietów"
+
+#. TRANSLATORS: could not install, detailed error follows
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:659
+#, c-format
+msgid "Could not find dependant packages: %s"
+msgstr "Nie można znaleÅºÄ zależnych pakietów: %s"
+
+#. TRANSLATORS: tell the user we found some more packages
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:670
+#, c-format
+msgid "Found %i extra packages."
+msgstr "Znaleziono %i dodatkowe pakiety."
+
+#. TRANSLATORS: tell the user we found some more packages
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:674
+#, c-format
+msgid "No extra packages required."
+msgstr "Dodatkowe pakiety nie sÄ
wymagane."
+
+#. TRANSLATORS: tell the user we found some packages (and deps), and then list them
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:680
+#, c-format
+msgid "Found %i packages to install:"
+msgstr "Znaleziono %i pakiety do zainstalowania:"
+
#. TRANSLATORS: simulate mode is a testing mode where we quit before the action
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:495
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:689
#, c-format
msgid "Not installing packages in simulate mode"
msgstr "Pakiety nie zostanÄ
zainstalowane w trybie symulacji"
+#. TRANSLATORS: coul dnot install, detailed error follows
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:708
+#, c-format
+msgid "Could not install packages: %s"
+msgstr "Nie można zainstalowaÄ pakietów: %s"
+
#. TRANSLATORS: we are now disabling all debuginfo repos we previously enabled
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:529
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:732
#, c-format
-msgid "Disabling sources previously enabled..."
-msgstr "WyÅÄ
czanie źródeÅ poprzednio wÅÄ
czonych..."
+msgid "Disabling sources previously enabled"
+msgstr "WyÅÄ
czanie źródeÅ poprzednio wÅÄ
czonych"
#. TRANSLATORS: no debuginfo packages could be found to be installed, detailed error follows
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:538
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:742
#, c-format
msgid "Could not disable the debugging sources: %s"
msgstr "Nie można wyÅÄ
czyÄ ÅºródeÅ pakietów debugowania: %s"
#. TRANSLATORS: we disabled all the debugging repos that we enabled before
-#: ../contrib/debuginfo-install/pk-debuginfo-install.c:547
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:751
#, c-format
msgid "Disabled %i debugging sources."
-msgstr "WyÅÄ
czono %i źródÅo pakietów debugowania."
+msgstr "WyÅÄ
czono %i źródÅa pakietów debugowania."
#: ../data/packagekit-catalog.xml.in.h:1
msgid "PackageKit Catalog"
commit c652a306c1105f1df4dccb153f23f61ad9f68932
Merge: 86dd579... eeff380...
Author: Mounir Lamouri (volkmar) <mounir.lamouri at gmail.com>
Date: Sun Jun 28 18:23:34 2009 +0200
Merge branch 'master' of git+ssh://volkmar@git.packagekit.org/srv/git/PackageKit
commit 86dd579e49ef0d154f353fdaeaef2682080bec7f
Author: Mounir Lamouri (volkmar) <mounir.lamouri at gmail.com>
Date: Sun Jun 28 18:23:16 2009 +0200
portage: finalizing search_details and refactoring
diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
index 5a1ddf2..bc7aceb 100755
--- a/backends/portage/portageBackend.py
+++ b/backends/portage/portageBackend.py
@@ -239,6 +239,21 @@ def get_group(cp):
# TODO: add message ?
return GROUP_UNKNOWN
+def get_search_list(keys):
+ '''
+ Get a string composed of keys (separated with spaces).
+ Returns a list of compiled regular expressions.
+ '''
+ keys_list = keys.split(' ')
+ search_list = []
+
+ for k in keys_list:
+ # not done entirely by pk-transaction
+ k = re.escape(k)
+ search_list.append(re.compile(k, re.IGNORECASE))
+
+ return search_list
+
class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
def __init__(self, args, lock=True):
@@ -276,6 +291,9 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
return aux_get(cpv, keys)
def filter_free(self, cpv_list, fltlist):
+ if len(cpv_list) == 0:
+ return cpv_list
+
def _has_validLicense(cpv):
metadata = self.get_metadata(cpv, ["LICENSE", "USE", "SLOT"], True)
return not self.portage_settings._getMissingLicenses(cpv, metadata)
@@ -299,6 +317,23 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
return cpv_list
+ def filter_newest(self, cpv_list, fltlist):
+ if len(cpv_list) == 0:
+ return cpv_list
+
+ if FILTER_NEWEST in fltlist:
+ # if FILTER_INSTALLED in fltlist, cpv_list=cpv_list
+ if FILTER_NOT_INSTALLED in fltlist:
+ cpv_list = [cpv_list[-1]]
+ elif FILTER_INSTALLED not in fltlist:
+ # cpv_list is not ordered so getting newer and filter others
+ newer_cpv = self.get_newer_cpv(cpv_list)
+ cpv_list = filter(
+ lambda cpv: self.is_installed(cpv) or cpv == newer_cpv,
+ cpv_list)
+
+ return cpv_list
+
def get_all_cp(self, fltlist):
# NOTES:
# returns a list of cp
@@ -322,7 +357,7 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
return cp_list
- def get_all_cpv(self, cp, fltlist):
+ def get_all_cpv(self, cp, fltlist, filter_newest=True):
# NOTES:
# returns a list of cpv
#
@@ -346,29 +381,12 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
if cpv not in cpv_list:
cpv_list.append(cpv)
- if len(cpv_list) == 0:
- return []
-
# free filter
cpv_list = self.filter_free(cpv_list, fltlist)
- if len(cpv_list) == 0:
- return []
-
# newest filter
- if FILTER_NEWEST in fltlist:
- # if FILTER_INSTALLED in fltlist, cpv_list=cpv_list
- if FILTER_NOT_INSTALLED in fltlist:
- cpv_list = [cpv_list[-1]]
- elif FILTER_INSTALLED not in fltlist:
- # cpv_list is not ordered so getting newer and filter others
- newer_cpv = self.get_newer_cpv(cpv_list)
- cpv_list = filter(
- lambda cpv: self.is_installed(cpv) or cpv == newer_cpv,
- cpv_list)
-
- if len(cpv_list) == 0:
- return []
+ if filter_newest:
+ self.filter_newest(cpv_list, fltlist)
return cpv_list
@@ -894,26 +912,52 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
#print self.vardb.dep_bestmatch(cp)
self.package(portage.portdb.xmatch("bestmatch-visible", cp))
- def search_details(self, filters, key):
- # TODO: add keywords when they will be available
- # TODO: filters
- # TODO: split keys
- # TODO: PERFORMANCE !
+ def search_details(self, filters, keys):
+ # NOTES: very bad performance
self.status(STATUS_QUERY)
self.allow_cancel(True)
self.percentage(None)
- searchre = re.compile(key, re.IGNORECASE)
- cpvlist = []
-
- for cp in portage.portdb.cp_all():
- # TODO: baaad, we are working on _every_ cpv :-/
- for cpv in portage.portdb.match(cp): #TODO: cp_list(cp) ?
- infos = self.get_metadata(cpv, ["HOMEPAGE","DESCRIPTION","repository"]) # LICENSE ?
- for x in infos:
- if searchre.search(x):
- self.package(cpv)
+ fltlist = filters.split(';')
+ cp_list = self.get_all_cp(fltlist)
+ nb_cp = float(len(cp_list))
+ cp_processed = 0.0
+ search_list = get_search_list(keys)
+
+ for cp in cp_list:
+ # unfortunatelly, everything is related to cpv, not cp
+ # can't filter cp
+ cpv_list = []
+
+ # newest filter can't be executed now
+ # because some cpv are going to be filtered by search conditions
+ # and newest filter could be alterated
+ for cpv in self.get_all_cpv(cp, fltlist, filter_newest=False):
+ match = True
+ details = self.get_metadata(cpv,
+ ["DESCRIPTION", "HOMEPAGE","LICENSE","repository"])
+ for s in search_list:
+ found = False
+ for x in details:
+ if s.search(x):
+ found = True
+ break
+ if not found:
+ match = False
break
+ if match:
+ cpv_list.append(cpv)
+
+ # newest filter
+ cpv_list = self.filter_newest(cpv_list, fltlist)
+
+ for cpv in cpv_list:
+ self.package(cpv)
+
+ cp_processed += 100.0
+ self.percentage(int(cp_processed/nb_cp))
+
+ self.percentage(100)
def search_file(self, filters, key):
# FILTERS:
@@ -970,17 +1014,17 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
self.percentage(0)
fltlist = filters.split(';')
- cpv_list = self.get_all_cp(fltlist)
- nb_cpv = float(len(cpv_list))
- cpv_processed = 0.0
+ cp_list = self.get_all_cp(fltlist)
+ nb_cp = float(len(cp_list))
+ cp_processed = 0.0
- for cp in cpv_list:
+ for cp in cp_list:
if get_group(cp) == group:
for cpv in self.get_all_cpv(cp, fltlist):
self.package(cpv)
- cpv_processed += 100.0
- self.percentage(int(cpv_processed/nb_cpv))
+ cp_processed += 100.0
+ self.percentage(int(cp_processed/nb_cp))
self.percentage(100)
@@ -992,18 +1036,12 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
self.percentage(0)
fltlist = filters.split(';')
- keys_list = keys.split(' ')
- cpv_list = self.get_all_cp(fltlist)
- nb_cpv = float(len(cpv_list))
- cpv_processed = 0.0
- search_list = []
+ cp_list = self.get_all_cp(fltlist)
+ nb_cp = float(len(cp_list))
+ cp_processed = 0.0
+ search_list = get_search_list(keys)
- for k in keys_list:
- # not done entirely by pk-transaction
- k = re.escape(k)
- search_list.append(re.compile(k, re.IGNORECASE))
-
- for cp in cpv_list:
+ for cp in cp_list:
# pkg name has to correspond to _every_ keys
pkg_name = portage.catsplit(cp)[1]
found = True
@@ -1015,8 +1053,8 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
for cpv in self.get_all_cpv(cp, fltlist):
self.package(cpv)
- cpv_processed += 100.0
- self.percentage(int(cpv_processed/nb_cpv))
+ cp_processed += 100.0
+ self.percentage(int(cp_processed/nb_cp))
self.percentage(100)
commit 8eac5ee776ead81abf9ad313191f909a57e1f031
Author: Mounir Lamouri (volkmar) <mounir.lamouri at gmail.com>
Date: Sun Jun 28 17:29:45 2009 +0200
trivial: add licenses as a "possible" search field for SearchDetails
diff --git a/src/org.freedesktop.PackageKit.Transaction.xml b/src/org.freedesktop.PackageKit.Transaction.xml
index 77bc874..1772ed9 100644
--- a/src/org.freedesktop.PackageKit.Transaction.xml
+++ b/src/org.freedesktop.PackageKit.Transaction.xml
@@ -1009,7 +1009,7 @@
Do not refresh the package cache. This should be fast.
This is very similar to search-name.
This should search as much data as possible, including, if possible
- repo names, package summaries, descriptions and URLs.
+ repo names, package summaries, descriptions, licenses and URLs.
</doc:para>
<doc:para>
Try to emit <doc:tt>installed</doc:tt> before
commit b43b3f8ef8c96783cece5d313749a8ea231b5038
Author: Mounir Lamouri (volkmar) <mounir.lamouri at gmail.com>
Date: Sun Jun 28 17:28:18 2009 +0200
throw an error if SearchGroup search term contains spaces
diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index c072c29..82645ac 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -3695,6 +3695,15 @@ pk_transaction_search_group (PkTransaction *transaction, const gchar *filter,
return;
}
+ /* do not allow spaces */
+ if (strstr (search, " ") != NULL) {
+ error = g_error_new (PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_SEARCH_INVALID,
+ "Invalid search containing spaces");
+ pk_transaction_release_tid (transaction);
+ pk_transaction_dbus_return_error (context, error);
+ return;
+ }
+
/* check the filter */
ret = pk_transaction_filter_check (filter, &error);
if (!ret) {
commit eeff38034e3f65c537b4d85586562591169b7b78
Merge: db4bdc0... a7aa22d...
Author: Richard Hughes <richard at hughsie.com>
Date: Sun Jun 28 12:31:52 2009 +0100
Merge branch 'master' of git+ssh://hughsie@git.packagekit.org/srv/git/PackageKit
commit db4bdc0fee314541bc4e159916d6a1d1d89cee06
Author: Richard Hughes <richard at hughsie.com>
Date: Sun Jun 28 12:31:34 2009 +0100
Only resolve newest packages to try to reduce the number of dups in the list
diff --git a/contrib/debuginfo-install/pk-debuginfo-install.c b/contrib/debuginfo-install/pk-debuginfo-install.c
index 70a8a58..e1039d5 100644
--- a/contrib/debuginfo-install/pk-debuginfo-install.c
+++ b/contrib/debuginfo-install/pk-debuginfo-install.c
@@ -200,7 +200,7 @@ pk_debuginfo_install_resolve_name_to_id (PkDebuginfoInstallPrivate *priv, const
}
/* resolve */
- ret = pk_client_resolve (priv->client, PK_FILTER_ENUM_NONE, names, &error_local);
+ ret = pk_client_resolve (priv->client, pk_bitfield_from_enums (PK_FILTER_ENUM_NEWEST, -1), names, &error_local);
if (!ret) {
*error = g_error_new (1, 0, "failed to resolve: %s", error_local->message);
g_error_free (error_local);
commit 2a4a867ae5d390cc8a5434bfe605ed607c6bfd81
Author: Richard Hughes <richard at hughsie.com>
Date: Sun Jun 28 12:26:11 2009 +0100
Make debuginfo-install also install package deps
diff --git a/contrib/debuginfo-install/pk-debuginfo-install.c b/contrib/debuginfo-install/pk-debuginfo-install.c
index 312ad49..70a8a58 100644
--- a/contrib/debuginfo-install/pk-debuginfo-install.c
+++ b/contrib/debuginfo-install/pk-debuginfo-install.c
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-/* Test with pk-debuginfo-install bzip2-libs-1.0.5-5.fc11.i586 glib2-2.20.3-1.fc11.i586 */
+/* Test with ./pk-debuginfo-install bzip2-libs-1.0.5-5.fc11.i586 glib2-2.20.3-1.fc11.i586 */
#include "config.h"
@@ -134,7 +134,7 @@ pk_debuginfo_install_enable_repos (PkDebuginfoInstallPrivate *priv, GPtrArray *a
g_error_free (error_local);
goto out;
}
- egg_warning ("setting %s: %i", repo_id, enable);
+ egg_debug ("setting %s: %i", repo_id, enable);
}
out:
return ret;
@@ -200,7 +200,7 @@ pk_debuginfo_install_resolve_name_to_id (PkDebuginfoInstallPrivate *priv, const
}
/* resolve */
- ret = pk_client_resolve (priv->client, pk_bitfield_from_enums (PK_FILTER_ENUM_NOT_INSTALLED, -1), names, &error_local);
+ ret = pk_client_resolve (priv->client, PK_FILTER_ENUM_NONE, names, &error_local);
if (!ret) {
*error = g_error_new (1, 0, "failed to resolve: %s", error_local->message);
g_error_free (error_local);
@@ -221,7 +221,7 @@ pk_debuginfo_install_resolve_name_to_id (PkDebuginfoInstallPrivate *priv, const
/* get the package id */
obj = pk_package_list_get_obj (list, 0);
- id = pk_package_obj_get_id(obj);
+ id = pk_package_obj_get_id (obj);
package_id = pk_package_id_to_string (id);
out:
if (list != NULL)
@@ -270,12 +270,133 @@ pk_debuginfo_install_print_array (GPtrArray *array)
for (i=0; i<array->len; i++) {
package_id = g_ptr_array_index (array, i);
id = pk_package_id_new_from_string (package_id);
- g_print ("%i\t%s-%s(%s)\t%s\n", i, id->name, id->version, id->arch, id->data);
+ g_print ("%i\t%s-%s(%s)\t%s\n", i+1, id->name, id->version, id->arch, id->data);
pk_package_id_free (id);
}
}
/**
+ * pk_debuginfo_install_name_to_debuginfo:
+ **/
+static gchar *
+pk_debuginfo_install_name_to_debuginfo (const gchar *name)
+{
+ gchar *name_debuginfo = NULL;
+ gchar *name_tmp = NULL;
+
+ /* nothing */
+ if (name == NULL)
+ goto out;
+
+ name_tmp = g_strdup (name);
+
+ /* remove suffix */
+ pk_debuginfo_install_remove_suffix (name_tmp, "-libs");
+
+ /* append -debuginfo */
+ name_debuginfo = g_strjoin ("-", name_tmp, "debuginfo", NULL);
+out:
+ g_free (name_tmp);
+ return name_debuginfo;
+}
+
+/**
+ * pk_debuginfo_install_add_deps:
+ **/
+static gboolean
+pk_debuginfo_install_add_deps (PkDebuginfoInstallPrivate *priv, GPtrArray *packages_search, GPtrArray *packages_results, GError **error)
+{
+ gboolean ret;
+ const PkPackageObj *obj;
+ const PkPackageId *id;
+ gchar *package_id = NULL;
+ PkPackageList *list = NULL;
+ GError *error_local = NULL;
+ gchar **package_ids;
+ gchar *name_debuginfo;
+ guint len;
+ guint i;
+
+ /* reset client */
+ ret = pk_client_reset (priv->client, &error_local);
+ if (!ret) {
+ *error = g_error_new (1, 0, "failed to reset: %s", error_local->message);
+ g_error_free (error_local);
+ goto out;
+ }
+
+ /* get depends for them all, not adding dup's */
+ package_ids = pk_package_ids_from_array (packages_search);
+ ret = pk_client_get_depends (priv->client, PK_FILTER_ENUM_NONE, package_ids, TRUE, &error_local);
+ if (!ret) {
+ *error = g_error_new (1, 0, "failed to get_depends: %s", error_local->message);
+ g_error_free (error_local);
+ goto out;
+ }
+
+ /* add dependant packages */
+ list = pk_client_get_package_list (priv->client);
+ len = PK_OBJ_LIST(list)->len;
+ for (i=0; i<len; i++) {
+ obj = pk_package_list_get_obj (list, 0);
+ id = pk_package_obj_get_id(obj);
+
+ /* add -debuginfo */
+ name_debuginfo = pk_debuginfo_install_name_to_debuginfo (id->name);
+
+ /* resolve name */
+ egg_debug ("resolving: %s", name_debuginfo);
+ package_id = pk_debuginfo_install_resolve_name_to_id (priv, name_debuginfo, &error_local);
+ if (package_id == NULL) {
+ /* TRANSLATORS: we couldn't find the package name, non-fatal */
+ g_print (_("Failed to find the package %s, or already installed: %s"), name_debuginfo, error_local->message);
+ g_print ("\n");
+ g_error_free (error_local);
+ /* don't quit, this is non-fatal */
+ error = NULL;
+ }
+
+ /* add to array to install */
+ if (package_id != NULL && !g_str_has_suffix (package_id, "installed")) {
+ egg_debug ("going to try to install (for deps): %s", package_id);
+ g_ptr_array_add (packages_results, g_strdup (package_id));
+ }
+
+ g_free (package_id);
+ g_free (name_debuginfo);
+ }
+out:
+ if (list != NULL)
+ g_object_unref (list);
+ g_strfreev (package_ids);
+ return ret;
+}
+
+/**
+ * pk_console_progress_changed_cb:
+ **/
+static void
+pk_console_progress_changed_cb (PkClient *client, guint percentage, guint subpercentage,
+ guint elapsed, guint remaining, PkDebuginfoInstallPrivate *priv)
+{
+ PkRoleEnum role;
+ pk_client_get_role (client, &role, NULL, NULL);
+
+ /* ignore everything except InstallPackages */
+ if (role != PK_ROLE_ENUM_INSTALL_PACKAGES) {
+ egg_debug ("ignoring %s progress", pk_role_enum_to_text (role));
+ goto out;
+ }
+
+ if (percentage != PK_CLIENT_PERCENTAGE_INVALID)
+ g_print ("%s: %i%%\n", _("Percentage"), percentage);
+ else
+ g_print ("%s: %s\n", _("Percentage"), _("Unknown"));
+out:
+ return;
+}
+
+/**
* main:
**/
int
@@ -284,6 +405,7 @@ main (int argc, char *argv[])
gboolean ret;
GError *error = NULL;
GPtrArray *added_repos = NULL;
+ GPtrArray *package_ids_recognised = NULL;
GPtrArray *package_ids_to_install = NULL;
guint i;
gchar *package_id;
@@ -291,6 +413,7 @@ main (int argc, char *argv[])
gchar *name_debuginfo;
gboolean verbose = FALSE;
gboolean simulate = FALSE;
+ gboolean no_depends = FALSE;
GOptionContext *context;
const gchar *repo_id;
gchar *repo_id_debuginfo;
@@ -304,6 +427,9 @@ main (int argc, char *argv[])
{ "simulate", 's', 0, G_OPTION_ARG_NONE, &simulate,
/* command line argument, simulate what would be done, but don't actually do it */
_("Don't actually install any packages, only simulate"), NULL },
+ { "--no-depends", 'n', 0, G_OPTION_ARG_NONE, &no_depends,
+ /* command line argument, do we skip packages that depend on the ones specified */
+ _("Do not install dependencies of the core packages"), NULL },
{ NULL}
};
@@ -341,10 +467,12 @@ main (int argc, char *argv[])
priv->disabled = g_ptr_array_new ();
added_repos = g_ptr_array_new ();
package_ids_to_install = g_ptr_array_new ();
+ package_ids_recognised = g_ptr_array_new ();
/* create #PkClient */
priv->client = pk_client_new ();
g_signal_connect (priv->client, "repo-detail", G_CALLBACK (pk_debuginfo_install_repo_details_cb), priv);
+ g_signal_connect (priv->client, "progress-changed", G_CALLBACK (pk_console_progress_changed_cb), priv);
pk_client_set_synchronous (priv->client, TRUE, NULL);
pk_client_set_use_buffer (priv->client, TRUE, NULL);
@@ -352,7 +480,8 @@ main (int argc, char *argv[])
g_print ("%i. ", step++);
/* TRANSLATORS: we are getting the list of repositories */
- g_print (_("Getting sources list..."));
+ g_print (_("Getting sources list"));
+ g_print ("...");
/* get all enabled repos */
ret = pk_client_get_repo_list (priv->client, PK_FILTER_ENUM_NONE, &error);
@@ -373,7 +502,8 @@ main (int argc, char *argv[])
g_print ("%i. ", step++);
/* TRANSLATORS: we're finding repositories that match out pattern */
- g_print (_("Finding debugging sources..."));
+ g_print (_("Finding debugging sources"));
+ g_print ("...");
/* find all debuginfo repos for repos that are enabled */
for (i=0; i<priv->enabled->len; i++) {
@@ -409,7 +539,8 @@ main (int argc, char *argv[])
g_print ("%i. ", step++);
/* TRANSLATORS: we're now enabling all the debug sources we found */
- g_print (_("Enabling debugging sources..."));
+ g_print (_("Enabling debugging sources"));
+ g_print ("...");
/* enable all debuginfo repos we found */
ret = pk_debuginfo_install_enable_repos (priv, added_repos, TRUE, &error);
@@ -435,23 +566,41 @@ main (int argc, char *argv[])
g_print ("%i. ", step++);
/* TRANSLATORS: we're now finding packages that match in all the repos */
- g_print ("Finding debugging packages...");
+ g_print (_("Finding debugging packages"));
+ g_print ("...");
/* parse arguments and resolve to packages */
for (i=1; argv[i] != NULL; i++) {
name = pk_get_package_name_from_nevra (argv[i]);
- /* remove suffix */
- pk_debuginfo_install_remove_suffix (name, "-libs");
+ /* resolve name */
+ package_id = pk_debuginfo_install_resolve_name_to_id (priv, name, &error);
+ if (package_id == NULL) {
+ /* TRANSLATORS: we couldn't find the package name, non-fatal */
+ g_print (_("Failed to find the package %s: %s"), name, error->message);
+ g_print ("\n");
+ g_error_free (error);
+ /* don't quit, this is non-fatal */
+ error = NULL;
+ }
+
+ /* add to array to install */
+ if (package_id != NULL) {
+ egg_debug ("going to try to install: %s", package_id);
+ g_ptr_array_add (package_ids_recognised, g_strdup (package_id));
+ } else {
+ goto not_found;
+ }
- name_debuginfo = g_strjoin ("-", name, "debuginfo", NULL);
+ /* convert into basename */
+ name_debuginfo = pk_debuginfo_install_name_to_debuginfo (name);
egg_debug ("install %s [%s]", argv[i], name_debuginfo);
/* resolve name */
package_id = pk_debuginfo_install_resolve_name_to_id (priv, name_debuginfo, &error);
if (package_id == NULL) {
- /* TRANSLATORS: we couldn't find the package name, non-fatal */
- g_print (_("Failed to find a package of that name: %s"), error->message);
+ /* TRANSLATORS: we couldn't find the debuginfo package name, non-fatal */
+ g_print (_("Failed to find the debuginfo package %s: %s"), name_debuginfo, error->message);
g_print ("\n");
g_error_free (error);
/* don't quit, this is non-fatal */
@@ -459,16 +608,18 @@ main (int argc, char *argv[])
}
/* add to array to install */
- if (package_id != NULL) {
+ if (package_id != NULL && !g_str_has_suffix (package_id, "installed")) {
egg_debug ("going to try to install: %s", package_id);
g_ptr_array_add (package_ids_to_install, g_strdup (package_id));
}
- g_free (name);
g_free (name_debuginfo);
+not_found:
g_free (package_id);
-
+ g_free (name);
}
+
+ /* no packages? */
if (package_ids_to_install->len == 0) {
/* TRANSLATORS: operation was not successful */
g_print ("%s ", _("FAILED."));
@@ -486,6 +637,49 @@ main (int argc, char *argv[])
g_print (_("Found %i packages:"), package_ids_to_install->len);
g_print ("\n");
+ /* optional */
+ if (!no_depends) {
+
+ /* save for later logic */
+ i = package_ids_to_install->len;
+
+ /* starting this section */
+ g_print ("%i. ", step++);
+
+ /* TRANSLATORS: tell the user we are searching for deps */
+ g_print (_("Finding packages that depend on these packages"));
+ g_print ("...");
+
+ ret = pk_debuginfo_install_add_deps (priv, package_ids_recognised, package_ids_to_install, &error);
+ if (!ret) {
+ /* TRANSLATORS: operation was not successful */
+ g_print ("%s ", _("FAILED."));
+
+ /* TRANSLATORS: could not install, detailed error follows */
+ g_print (_("Could not find dependant packages: %s"), error->message);
+ g_print ("\n");
+ g_error_free (error);
+ goto out;
+ }
+
+ /* TRANSLATORS: all completed 100% */
+ g_print ("%s ", _("OK."));
+
+ if (i < package_ids_to_install->len) {
+ /* TRANSLATORS: tell the user we found some more packages */
+ g_print (_("Found %i extra packages."), package_ids_to_install->len - i);
+ g_print ("\n");
+ } else {
+ /* TRANSLATORS: tell the user we found some more packages */
+ g_print (_("No extra packages required."));
+ g_print ("\n");
+ }
+ }
+
+ /* TRANSLATORS: tell the user we found some packages (and deps), and then list them */
+ g_print (_("Found %i packages to install:"), package_ids_to_install->len);
+ g_print ("\n");
+
/* print list */
pk_debuginfo_install_print_array (package_ids_to_install);
@@ -501,12 +695,18 @@ main (int argc, char *argv[])
g_print ("%i. ", step++);
/* TRANSLATORS: we are now installing the debuginfo packages we found earlier */
- g_print ("Installing packages...");
+ g_print (_("Installing packages"));
+ g_print ("...");
/* install */
ret = pk_debuginfo_install_packages_install (priv, package_ids_to_install, &error);
if (!ret) {
- g_print ("failed to install packages: %s", error->message);
+ /* TRANSLATORS: operation was not successful */
+ g_print ("%s ", _("FAILED."));
+
+ /* TRANSLATORS: coul dnot install, detailed error follows */
+ g_print (_("Could not install packages: %s"), error->message);
+ g_print ("\n");
g_error_free (error);
goto out;
}
@@ -515,18 +715,22 @@ main (int argc, char *argv[])
g_print (_("OK."));
g_print ("\n");
out:
-
if (package_ids_to_install != NULL) {
g_ptr_array_foreach (package_ids_to_install, (GFunc) g_free, NULL);
g_ptr_array_free (package_ids_to_install, TRUE);
}
+ if (package_ids_recognised != NULL) {
+ g_ptr_array_foreach (package_ids_recognised, (GFunc) g_free, NULL);
+ g_ptr_array_free (package_ids_recognised, TRUE);
+ }
if (added_repos != NULL) {
/* starting this section */
g_print ("%i. ", step++);
/* TRANSLATORS: we are now disabling all debuginfo repos we previously enabled */
- g_print (_("Disabling sources previously enabled..."));
+ g_print (_("Disabling sources previously enabled"));
+ g_print ("...");
/* disable all debuginfo repos we previously enabled */
ret = pk_debuginfo_install_enable_repos (priv, added_repos, FALSE, &error);
commit a7aa22d1aa86f26932db47401e989730b4a1a080
Merge: 2a804ea... 7cc0df7...
Author: Mounir Lamouri (volkmar) <mounir.lamouri at gmail.com>
Date: Sun Jun 28 11:31:47 2009 +0200
Merge branch 'master' of git+ssh://volkmar@git.packagekit.org/srv/git/PackageKit
commit 2a804eae14128f53f111c45d3da178b41f5f58e3
Author: Mounir Lamouri (volkmar) <mounir.lamouri at gmail.com>
Date: Sun Jun 28 11:31:33 2009 +0200
portage: trivial: search_file: escaping search term
diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
index 105c37c..5a1ddf2 100755
--- a/backends/portage/portageBackend.py
+++ b/backends/portage/portageBackend.py
@@ -938,6 +938,7 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
if key[0] != "/":
is_full_path = False
+ key = re.escape(key)
searchre = re.compile("/" + key + "$", re.IGNORECASE)
# free filter
commit 66f93faa1eaaac4bcec5a2c7fc40dda569fa4803
Author: Mounir Lamouri (volkmar) <mounir.lamouri at gmail.com>
Date: Sun Jun 28 11:22:36 2009 +0200
Improve SearchFile, SearchName, SearchDetails and SearchGroup specifications
diff --git a/src/org.freedesktop.PackageKit.Transaction.xml b/src/org.freedesktop.PackageKit.Transaction.xml
index b83f69a..77bc874 100644
--- a/src/org.freedesktop.PackageKit.Transaction.xml
+++ b/src/org.freedesktop.PackageKit.Transaction.xml
@@ -1012,6 +1012,18 @@
repo names, package summaries, descriptions and URLs.
</doc:para>
<doc:para>
+ Try to emit <doc:tt>installed</doc:tt> before
+ <doc:tt>available</doc:tt> packages first, as it allows the client
+ program to perform the GUI filtering and matching whilst the daemon is
+ running the transaction.
+ </doc:para>
+ <doc:para>
+ If the backend includes <doc:tt>installed</doc:tt> and
+ <doc:tt>available</doc:tt> versions of the same package when searching
+ then the <doc:tt>available</doc:tt> version will have to be filtered
+ in the backend.
+ </doc:para>
+ <doc:para>
This method typically emits
<doc:tt>Progress</doc:tt>,
<doc:tt>Error</doc:tt> and
@@ -1035,7 +1047,12 @@
<doc:doc>
<doc:summary>
<doc:para>
- A single word search term with no wildcard chars.
+ A single word search term with no wildcard chars. The search can
+ contain many words separated by spaces. In this case, the
+ search operator is <doc:tt>AND</doc:tt> and the words can be found
+ in any details section/field. For example, search of
+ <doc:tt>GPL games</doc:tt> should returns every games with a GPL
+ license.
</doc:para>
</doc:summary>
</doc:doc>
@@ -1082,6 +1099,7 @@
A filename or fully qualified path and filename on the system.
If the search term begins with a <doc:tt>/</doc:tt> it will be assumed the entire path has been given and only packages that contain this exact path and filename will be returned.
If the search term does not start with <doc:tt>/</doc:tt> then it should be treated as a single filename, which can be in any directory.
+ Only one filename can be specified, which should not be escaped or surrounded in quotes.
</doc:para>
</doc:summary>
</doc:doc>
@@ -1100,6 +1118,18 @@
Do not refresh the package cache. This should be fast.
</doc:para>
<doc:para>
+ Try to emit <doc:tt>installed</doc:tt> before
+ <doc:tt>available</doc:tt> packages first, as it allows the client
+ program to perform the GUI filtering and matching whilst the daemon is
+ running the transaction.
+ </doc:para>
+ <doc:para>
+ If the backend includes <doc:tt>installed</doc:tt> and
+ <doc:tt>available</doc:tt> versions of the same package when searching
+ then the <doc:tt>available</doc:tt> version will have to be filtered
+ in the backend.
+ </doc:para>
+ <doc:para>
This method typically emits
<doc:tt>Progress</doc:tt>,
<doc:tt>Error</doc:tt> and
@@ -1124,7 +1154,8 @@
<doc:doc>
<doc:summary>
<doc:para>
- An enumerated group_type, or <doc:tt>unknown</doc:tt>
+ An enumerated group_type, or <doc:tt>unknown</doc:tt>. The search
+ can't contain spaces. It must contains only one group_type.
</doc:para>
</doc:summary>
</doc:doc>
@@ -1189,7 +1220,12 @@
<doc:doc>
<doc:summary>
<doc:para>
- A single word search term with no wildcard chars
+ A single word search term with no wildcard chars. The search term
+ can contain many words separated by spaces. In this case, the
+ search operator is <doc:tt>AND</doc:tt>. For example, search of
+ <doc:tt>gnome power</doc:tt> should returns
+ <doc:tt>gnome-power-manager</doc:tt> but not
+ <doc:tt>gnomesword</doc:tt> or <doc:tt>powertop</doc:tt>.
</doc:para>
</doc:summary>
</doc:doc>
commit 5b812e6e3f7f9c65838a258e380ef80165f2a870
Author: Richard Hughes <richard at hughsie.com>
Date: Sun Jun 28 09:15:20 2009 +0100
yum: add a fixme
diff --git a/backends/yum/yumBackend.py b/backends/yum/yumBackend.py
index ee23317..9c8644e 100755
--- a/backends/yum/yumBackend.py
+++ b/backends/yum/yumBackend.py
@@ -312,6 +312,8 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
fltlist = filters.split(';')
pkgfilter = YumFilter(fltlist)
package_list = []
+
+ # FIXME: treat as AND, not OR
keys = key.split(' ')
# get collection objects
commit 7cc0df7159a4de9a328b3a4013b1451eaead5bb4
Author: raven <raven at fedoraproject.org>
Date: Sun Jun 28 01:58:18 2009 +0000
Sending translation for Polish
diff --git a/po/pl.po b/po/pl.po
index c7cdd41..ca87674 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -5,8 +5,8 @@ msgid ""
msgstr ""
"Project-Id-Version: pl\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-06-18 19:16+0200\n"
-"PO-Revision-Date: 2009-06-18 19:20+0200\n"
+"POT-Creation-Date: 2009-06-28 01:46+0000\n"
+"PO-Revision-Date: 2009-06-28 03:58+0200\n"
"Last-Translator: Piotr DrÄ
g <piotrdrag at gmail.com>\n"
"Language-Team: Polish <pl at li.org>\n"
"MIME-Version: 1.0\n"
@@ -39,7 +39,7 @@ msgstr "FaÅsz"
#. TRANSLATORS: this is the transactions role, e.g. "update-system"
#. TRANSLATORS: the trasaction role, e.g. update-system
-#: ../client/pk-console.c:237 ../src/pk-polkit-action-lookup.c:228
+#: ../client/pk-console.c:237 ../src/pk-polkit-action-lookup.c:256
msgid "Role"
msgstr "Rola"
@@ -53,7 +53,8 @@ msgid "(seconds)"
msgstr "(sekundy)"
#. TRANSLATORS: this is The command line used to do the action
-#: ../client/pk-console.c:246
+#. TRANSLATORS: the command line of the thing that wants the authentication
+#: ../client/pk-console.c:246 ../src/pk-polkit-action-lookup.c:270
msgid "Command line"
msgstr "Wiersz poleceÅ"
@@ -493,6 +494,7 @@ msgstr "Podpolecenia:"
#: ../client/pk-console.c:1768 ../client/pk-generate-pack.c:185
#: ../client/pk-monitor.c:125
#: ../contrib/command-not-found/pk-command-not-found.c:521
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:303
#: ../src/pk-main.c:211
msgid "Show extra debugging information"
msgstr "WyÅwietla dodatkowe informacje o debugowaniu"
@@ -914,6 +916,118 @@ msgstr "Nie znaleziono pakietów dla systemu"
msgid "Installing..."
msgstr "Instalowanie..."
+#. command line argument, simulate what would be done, but don't actually do it
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:306
+msgid "Don't actually install any packages, only simulate"
+msgstr "Nie instaluje żadnych pakietów, tylko symuluje"
+
+#. TRANSLATORS: tool that gets called when the command is not found
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:324
+msgid "PackageKit Debuginfo Installer"
+msgstr "Instalator pakietów debugowania PackageKit"
+
+#. TRANSLATORS: the use needs to specify a list of package names on the command line
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:334
+#, c-format
+msgid "ERROR: Specify package names to install."
+msgstr "BÅÄD: proszÄ podaÄ nazwy pakietów do zainstalowania."
+
+#. TRANSLATORS: we are getting the list of repositories
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:355
+#, c-format
+msgid "Getting sources list..."
+msgstr "Pobieranie listy źródeÅ..."
+
+#. TRANSLATORS: all completed 100%
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:366
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:402
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:428
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:483
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:515
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:544
+#, c-format
+msgid "OK."
+msgstr "OK."
+
+#. TRANSLATORS: tell the user what we found
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:369
+#, c-format
+msgid "Found %i enabled and %i disabled sources."
+msgstr "Znaleziono %i wÅÄ
czone i %i wyÅÄ
czone źródÅa."
+
+#. TRANSLATORS: we're finding repositories that match out pattern
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:376
+#, c-format
+msgid "Finding debugging sources..."
+msgstr "Wyszukiwanie źródeŠpakietów debugowania..."
+
+#. TRANSLATORS: tell the user what we found
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:405
+#, c-format
+msgid "Found %i disabled debuginfo repos."
+msgstr "Znaleziono %i wyÅÄ
czonych repozytoriów pakietów debugowania."
+
+#. TRANSLATORS: we're now enabling all the debug sources we found
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:412
+#, c-format
+msgid "Enabling debugging sources..."
+msgstr "WÅÄ
czanie źródeŠpakietów debugowania..."
+
+#. TRANSLATORS: operation was not successful
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:418
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:474
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:535
+msgid "FAILED."
+msgstr "NIEUDANE."
+
+#. TRANSLATORS: tell the user how many we enabled
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:431
+#, c-format
+msgid "Enabled %i debugging sources."
+msgstr "WÅÄ
czono %i źródÅa pakietów debugowania."
+
+#. TRANSLATORS: we couldn't find the package name, non-fatal
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:454
+#, c-format
+msgid "Failed to find a package of that name: %s"
+msgstr "Znalezienie pakietu o tej nazwie nie powiodÅo siÄ: %s"
+
+#. TRANSLATORS: no debuginfo packages could be found to be installed
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:477
+#, c-format
+msgid "Found no packages to install."
+msgstr "Nie znaleziono pakietów do zainstalowania."
+
+#. TRANSLATORS: tell the user we found some packages, and then list them
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:486
+#, c-format
+msgid "Found %i packages:"
+msgstr "Znaleziono %i pakiety:"
+
+#. TRANSLATORS: simulate mode is a testing mode where we quit before the action
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:495
+#, c-format
+msgid "Not installing packages in simulate mode"
+msgstr "Pakiety nie zostanÄ
zainstalowane w trybie symulacji"
+
+#. TRANSLATORS: we are now disabling all debuginfo repos we previously enabled
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:529
+#, c-format
+msgid "Disabling sources previously enabled..."
+msgstr "WyÅÄ
czanie źródeÅ poprzednio wÅÄ
czonych..."
+
+#. TRANSLATORS: no debuginfo packages could be found to be installed, detailed error follows
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:538
+#, c-format
+msgid "Could not disable the debugging sources: %s"
+msgstr "Nie można wyÅÄ
czyÄ ÅºródeÅ pakietów debugowania: %s"
+
+#. TRANSLATORS: we disabled all the debugging repos that we enabled before
+#: ../contrib/debuginfo-install/pk-debuginfo-install.c:547
+#, c-format
+msgid "Disabled %i debugging sources."
+msgstr "WyÅÄ
czono %i źródÅo pakietów debugowania."
+
#: ../data/packagekit-catalog.xml.in.h:1
msgid "PackageKit Catalog"
msgstr "Katalog PackageKit"
@@ -1097,32 +1211,36 @@ msgstr "Nie można poÅÄ
czyÄ siÄ z magistralÄ
systemowÄ
"
msgid "Error trying to start:"
msgstr "BÅÄ
d podczas próbowania uruchomienia:"
+#: ../src/pk-polkit-action-lookup.c:143
+msgid "To install debugging packages, extra sources need to be enabled"
+msgstr "Aby zainstalowaÄ pakiety debugowania, należy wÅÄ
czyÄ dodatkowe źródÅa"
+
#. TRANSLATORS: is not GPG signed
-#: ../src/pk-polkit-action-lookup.c:128 ../src/pk-polkit-action-lookup.c:147
+#: ../src/pk-polkit-action-lookup.c:156 ../src/pk-polkit-action-lookup.c:175
msgid "The software is not from a trusted source."
msgstr "Oprogramowanie nie jest z zaufanego źródÅa."
#. TRANSLATORS: user has to trust provider -- I know, this sucks
-#: ../src/pk-polkit-action-lookup.c:132
+#: ../src/pk-polkit-action-lookup.c:160
msgid "Do not update this package unless you are sure it is safe to do so."
msgstr ""
"Nie należy aktualizowaÄ tego pakietu, jeÅli nie ma siÄ pewnoÅci, że to "
"bezpieczne."
#. TRANSLATORS: warn the user that all bets are off
-#: ../src/pk-polkit-action-lookup.c:136 ../src/pk-polkit-action-lookup.c:155
+#: ../src/pk-polkit-action-lookup.c:164 ../src/pk-polkit-action-lookup.c:183
msgid "Malicious software can damage your computer or cause other harm."
msgstr ""
"ZÅoÅliwe oprogramowanie może uszkodziÄ komputer lub spowodowaÄ inne szkody."
#. TRANSLATORS: user has to trust provider -- I know, this sucks
-#: ../src/pk-polkit-action-lookup.c:151
+#: ../src/pk-polkit-action-lookup.c:179
msgid "Do not install this package unless you are sure it is safe to do so."
msgstr ""
"Nie należy instalowaÄ tego pakietu, jeÅli nie ma siÄ pewnoÅci, że to "
"bezpieczne."
#. TRANSLATORS: if the transaction is forced to install only trusted packages
-#: ../src/pk-polkit-action-lookup.c:235
+#: ../src/pk-polkit-action-lookup.c:263
msgid "Only trusted"
msgstr "Tylko zaufane"
commit 4db8b5c7f2374645be2ba70387a9dffe97d75755
Author: Mounir Lamouri (volkmar) <mounir.lamouri at gmail.com>
Date: Sat Jun 27 18:03:54 2009 +0200
portage: finalizing search_group and search_file
diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
index 34bc55f..105c37c 100755
--- a/backends/portage/portageBackend.py
+++ b/backends/portage/portageBackend.py
@@ -52,11 +52,10 @@ from itertools import izip
# TODO:
# ERRORS with messages ?
-# use get_metadata instead of aux_get
# manage slots
# Map Gentoo categories to the PackageKit group name space
-SECTION_GROUP_MAP = {
+CATEGORY_GROUP_MAP = {
"app-accessibility" : GROUP_ACCESSIBILITY,
"app-admin" : GROUP_ADMIN_TOOLS,
"app-antivirus" : GROUP_OTHER, #TODO
@@ -230,17 +229,16 @@ def id_to_cpv(pkgid):
return ret[0] + "-" + ret[1]
-# TODO: move to class ?
def get_group(cp):
''' Return the group of the package
Argument could be cp or cpv. '''
- cat = portage.catsplit(cp)[0]
- if SECTION_GROUP_MAP.has_key(cat):
- return SECTION_GROUP_MAP[cat]
+ category = portage.catsplit(cp)[0]
+ if CATEGORY_GROUP_MAP.has_key(category):
+ return CATEGORY_GROUP_MAP[category]
+ # TODO: add message ?
return GROUP_UNKNOWN
-
class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
def __init__(self, args, lock=True):
@@ -918,7 +916,6 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
break
def search_file(self, filters, key):
- # TODO: update specifications
# FILTERS:
# - ~installed is not accepted (error)
# - free: ok
@@ -928,12 +925,12 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
self.percentage(0)
fltlist = filters.split(';')
+
if FILTER_NOT_INSTALLED in fltlist:
self.error(ERROR_CANNOT_GET_FILELIST,
- "search-filelist isn't available with ~installed filter")
+ "search-file isn't available with ~installed filter")
return
- cpv_results = []
cpv_list = self.vardb.cpv_all()
nb_cpv = 0.0
cpv_processed = 0.0
@@ -955,22 +952,18 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
contents = db.getcontents()
if not contents:
continue
- for file in contents.keys():
- if (is_full_path and key == file) \
- or (not is_full_path and searchre.search(file)):
- cpv_results.append(cpv)
- break
+ for f in contents.keys():
+ if (is_full_path and key == f) \
+ or (not is_full_path and searchre.search(f)):
+ self.package(cpv)
cpv_processed += 100.0
self.percentage(int(cpv_processed/nb_cpv))
self.percentage(100)
- for cpv in cpv_results:
- self.package(cpv)
-
def search_group(self, filters, group):
- # TODO: input has to be checked by server before
+ # TODO: filter unknown groups before searching ? (optimization)
self.status(STATUS_QUERY)
self.allow_cancel(True)
self.percentage(0)
@@ -992,6 +985,7 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
def search_name(self, filters, keys):
# NOTES: searching in package name, excluding category
+ # TODO: "-" equals "_" ? should be specified
self.status(STATUS_QUERY)
self.allow_cancel(True)
self.percentage(0)
commit 5b9bd2c7f9527b9f0c141a1679aea153a79e2c66
Author: Mounir Lamouri (volkmar) <mounir.lamouri at gmail.com>
Date: Sat Jun 27 16:51:05 2009 +0200
portage: add multi-key search in search_name and exclude category from search
diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
index a4208e8..34bc55f 100755
--- a/backends/portage/portageBackend.py
+++ b/backends/portage/portageBackend.py
@@ -990,21 +990,33 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
self.percentage(100)
- def search_name(self, filters, key):
- # TODO: input has to be checked by server before
- # TODO: use muli-key input ?
+ def search_name(self, filters, keys):
+ # NOTES: searching in package name, excluding category
self.status(STATUS_QUERY)
self.allow_cancel(True)
self.percentage(0)
fltlist = filters.split(';')
+ keys_list = keys.split(' ')
cpv_list = self.get_all_cp(fltlist)
nb_cpv = float(len(cpv_list))
cpv_processed = 0.0
- searchre = re.compile(key, re.IGNORECASE)
+ search_list = []
+
+ for k in keys_list:
+ # not done entirely by pk-transaction
+ k = re.escape(k)
+ search_list.append(re.compile(k, re.IGNORECASE))
for cp in cpv_list:
- if searchre.search(cp):
+ # pkg name has to correspond to _every_ keys
+ pkg_name = portage.catsplit(cp)[1]
+ found = True
+ for s in search_list:
+ if not s.search(pkg_name):
+ found = False
+ break
+ if found:
for cpv in self.get_all_cpv(cp, fltlist):
self.package(cpv)
commit a76b6f7011056bd4ad5e630cfccae32015940a93
Author: Mounir Lamouri (volkmar) <mounir.lamouri at gmail.com>
Date: Fri Jun 26 20:01:34 2009 +0200
portage: optimizing percentage display by sending int instead of float
diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
index 04ac407..a4208e8 100755
--- a/backends/portage/portageBackend.py
+++ b/backends/portage/portageBackend.py
@@ -962,7 +962,7 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
break
cpv_processed += 100.0
- self.percentage(cpv_processed/nb_cpv)
+ self.percentage(int(cpv_processed/nb_cpv))
self.percentage(100)
@@ -986,7 +986,7 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
self.package(cpv)
cpv_processed += 100.0
- self.percentage(cpv_processed/nb_cpv)
+ self.percentage(int(cpv_processed/nb_cpv))
self.percentage(100)
@@ -1009,7 +1009,7 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
self.package(cpv)
cpv_processed += 100.0
- self.percentage(cpv_processed/nb_cpv)
+ self.percentage(int(cpv_processed/nb_cpv))
self.percentage(100)
commit 6de7bb4d88ca290fad5faa5a43c3a315195f278c
Author: Mounir Lamouri (volkmar) <mounir.lamouri at gmail.com>
Date: Fri Jun 26 20:00:37 2009 +0200
trivial: transferring percentage optimization from yum backend to PackageKitBaseBackend
diff --git a/backends/yum/yumBackend.py b/backends/yum/yumBackend.py
index 8ab79f1..ee23317 100755
--- a/backends/yum/yumBackend.py
+++ b/backends/yum/yumBackend.py
@@ -198,8 +198,6 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
self.doLock()
self.package_summary_cache = {}
- self.percentage_old = 0
- self.sub_percentage_old = 0
self.comps = yumComps(self.yumbase)
if not self.comps.connect():
self.refresh_cache()
@@ -217,22 +215,6 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
except PkError, e:
self.error(e.code, e.details)
- def percentage(self, percent=None):
- '''
- @param percent: Progress percentage
- '''
- if percent == 0 or percent > self.percentage_old:
- PackageKitBaseBackend.percentage(self, percent)
- self.percentage_old = percent
-
- def sub_percentage(self, percent=None):
- '''
- @param percent: subprogress percentage
- '''
- if percent == 0 or percent > self.sub_percentage_old:
- PackageKitBaseBackend.sub_percentage(self, percent)
- self.sub_percentage_old = percent
-
def details(self, package_id, package_license, group, desc, url, bytes):
'''
Send 'details' signal
diff --git a/lib/python/packagekit/backend.py b/lib/python/packagekit/backend.py
index c0e9bed..9de3e50 100644
--- a/lib/python/packagekit/backend.py
+++ b/lib/python/packagekit/backend.py
@@ -55,6 +55,8 @@ class PackageKitBaseBackend:
self._locked = False
self.lang = "C"
self.has_network = False
+ self.percentage_old = 0
+ self.sub_percentage_old = 0
# try to get LANG
try:
@@ -83,20 +85,23 @@ class PackageKitBaseBackend:
def percentage(self, percent=None):
'''
Write progress percentage
- @param percent: Progress percentage
+ @param percent: Progress percentage (int preferred)
'''
- if percent != None:
- print "percentage\t%i" % (percent)
- else:
+ if percent == None:
print "no-percentage-updates"
+ elif percent == 0 or percent > self.percentage_old:
+ print "percentage\t%i" % (percent)
+ self.percentage_old = percent
sys.stdout.flush()
def sub_percentage(self, percent=None):
'''
send 'subpercentage' signal : subprogress percentage
- @param percent: subprogress percentage
+ @param percent: subprogress percentage (int preferred)
'''
- print "subpercentage\t%i" % (percent)
+ if percent == 0 or percent > self.sub_percentage_old:
+ print "subpercentage\t%i" % (percent)
+ self.sub_percentage_old = percent
sys.stdout.flush()
def error(self, err, description, exit=True):
commit 5944f732fa4e499d8b9593fffe802765ee1e3b2e
Author: Mounir Lamouri (volkmar) <mounir.lamouri at gmail.com>
Date: Fri Jun 26 19:37:55 2009 +0200
portage: trivial: making pylint a bit happier
diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
index ae39e88..04ac407 100755
--- a/backends/portage/portageBackend.py
+++ b/backends/portage/portageBackend.py
@@ -262,8 +262,8 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
def get_newer_cpv(self, cpv_list):
newer = cpv_list[0]
for cpv in cpv_list:
- if portage.pkgcmp(portage.pkgsplit(cpv),portage.pkgsplit(newer)) == 1:
- newer = cpv
+ if portage.pkgcmp(portage.pkgsplit(cpv), portage.pkgsplit(newer)) == 1:
+ newer = cpv
return newer
def get_metadata(self, cpv, keys, in_dict = False):
commit 0fa6a171e7fcb3fdf8237ed43ea07c8f461f3495
Author: Mounir Lamouri (volkmar) <mounir.lamouri at gmail.com>
Date: Fri Jun 26 19:33:22 2009 +0200
portage: add progress info to search-name and search-gorup
diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
index 31af771..ae39e88 100755
--- a/backends/portage/portageBackend.py
+++ b/backends/portage/portageBackend.py
@@ -918,15 +918,14 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
break
def search_file(self, filters, key):
- # TODO: use cases tests on fedora 11
- # TODO: installed before non-installed ?
+ # TODO: update specifications
# FILTERS:
# - ~installed is not accepted (error)
# - free: ok
# - newest: as only installed, by himself
self.status(STATUS_QUERY)
self.allow_cancel(True)
- self.percentage(None)
+ self.percentage(0)
fltlist = filters.split(';')
if FILTER_NOT_INSTALLED in fltlist:
@@ -936,8 +935,8 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
cpv_results = []
cpv_list = self.vardb.cpv_all()
- nb_pkg = 0.0
- pkg_processed = 0.0
+ nb_cpv = 0.0
+ cpv_processed = 0.0
is_full_path = True
if key[0] != "/":
@@ -946,7 +945,7 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
# free filter
cpv_list = self.filter_free(cpv_list, fltlist)
- nb_pkg = float(len(cpv_list))
+ nb_cpv = float(len(cpv_list))
for cpv in cpv_list:
cat, pv = portage.catsplit(cpv)
@@ -962,8 +961,8 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
cpv_results.append(cpv)
break
- pkg_processed += 100.0 # instead of +=1 and *100, doing +=100
- self.percentage(pkg_processed/nb_pkg)
+ cpv_processed += 100.0
+ self.percentage(cpv_processed/nb_cpv)
self.percentage(100)
@@ -971,36 +970,49 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
self.package(cpv)
def search_group(self, filters, group):
- # TODO: use cases tests on fedora 11
- # TODO: progress ?
- # TODO: installed before non-installed ?
+ # TODO: input has to be checked by server before
self.status(STATUS_QUERY)
self.allow_cancel(True)
- self.percentage(None)
+ self.percentage(0)
fltlist = filters.split(';')
+ cpv_list = self.get_all_cp(fltlist)
+ nb_cpv = float(len(cpv_list))
+ cpv_processed = 0.0
- for cp in self.get_all_cp(fltlist):
+ for cp in cpv_list:
if get_group(cp) == group:
for cpv in self.get_all_cpv(cp, fltlist):
self.package(cpv)
+ cpv_processed += 100.0
+ self.percentage(cpv_processed/nb_cpv)
+
+ self.percentage(100)
+
def search_name(self, filters, key):
- # TODO: use cases tests on fedora 11
- # TODO: progress ?
- # TODO: installed before non-installed ?
+ # TODO: input has to be checked by server before
+ # TODO: use muli-key input ?
self.status(STATUS_QUERY)
self.allow_cancel(True)
- self.percentage(None)
+ self.percentage(0)
fltlist = filters.split(';')
+ cpv_list = self.get_all_cp(fltlist)
+ nb_cpv = float(len(cpv_list))
+ cpv_processed = 0.0
searchre = re.compile(key, re.IGNORECASE)
- for cp in self.get_all_cp(fltlist):
+ for cp in cpv_list:
if searchre.search(cp):
for cpv in self.get_all_cpv(cp, fltlist):
self.package(cpv)
+ cpv_processed += 100.0
+ self.percentage(cpv_processed/nb_cpv)
+
+ self.percentage(100)
+
def update_packages(self, only_trusted, pkgs):
# TODO: add some checks ?
self.install_packages(only_trusted, pkgs)
commit 8079c705bb590814e4b119ac2eb8ea076e6fc710
Merge: 313b2f7... 6152a23...
Author: Mounir Lamouri (volkmar) <mounir.lamouri at gmail.com>
Date: Fri Jun 26 18:59:14 2009 +0200
Merge branch 'master' of git+ssh://volkmar@git.packagekit.org/srv/git/PackageKit
commit 313b2f758a774309997dad37bc0e2ced0989da50
Author: Mounir Lamouri (volkmar) <mounir.lamouri at gmail.com>
Date: Fri Jun 26 18:58:56 2009 +0200
portage: fix aux_get issue, show installed packages first, make best use of cpv list and filters, fix random issues
diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
index 7fe313f..31af771 100755
--- a/backends/portage/portageBackend.py
+++ b/backends/portage/portageBackend.py
@@ -51,10 +51,9 @@ from itertools import izip
# names a package (an ebuild for portage)
# TODO:
-# FREE filter
-# NEWEST filter
# ERRORS with messages ?
# use get_metadata instead of aux_get
+# manage slots
# Map Gentoo categories to the PackageKit group name space
SECTION_GROUP_MAP = {
@@ -260,15 +259,29 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
return True
return False
- def get_metadata(self, cpv, keys):
+ def get_newer_cpv(self, cpv_list):
+ newer = cpv_list[0]
+ for cpv in cpv_list:
+ if portage.pkgcmp(portage.pkgsplit(cpv),portage.pkgsplit(newer)) == 1:
+ newer = cpv
+ return newer
+
+ def get_metadata(self, cpv, keys, in_dict = False):
if self.is_installed(cpv):
aux_get = self.vardb.aux_get
else:
aux_get = portage.portdb.aux_get
- return dict(izip(keys, aux_get(cpv, keys)))
+ if in_dict:
+ return dict(izip(keys, aux_get(cpv, keys)))
+ else:
+ return aux_get(cpv, keys)
def filter_free(self, cpv_list, fltlist):
+ def _has_validLicense(cpv):
+ metadata = self.get_metadata(cpv, ["LICENSE", "USE", "SLOT"], True)
+ return not self.portage_settings._getMissingLicenses(cpv, metadata)
+
if FILTER_FREE in fltlist or FILTER_NOT_FREE in fltlist:
free_licenses = "@FSF-APPROVED"
if FILTER_FREE in fltlist:
@@ -279,10 +292,9 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
self.portage_settings["ACCEPT_LICENSE"] = licenses
self.portage_settings.backup_changes("ACCEPT_LICENSE")
self.portage_settings.regenerate()
- for x in cpv_list:
- metadata = self.get_metadata(x, ["LICENSE", "USE", "SLOT"])
- if self.portage_settings._getMissingLicenses(x, metadata):
- cpv_list.remove(x)
+
+ cpv_list = filter(_has_validLicense, cpv_list)
+
self.portage_settings["ACCEPT_LICENSE"] = backup_license
self.portage_settings.backup_changes("ACCEPT_LICENSE")
self.portage_settings.regenerate()
@@ -291,20 +303,26 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
def get_all_cp(self, fltlist):
# NOTES:
- # returns a list of cp _BUT_ if filter=installed, returns cpv
+ # returns a list of cp
#
# FILTERS:
# - installed: ok
# - free: ok (should be done with cpv)
# - newest: ok (should be finished with cpv)
+ cp_list = []
- # if installed filter, return vardb.cpv_all
- # it's a bit weird but with get_all_cpv(cp) return cpv, it could be ok
- # TODO: ask zmedico
if FILTER_INSTALLED in fltlist:
- return self.vardb.cpv_all()
+ cp_list = self.vardb.cp_all()
+ elif FILTER_NOT_INSTALLED in fltlist:
+ cp_list = portage.portdb.cp_all()
else:
- return portage.portdb.cp_all()
+ # need installed packages first
+ cp_list = self.vardb.cp_all()
+ for cp in portage.portdb.cp_all():
+ if cp not in cp_list:
+ cp_list.append(cp)
+
+ return cp_list
def get_all_cpv(self, cp, fltlist):
# NOTES:
@@ -315,46 +333,46 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
# - free: ok
# - newest: ok
- cpv = []
+ cpv_list = []
- # populate cpv and take care of installed filter
+ # populate cpv_list taking care of installed filter
if FILTER_INSTALLED in fltlist:
- # special case : cp = cpv
- cpv.append(cp)
+ cpv_list = self.vardb.match(cp)
elif FILTER_NOT_INSTALLED in fltlist:
- for x in portage.portdb.match(cp):
- if not self.is_installed(x):
- cpv.append(x)
+ for cpv in portage.portdb.match(cp):
+ if not self.is_installed(cpv):
+ cpv_list.append(cpv)
else:
- cpv = portage.portdb.match(cp)
+ cpv_list = self.vardb.match(cp)
+ for cpv in portage.portdb.match(cp):
+ if cpv not in cpv_list:
+ cpv_list.append(cpv)
- if len(cpv) == 0:
+ if len(cpv_list) == 0:
return []
# free filter
- cpv = self.filter_free(cpv, fltlist)
+ cpv_list = self.filter_free(cpv_list, fltlist)
- if len(cpv) == 0:
+ if len(cpv_list) == 0:
return []
# newest filter
if FILTER_NEWEST in fltlist:
- # if FILTER_INSTALLED in fltlist, cpv=cpv
+ # if FILTER_INSTALLED in fltlist, cpv_list=cpv_list
if FILTER_NOT_INSTALLED in fltlist:
- cpv = [cpv[-1]]
- elif not FILTER_INSTALLED in fltlist:
- if self.is_installed(cpv[-1]):
- cpv = [cpv[-1]]
- else:
- for x in cpv:
- if self.is_installed(x):
- cpv = [x, cpv[-1]]
- cpv = [cpv[-1]]
-
- if len(cpv) == 0:
+ cpv_list = [cpv_list[-1]]
+ elif FILTER_INSTALLED not in fltlist:
+ # cpv_list is not ordered so getting newer and filter others
+ newer_cpv = self.get_newer_cpv(cpv_list)
+ cpv_list = filter(
+ lambda cpv: self.is_installed(cpv) or cpv == newer_cpv,
+ cpv_list)
+
+ if len(cpv_list) == 0:
return []
- return cpv
+ return cpv_list
def cpv_to_id(self, cpv):
'''
@@ -362,7 +380,7 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
'''
# TODO: manage SLOTS !
package, version, rev = portage.pkgsplit(cpv)
- pkg_keywords, repo = portage.portdb.aux_get(cpv, ["KEYWORDS", "repository"])
+ pkg_keywords, repo = self.get_metadata(cpv, ["KEYWORDS", "repository"])
pkg_keywords = pkg_keywords.split()
sys_keywords = self.portage_settings["ACCEPT_KEYWORDS"].split()
@@ -374,9 +392,11 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
# if no keywords, check in package.keywords
if not keywords:
- for _, keys in self.portage_settings.pkeywordsdict.get(portage.dep_getkey(cpv)).iteritems():
- for x in keys:
- keywords.append(x)
+ key_dict = self.portage_settings.pkeywordsdict.get(portage.dep_getkey(cpv))
+ if key_dict:
+ for _, keys in key_dict.iteritems():
+ for x in keys:
+ keywords.append(x)
if not keywords:
keywords.append("no keywords")
@@ -393,13 +413,13 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
return get_package_id(package, version, ' '.join(keywords), repo)
def package(self, cpv, info=None):
- desc = portage.portdb.aux_get(cpv, ["DESCRIPTION"])
+ desc = self.get_metadata(cpv, ["DESCRIPTION"])[0]
if not info:
if self.is_installed(cpv):
info = INFO_INSTALLED
else:
info = INFO_AVAILABLE
- PackageKitBaseBackend.package(self, self.cpv_to_id(cpv), info, desc[0])
+ PackageKitBaseBackend.package(self, self.cpv_to_id(cpv), info, desc)
def get_depends(self, filters, pkgids, recursive):
# TODO: manage filters
@@ -462,7 +482,7 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
"Could not find the package %s" % pkg)
continue
- homepage, desc, license = portage.portdb.aux_get(cpv,
+ homepage, desc, license = self.get_metadata(cpv,
["HOMEPAGE", "DESCRIPTION", "LICENSE"])
# size should be prompted only if not installed
@@ -653,7 +673,7 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
updates = "&".join(updates)
# temporarily set vendor_url = homepage
- homepage = portage.portdb.aux_get(cpv, ["HOMEPAGE"])[0]
+ homepage = self.get_metadata(cpv, ["HOMEPAGE"])[0]
vendor_url = homepage
self.update_detail(pkg, updates, obsoletes, vendor_url, bugzilla_url,
@@ -799,7 +819,7 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
mtimedb["resume"]["favorites"] = [str(x) for x in favorites]
db_keys = list(portage.portdb._aux_cache_keys)
- metadata = izip(db_keys, portage.portdb.aux_get(cpv, db_keys))
+ metadata = self.get_metadata(cpv, db_keys)
package = _emerge.Package(
type_name="ebuild",
built=True,
@@ -891,8 +911,7 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
for cp in portage.portdb.cp_all():
# TODO: baaad, we are working on _every_ cpv :-/
for cpv in portage.portdb.match(cp): #TODO: cp_list(cp) ?
- infos = portage.portdb.aux_get(cpv,
- ["HOMEPAGE","DESCRIPTION","repository"]) # LICENSE ?
+ infos = self.get_metadata(cpv, ["HOMEPAGE","DESCRIPTION","repository"]) # LICENSE ?
for x in infos:
if searchre.search(x):
self.package(cpv)
commit 6152a23f6a3c8d4d40fba50d6723dd3ea1b0bf38
Author: Aurelien Lefebvre <alefebvre at mandriva.com>
Date: Fri Jun 26 16:26:00 2009 +0200
urpmi: removed useless comments
diff --git a/backends/urpmi/helpers/urpmi-dispatched-backend.pl b/backends/urpmi/helpers/urpmi-dispatched-backend.pl
index df3084e..f6c1318 100755
--- a/backends/urpmi/helpers/urpmi-dispatched-backend.pl
+++ b/backends/urpmi/helpers/urpmi-dispatched-backend.pl
@@ -10,29 +10,6 @@
# (at your option) any later version.
#
-#
-# Dispatched backend implementation progress
-#
-# get-depends DONE
-# get-details DONE
-# get-distro-upgrades DONE
-# get-files DONE
-# get-packages DONE
-# get-requires DONE
-# get-update-detail DONE
-# get-updates DONE
-# install-packages DONE
-# refresh-cache DONE
-# remove-packages DONE
-# resolve DONE
-# search-details DONE
-# search-file DONE
-# search-group DONE
-# search-name DONE
-# update-packages DONE
-# update-system DONE
-#
-
use strict;
local $| = 1; # stdout autoflush
commit 3dcf1228b140ba54e4c5d95e48ecb517d162b5f2
Author: Aurelien Lefebvre <alefebvre at mandriva.com>
Date: Fri Jun 26 16:21:27 2009 +0200
urpmi: only_trusted implementation
diff --git a/backends/urpmi/helpers/urpmi-dispatched-backend.pl b/backends/urpmi/helpers/urpmi-dispatched-backend.pl
index d4271d3..df3084e 100755
--- a/backends/urpmi/helpers/urpmi-dispatched-backend.pl
+++ b/backends/urpmi/helpers/urpmi-dispatched-backend.pl
@@ -373,7 +373,7 @@ sub install_packages {
my ($urpm, $args) = @_;
- # FIXME: use only_trusted in @{$args}[0]
+ my $only_trusted = @{$args}[0];
my @packageidstab = split(/&/, @{$args}[1]);
my @names;
@@ -389,7 +389,7 @@ sub install_packages {
caseinsensitive => 0,
all => 0);
eval {
- perform_installation($urpm, \%requested);
+ perform_installation($urpm, \%requested, { only_trusted => $only_trusted });
};
_finished();
}
@@ -663,7 +663,7 @@ sub update_packages {
my ($urpm, $args) = @_;
- # FIXME: use only_trusted in @{$args}[0]
+ my $only_trusted = @{$args}[0];
my @packageidstab = split(/&/, @{$args}[1]);
my @names;
@@ -689,7 +689,7 @@ sub update_packages {
tonext:
}
eval {
- perform_installation($urpm, \%requested);
+ perform_installation($urpm, \%requested, only_trusted => $only_trusted);
};
_finished();
}
@@ -698,9 +698,9 @@ sub update_system {
my ($urpm, $args) = @_;
- # FIXME: use only_trusted in @{$args}[0]
+ my $only_trusted = @{$args}[0];
eval {
- perform_installation($urpm, {}, auto_select => 1);
+ perform_installation($urpm, {}, { auto_select => 1, only_trusted => $only_trusted});
};
_finished();
}
diff --git a/backends/urpmi/helpers/urpmi_backend/actions.pm b/backends/urpmi/helpers/urpmi_backend/actions.pm
index 2400e47..8331f0e 100644
--- a/backends/urpmi/helpers/urpmi_backend/actions.pm
+++ b/backends/urpmi/helpers/urpmi_backend/actions.pm
@@ -156,10 +156,12 @@ sub perform_installation {
print "Install current mode = ", $mode, "\n";
},
bad_signature => sub {
- pk_print_error(PK_ERROR_ENUM_GPG_FAILURE, "Bad or missing GPG signatures");
- undef $lock;
- undef $rpm_lock;
- die;
+ if($options{auto_select} eq "yes") {
+ pk_print_error(PK_ERROR_ENUM_GPG_FAILURE, "Bad or missing GPG signatures");
+ undef $lock;
+ undef $rpm_lock;
+ die;
+ }
},
ask_yes_or_no => sub {
# Return 1 = Return Yes
commit 7d0aec1a302282fd5a0ba30db4f27b62548ac59b
Author: Aurelien Lefebvre <alefebvre at mandriva.com>
Date: Fri Jun 26 15:17:13 2009 +0200
urpmi: Some more fields are now filled in get-details method
diff --git a/backends/urpmi/helpers/urpmi-dispatched-backend.pl b/backends/urpmi/helpers/urpmi-dispatched-backend.pl
index 8e7941d..d4271d3 100755
--- a/backends/urpmi/helpers/urpmi-dispatched-backend.pl
+++ b/backends/urpmi/helpers/urpmi-dispatched-backend.pl
@@ -735,7 +735,7 @@ sub _print_package_details {
$description =~ s/\n/;/g;
$description =~ s/\t/ /g;
- pk_print_details(get_package_id($pkg), "N/A", $pkg->group, ensure_utf8($description), "N/A", $pkg->size);
+ pk_print_details(get_package_id($pkg), "N/A", get_pk_group($pkg->group), ensure_utf8($description), $xml_info_pkgs{$name}{url}, $pkg->size);
}
sub _print_package_files {
diff --git a/backends/urpmi/helpers/urpmi_backend/groups.pm b/backends/urpmi/helpers/urpmi_backend/groups.pm
index 725c78d..9c92600 100644
--- a/backends/urpmi/helpers/urpmi_backend/groups.pm
+++ b/backends/urpmi/helpers/urpmi_backend/groups.pm
@@ -129,6 +129,14 @@ sub get_mdv_groups {
return @groups;
}
+sub get_pk_group {
+ my ($mdv_group) = @_;
+ if(%{(MDV_GROUPS)}->{$mdv_group} eq "") {
+ return GROUP_UNKNOWN;
+ }
+ return %{(MDV_GROUPS)}->{$mdv_group};
+}
+
sub package_belongs_to_pk_group {
my ($pkg, $pk_group) = @_;
my @groups = get_mdv_groups($pk_group);
commit e43ac0329ff580a7d0e5cd5fe6422cbe419dc2a5
Merge: a17005f... 7a5296c...
Author: Mounir Lamouri (volkmar) <mounir.lamouri at gmail.com>
Date: Fri Jun 26 13:58:56 2009 +0200
Merge branch 'master' of git+ssh://volkmar@git.packagekit.org/srv/git/PackageKit
commit a17005f09fde435fc0b11c6723af19d363f27d24
Author: Mounir Lamouri (volkmar) <mounir.lamouri at gmail.com>
Date: Fri Jun 26 13:58:28 2009 +0200
portage: get_packages is filter aware, search_file is free filter aware, fix bug when using portdb.aux_get for installed but not in the tree cpv
diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
index dcce88d..7fe313f 100755
--- a/backends/portage/portageBackend.py
+++ b/backends/portage/portageBackend.py
@@ -54,7 +54,7 @@ from itertools import izip
# FREE filter
# NEWEST filter
# ERRORS with messages ?
-# use vardb.aux_get instead of portdb.aux_get when possible ?
+# use get_metadata instead of aux_get
# Map Gentoo categories to the PackageKit group name space
SECTION_GROUP_MAP = {
@@ -260,6 +260,14 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
return True
return False
+ def get_metadata(self, cpv, keys):
+ if self.is_installed(cpv):
+ aux_get = self.vardb.aux_get
+ else:
+ aux_get = portage.portdb.aux_get
+
+ return dict(izip(keys, aux_get(cpv, keys)))
+
def filter_free(self, cpv_list, fltlist):
if FILTER_FREE in fltlist or FILTER_NOT_FREE in fltlist:
free_licenses = "@FSF-APPROVED"
@@ -271,9 +279,8 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
self.portage_settings["ACCEPT_LICENSE"] = licenses
self.portage_settings.backup_changes("ACCEPT_LICENSE")
self.portage_settings.regenerate()
- keys = ["LICENSE", "USE", "SLOT"]
for x in cpv_list:
- metadata = dict(izip(keys, portage.portdb.aux_get(x, keys)))
+ metadata = self.get_metadata(x, ["LICENSE", "USE", "SLOT"])
if self.portage_settings._getMissingLicenses(x, metadata):
cpv_list.remove(x)
self.portage_settings["ACCEPT_LICENSE"] = backup_license
@@ -500,13 +507,17 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
self.files(pkgid, files)
def get_packages(self, filters):
- # TODO: filters
+ # TODO: use cases tests on fedora 11
+ # TODO: progress ?
+ # TODO: installed before non-installed ?
self.status(STATUS_QUERY)
self.allow_cancel(True)
self.percentage(None)
- for cp in portage.portdb.cp_all():
- for cpv in portage.portdb.match(cp):
+ fltlist = filters.split(';')
+
+ for cp in self.get_all_cp(fltlist):
+ for cpv in self.get_all_cpv(cp, fltlist):
self.package(cpv)
def get_repo_list(self, filters):
@@ -888,9 +899,11 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
break
def search_file(self, filters, key):
+ # TODO: use cases tests on fedora 11
+ # TODO: installed before non-installed ?
# FILTERS:
# - ~installed is not accepted (error)
- # - free: TODO
+ # - free: ok
# - newest: as only installed, by himself
self.status(STATUS_QUERY)
self.allow_cancel(True)
@@ -902,17 +915,21 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
"search-filelist isn't available with ~installed filter")
return
- cpvlist = []
+ cpv_results = []
+ cpv_list = self.vardb.cpv_all()
+ nb_pkg = 0.0
pkg_processed = 0.0
- # TODO: create a temp var for self.vardb.cpv_all()
- nb_pkg = float(len(self.vardb.cpv_all()))
is_full_path = True
if key[0] != "/":
is_full_path = False
searchre = re.compile("/" + key + "$", re.IGNORECASE)
- for cpv in self.vardb.cpv_all():
+ # free filter
+ cpv_list = self.filter_free(cpv_list, fltlist)
+ nb_pkg = float(len(cpv_list))
+
+ for cpv in cpv_list:
cat, pv = portage.catsplit(cpv)
db = portage.dblink(cat, pv, portage.settings["ROOT"],
self.portage_settings, treetype="vartree",
@@ -923,7 +940,7 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
for file in contents.keys():
if (is_full_path and key == file) \
or (not is_full_path and searchre.search(file)):
- cpvlist.append(cpv)
+ cpv_results.append(cpv)
break
pkg_processed += 100.0 # instead of +=1 and *100, doing +=100
@@ -931,7 +948,7 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
self.percentage(100)
- for cpv in cpvlist:
+ for cpv in cpv_results:
self.package(cpv)
def search_group(self, filters, group):
commit cdd3be2fb07edb6d436ec870f99dbfe86e76cffd
Author: Mounir Lamouri (volkmar) <mounir.lamouri at gmail.com>
Date: Fri Jun 26 13:38:03 2009 +0200
portage: improved management of filters, especially free filter
diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
index b406b83..dcce88d 100755
--- a/backends/portage/portageBackend.py
+++ b/backends/portage/portageBackend.py
@@ -54,6 +54,7 @@ from itertools import izip
# FREE filter
# NEWEST filter
# ERRORS with messages ?
+# use vardb.aux_get instead of portdb.aux_get when possible ?
# Map Gentoo categories to the PackageKit group name space
SECTION_GROUP_MAP = {
@@ -259,6 +260,28 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
return True
return False
+ def filter_free(self, cpv_list, fltlist):
+ if FILTER_FREE in fltlist or FILTER_NOT_FREE in fltlist:
+ free_licenses = "@FSF-APPROVED"
+ if FILTER_FREE in fltlist:
+ licenses = "-* " + free_licenses
+ else:
+ licenses = "* -" + free_licenses
+ backup_license = self.portage_settings["ACCEPT_LICENSE"]
+ self.portage_settings["ACCEPT_LICENSE"] = licenses
+ self.portage_settings.backup_changes("ACCEPT_LICENSE")
+ self.portage_settings.regenerate()
+ keys = ["LICENSE", "USE", "SLOT"]
+ for x in cpv_list:
+ metadata = dict(izip(keys, portage.portdb.aux_get(x, keys)))
+ if self.portage_settings._getMissingLicenses(x, metadata):
+ cpv_list.remove(x)
+ self.portage_settings["ACCEPT_LICENSE"] = backup_license
+ self.portage_settings.backup_changes("ACCEPT_LICENSE")
+ self.portage_settings.regenerate()
+
+ return cpv_list
+
def get_all_cp(self, fltlist):
# NOTES:
# returns a list of cp _BUT_ if filter=installed, returns cpv
@@ -279,8 +302,6 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
def get_all_cpv(self, cp, fltlist):
# NOTES:
# returns a list of cpv
- # TODO: maybe improve filters management ?
- # like licenses when populating the list ?
#
# FILTERS:
# - installed: ok
@@ -304,42 +325,27 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
return []
# free filter
- if FILTER_FREE or FILTER_NOT_FREE in fltlist:
- free_licenses = "@FSF-APPROVED"
- if FILTER_FREE in fltlist:
- licenses = "-* " + free_licenses
- else:
- licenses = "* -" + free_licenses
- backup_license = self.portage_settings["ACCEPT_LICENSE"]
- self.portage_settings["ACCEPT_LICENSE"] = licenses
- self.portage_settings.backup_changes("ACCEPT_LICENSE")
- self.portage_settings.regenerate()
- keys = ["LICENSE", "USE", "SLOT"]
- for x in cpv:
- metadata = dict(izip(keys, portage.portdb.aux_get(x, keys)))
- if self.portage_settings._getMissingLicenses(x, metadata):
- cpv.remove(x)
- self.portage_settings["ACCEPT_LICENSE"] = backup_license
- self.portage_settings.backup_changes("ACCEPT_LICENSE")
- self.portage_settings.regenerate()
+ cpv = self.filter_free(cpv, fltlist)
if len(cpv) == 0:
return []
# newest filter
if FILTER_NEWEST in fltlist:
- if FILTER_INSTALLED in fltlist:
- return cpv
- elif FILTER_NOT_INSTALLED in fltlist:
- return [cpv[-1]]
- else:
+ # if FILTER_INSTALLED in fltlist, cpv=cpv
+ if FILTER_NOT_INSTALLED in fltlist:
+ cpv = [cpv[-1]]
+ elif not FILTER_INSTALLED in fltlist:
if self.is_installed(cpv[-1]):
- return [cpv[-1]]
+ cpv = [cpv[-1]]
else:
for x in cpv:
if self.is_installed(x):
- return [x, cpv[-1]]
- return [cpv[-1]]
+ cpv = [x, cpv[-1]]
+ cpv = [cpv[-1]]
+
+ if len(cpv) == 0:
+ return []
return cpv
@@ -898,6 +904,7 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
cpvlist = []
pkg_processed = 0.0
+ # TODO: create a temp var for self.vardb.cpv_all()
nb_pkg = float(len(self.vardb.cpv_all()))
is_full_path = True
@@ -928,6 +935,9 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
self.package(cpv)
def search_group(self, filters, group):
+ # TODO: use cases tests on fedora 11
+ # TODO: progress ?
+ # TODO: installed before non-installed ?
self.status(STATUS_QUERY)
self.allow_cancel(True)
self.percentage(None)
@@ -940,17 +950,19 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
self.package(cpv)
def search_name(self, filters, key):
- # TODO: manage filters
- # TODO: collections ?
+ # TODO: use cases tests on fedora 11
+ # TODO: progress ?
+ # TODO: installed before non-installed ?
self.status(STATUS_QUERY)
self.allow_cancel(True)
self.percentage(None)
+ fltlist = filters.split(';')
searchre = re.compile(key, re.IGNORECASE)
- for cp in portage.portdb.cp_all():
+ for cp in self.get_all_cp(fltlist):
if searchre.search(cp):
- for cpv in portage.portdb.match(cp): #TODO: cp_list(cp) ?
+ for cpv in self.get_all_cpv(cp, fltlist):
self.package(cpv)
def update_packages(self, only_trusted, pkgs):
commit 2f5d17ef09a905a9251f4ccb25534b5d0738a6c9
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Wed May 13 09:09:18 2009 +0200
smart: slackware packages now support xz compression too
diff --git a/backends/smart/pk-backend-smart.c b/backends/smart/pk-backend-smart.c
index e19e62a..eefb5b7 100644
--- a/backends/smart/pk-backend-smart.c
+++ b/backends/smart/pk-backend-smart.c
@@ -120,6 +120,7 @@ backend_get_mime_types (PkBackend *backend)
"application/x-gzip;" /* .tgz */
"application/x-bzip2;" /* .tbz */
"application/x-lzma;" /* .tlz */
+ "application/x-xz;" /* .txz */
"application/x-arch-pkg");
}
commit 7a5296c857675cd11c339dff78c053c083e8eb80
Author: Richard Hughes <richard at hughsie.com>
Date: Fri Jun 26 10:48:01 2009 +0100
Add some translations to pk-debuginfo-install, and generally make more sane
diff --git a/contrib/debuginfo-install/pk-debuginfo-install.c b/contrib/debuginfo-install/pk-debuginfo-install.c
index 32524fa..312ad49 100644
--- a/contrib/debuginfo-install/pk-debuginfo-install.c
+++ b/contrib/debuginfo-install/pk-debuginfo-install.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+/* Test with pk-debuginfo-install bzip2-libs-1.0.5-5.fc11.i586 glib2-2.20.3-1.fc11.i586 */
+
#include "config.h"
#include <string.h>
@@ -28,6 +30,12 @@
#include "egg-debug.h"
+typedef struct {
+ GPtrArray *enabled;
+ GPtrArray *disabled;
+ PkClient *client;
+} PkDebuginfoInstallPrivate;
+
/**
* pk_get_package_name_from_nevra:
**/
@@ -63,17 +71,11 @@ out:
return name;
}
-typedef struct {
- GPtrArray *enabled;
- GPtrArray *disabled;
- PkClient *client;
-} PkPriv;
-
/**
- * repo_details_cb:
+ * pk_debuginfo_install_repo_details_cb:
**/
static void
-repo_details_cb (PkClient *client, const gchar *repo_id, const gchar *description, gboolean enabled, PkPriv *priv)
+pk_debuginfo_install_repo_details_cb (PkClient *client, const gchar *repo_id, const gchar *description, gboolean enabled, PkDebuginfoInstallPrivate *priv)
{
if (enabled)
g_ptr_array_add (priv->enabled, g_strdup (repo_id));
@@ -82,10 +84,10 @@ repo_details_cb (PkClient *client, const gchar *repo_id, const gchar *descriptio
}
/**
- * is_in_array:
+ * pk_debuginfo_install_in_array:
**/
static gboolean
-is_in_array (GPtrArray *array, const gchar *text)
+pk_debuginfo_install_in_array (GPtrArray *array, const gchar *text)
{
guint i;
gboolean ret = FALSE;
@@ -103,10 +105,10 @@ is_in_array (GPtrArray *array, const gchar *text)
}
/**
- * enable_repos:
+ * pk_debuginfo_install_enable_repos:
**/
static gboolean
-enable_repos (PkPriv *priv, GPtrArray *array, gboolean enable, GError **error)
+pk_debuginfo_install_enable_repos (PkDebuginfoInstallPrivate *priv, GPtrArray *array, gboolean enable, GError **error)
{
guint i;
gboolean ret = TRUE;
@@ -139,10 +141,10 @@ out:
}
/**
- * install_packages:
+ * pk_debuginfo_install_packages_install:
**/
static gboolean
-install_packages (PkPriv *priv, GPtrArray *array, GError **error)
+pk_debuginfo_install_packages_install (PkDebuginfoInstallPrivate *priv, GPtrArray *array, GError **error)
{
gboolean ret = TRUE;
gchar **package_ids;
@@ -172,10 +174,10 @@ out:
}
/**
- * resolve_to_id:
+ * pk_debuginfo_install_resolve_name_to_id:
**/
static gchar *
-resolve_to_id (PkPriv *priv, const gchar *package_name, GError **error)
+pk_debuginfo_install_resolve_name_to_id (PkDebuginfoInstallPrivate *priv, const gchar *package_name, GError **error)
{
gboolean ret;
const PkPackageObj *obj;
@@ -229,6 +231,51 @@ out:
}
/**
+ * pk_debuginfo_install_remove_suffix:
+ **/
+static gboolean
+pk_debuginfo_install_remove_suffix (gchar *name, const gchar *suffix)
+{
+ gboolean ret = FALSE;
+ guint slen, len;
+
+ if (!g_str_has_suffix (name, suffix))
+ goto out;
+
+ /* get lengths */
+ len = strlen (name);
+ slen = strlen (suffix);
+
+ /* same string */
+ if (len == slen)
+ goto out;
+
+ /* truncate */
+ name[len-slen] = '\0';
+ ret = TRUE;
+out:
+ return ret;
+}
+
+/**
+ * pk_debuginfo_install_print_array:
+ **/
+static void
+pk_debuginfo_install_print_array (GPtrArray *array)
+{
+ guint i;
+ PkPackageId *id;
+ const gchar *package_id;
+
+ for (i=0; i<array->len; i++) {
+ package_id = g_ptr_array_index (array, i);
+ id = pk_package_id_new_from_string (package_id);
+ g_print ("%i\t%s-%s(%s)\t%s\n", i, id->name, id->version, id->arch, id->data);
+ pk_package_id_free (id);
+ }
+}
+
+/**
* main:
**/
int
@@ -243,19 +290,25 @@ main (int argc, char *argv[])
gchar *name;
gchar *name_debuginfo;
gboolean verbose = FALSE;
+ gboolean simulate = FALSE;
GOptionContext *context;
const gchar *repo_id;
gchar *repo_id_debuginfo;
- PkPriv _priv;
- PkPriv *priv = &_priv;
+ PkDebuginfoInstallPrivate _priv;
+ PkDebuginfoInstallPrivate *priv = &_priv;
+ guint step = 1;
const GOptionEntry options[] = {
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
_("Show extra debugging information"), NULL },
+ { "simulate", 's', 0, G_OPTION_ARG_NONE, &simulate,
+ /* command line argument, simulate what would be done, but don't actually do it */
+ _("Don't actually install any packages, only simulate"), NULL },
{ NULL}
};
- memset (priv, 0, sizeof (PkPriv));
+ /* clear private struct */
+ memset (priv, 0, sizeof (PkDebuginfoInstallPrivate));
setlocale (LC_ALL, "");
bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
@@ -268,7 +321,7 @@ main (int argc, char *argv[])
context = g_option_context_new (NULL);
/* TRANSLATORS: tool that gets called when the command is not found */
- g_option_context_set_summary (context, _("PackageKit Command Not Found"));
+ g_option_context_set_summary (context, _("PackageKit Debuginfo Installer"));
g_option_context_add_main_entries (context, options, NULL);
g_option_context_parse (context, &argc, &argv, NULL);
g_option_context_free (context);
@@ -277,7 +330,9 @@ main (int argc, char *argv[])
/* no input */
if (argv[1] == NULL) {
- g_print ("specify packages to install\n");
+ /* TRANSLATORS: the use needs to specify a list of package names on the command line */
+ g_print (_("ERROR: Specify package names to install."));
+ g_print ("\n");
goto out;
}
@@ -289,22 +344,38 @@ main (int argc, char *argv[])
/* create #PkClient */
priv->client = pk_client_new ();
- g_signal_connect (priv->client, "repo-detail", G_CALLBACK (repo_details_cb), priv);
+ g_signal_connect (priv->client, "repo-detail", G_CALLBACK (pk_debuginfo_install_repo_details_cb), priv);
pk_client_set_synchronous (priv->client, TRUE, NULL);
pk_client_set_use_buffer (priv->client, TRUE, NULL);
+ /* starting this section */
+ g_print ("%i. ", step++);
+
+ /* TRANSLATORS: we are getting the list of repositories */
+ g_print (_("Getting sources list..."));
+
/* get all enabled repos */
- g_print ("1. Getting sources list...");
ret = pk_client_get_repo_list (priv->client, PK_FILTER_ENUM_NONE, &error);
if (!ret) {
g_print ("failed to get repo list: %s", error->message);
g_error_free (error);
goto out;
}
- g_print ("OK. Found %i enabled and %i disabled sources.\n", priv->enabled->len, priv->disabled->len);
+
+ /* TRANSLATORS: all completed 100% */
+ g_print ("%s ", _("OK."));
+
+ /* TRANSLATORS: tell the user what we found */
+ g_print (_("Found %i enabled and %i disabled sources."), priv->enabled->len, priv->disabled->len);
+ g_print ("\n");
+
+ /* starting this section */
+ g_print ("%i. ", step++);
+
+ /* TRANSLATORS: we're finding repositories that match out pattern */
+ g_print (_("Finding debugging sources..."));
/* find all debuginfo repos for repos that are enabled */
- g_print ("2. Finding debug sources...");
for (i=0; i<priv->enabled->len; i++) {
/* is already a -debuginfo */
@@ -316,7 +387,7 @@ main (int argc, char *argv[])
/* has a debuginfo repo */
repo_id_debuginfo = g_strjoin ("-", repo_id, "debuginfo", NULL);
- ret = is_in_array (priv->disabled, repo_id_debuginfo);
+ ret = pk_debuginfo_install_in_array (priv->disabled, repo_id_debuginfo);
if (ret) {
/* add to list to change back at the end */
g_ptr_array_add (added_repos, g_strdup (repo_id_debuginfo));
@@ -326,31 +397,62 @@ main (int argc, char *argv[])
g_free (repo_id_debuginfo);
}
- g_print ("OK. Found %i non-enabled debuginfo repos.\n", added_repos->len);
+
+ /* TRANSLATORS: all completed 100% */
+ g_print ("%s ", _("OK."));
+
+ /* TRANSLATORS: tell the user what we found */
+ g_print (_("Found %i disabled debuginfo repos."), added_repos->len);
+ g_print ("\n");
+
+ /* starting this section */
+ g_print ("%i. ", step++);
+
+ /* TRANSLATORS: we're now enabling all the debug sources we found */
+ g_print (_("Enabling debugging sources..."));
/* enable all debuginfo repos we found */
- g_print ("3. Enabling debug sources...");
- ret = enable_repos (priv, added_repos, TRUE, &error);
+ ret = pk_debuginfo_install_enable_repos (priv, added_repos, TRUE, &error);
if (!ret) {
- g_print ("failed to enable repos: %s", error->message);
+ /* TRANSLATORS: operation was not successful */
+ g_print ("%s ", _("FAILED."));
+
+ /* TRANSLATORS: we're failed to enable the sources, detailed error follows */
+ g_print ("Failed to enable debugging sources: %s", error->message);
+ g_print ("\n");
g_error_free (error);
goto out;
}
- g_print ("OK. Enabled %i sources.\n", added_repos->len);
-//debuginfo-install bzip2-libs-1.0.5-5.fc11.i586 glib2-2.20.3-1.fc11.i586 libacl-2.2.47-4.fc11.i586 libarchive-2.6.2-1.fc11.i586 lzma-libs-4.32.7-2.fc11.i586 sqlite-3.6.12-3.fc11.i586 zlib-1.2.3-22.fc11.i586
+ /* TRANSLATORS: all completed 100% */
+ g_print ("%s ", _("OK."));
+
+ /* TRANSLATORS: tell the user how many we enabled */
+ g_print (_("Enabled %i debugging sources."), added_repos->len);
+ g_print ("\n");
+
+ /* starting this section */
+ g_print ("%i. ", step++);
+
+ /* TRANSLATORS: we're now finding packages that match in all the repos */
+ g_print ("Finding debugging packages...");
/* parse arguments and resolve to packages */
- g_print ("4. Finding debug packages...");
for (i=1; argv[i] != NULL; i++) {
name = pk_get_package_name_from_nevra (argv[i]);
+
+ /* remove suffix */
+ pk_debuginfo_install_remove_suffix (name, "-libs");
+
name_debuginfo = g_strjoin ("-", name, "debuginfo", NULL);
egg_debug ("install %s [%s]", argv[i], name_debuginfo);
/* resolve name */
- package_id = resolve_to_id (priv, name_debuginfo, &error);
+ package_id = pk_debuginfo_install_resolve_name_to_id (priv, name_debuginfo, &error);
if (package_id == NULL) {
- g_print ("failed to map package name to an id: %s\n", error->message);
+ /* TRANSLATORS: we couldn't find the package name, non-fatal */
+ g_print (_("Failed to find a package of that name: %s"), error->message);
+ g_print ("\n");
g_error_free (error);
/* don't quit, this is non-fatal */
error = NULL;
@@ -358,7 +460,7 @@ main (int argc, char *argv[])
/* add to array to install */
if (package_id != NULL) {
- egg_debug ("going to try to install: %s\n", package_id);
+ egg_debug ("going to try to install: %s", package_id);
g_ptr_array_add (package_ids_to_install, g_strdup (package_id));
}
@@ -367,18 +469,51 @@ main (int argc, char *argv[])
g_free (package_id);
}
- g_print ("OK. Found %i packages.\n", package_ids_to_install->len);
+ if (package_ids_to_install->len == 0) {
+ /* TRANSLATORS: operation was not successful */
+ g_print ("%s ", _("FAILED."));
+
+ /* TRANSLATORS: no debuginfo packages could be found to be installed */
+ g_print (_("Found no packages to install."));
+ g_print ("\n");
+ goto out;
+ }
+
+ /* TRANSLATORS: all completed 100% */
+ g_print ("%s ", _("OK."));
+
+ /* TRANSLATORS: tell the user we found some packages, and then list them */
+ g_print (_("Found %i packages:"), package_ids_to_install->len);
+ g_print ("\n");
+
+ /* print list */
+ pk_debuginfo_install_print_array (package_ids_to_install);
+
+ /* simulate mode for testing */
+ if (simulate) {
+ /* TRANSLATORS: simulate mode is a testing mode where we quit before the action */
+ g_print (_("Not installing packages in simulate mode"));
+ g_print ("\n");
+ goto out;
+ }
+
+ /* starting this section */
+ g_print ("%i. ", step++);
+
+ /* TRANSLATORS: we are now installing the debuginfo packages we found earlier */
+ g_print ("Installing packages...");
/* install */
- g_print ("5. Installing packages...");
- ret = install_packages (priv, package_ids_to_install, &error);
+ ret = pk_debuginfo_install_packages_install (priv, package_ids_to_install, &error);
if (!ret) {
g_print ("failed to install packages: %s", error->message);
g_error_free (error);
goto out;
}
- g_print ("OK.\n");
+ /* TRANSLATORS: all completed 100% */
+ g_print (_("OK."));
+ g_print ("\n");
out:
if (package_ids_to_install != NULL) {
@@ -387,14 +522,31 @@ out:
}
if (added_repos != NULL) {
- g_print ("6. Disabling sources...");
+ /* starting this section */
+ g_print ("%i. ", step++);
+
+ /* TRANSLATORS: we are now disabling all debuginfo repos we previously enabled */
+ g_print (_("Disabling sources previously enabled..."));
+
/* disable all debuginfo repos we previously enabled */
- ret = enable_repos (priv, added_repos, FALSE, &error);
+ ret = pk_debuginfo_install_enable_repos (priv, added_repos, FALSE, &error);
if (!ret) {
- g_print ("failed to enable repos: %s", error->message);
+ /* TRANSLATORS: operation was not successful */
+ g_print ("%s ", _("FAILED."));
+
+ /* TRANSLATORS: no debuginfo packages could be found to be installed, detailed error follows */
+ g_print (_("Could not disable the debugging sources: %s"), error->message);
+ g_print ("\n");
g_error_free (error);
+ } else {
+
+ /* TRANSLATORS: all completed 100% */
+ g_print ("%s ", _("OK."));
+
+ /* TRANSLATORS: we disabled all the debugging repos that we enabled before */
+ g_print (_("Disabled %i debugging sources."), added_repos->len);
+ g_print ("\n");
}
- g_print ("OK. Disabled %i sources.\n", added_repos->len);
g_ptr_array_foreach (added_repos, (GFunc) g_free, NULL);
g_ptr_array_free (added_repos, TRUE);
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 561af4f..2e0113f 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -7,6 +7,7 @@ client/pk-monitor.c
client/pk-tools-common.c
contrib/command-not-found/pk-command-not-found.c
contrib/browser-plugin/src/contents.cpp
+contrib/debuginfo-install/pk-debuginfo-install.c
data/packagekit-catalog.xml.in
data/packagekit-package-list.xml.in
data/packagekit-servicepack.xml.in
commit eb71887b0e246450a039fe95fc563176727db994
Author: Richard Hughes <richard at hughsie.com>
Date: Fri Jun 26 10:47:14 2009 +0100
Add some special casing for the pk-debuginfo-install in the PolicyKit helper
diff --git a/src/pk-polkit-action-lookup.c b/src/pk-polkit-action-lookup.c
index ba33fda..ce4db8c 100644
--- a/src/pk-polkit-action-lookup.c
+++ b/src/pk-polkit-action-lookup.c
@@ -90,6 +90,25 @@ pk_action_lookup_class_init (PkActionLookupClass *klass)
}
/**
+ * pk_action_lookup_cmdline_is_debuginfo_install:
+ **/
+static gboolean
+pk_action_lookup_cmdline_is_debuginfo_install (const gchar *cmdline)
+{
+ /* is the only location of this path that is valid */
+ if (g_strcmp0 (cmdline, "/usr/lib/pk-debuginfo-install") == 0)
+ return TRUE;
+
+#if 0
+ /* this is for debugging, and would be insecure in release code */
+ if (g_str_has_suffix (cmdline, "pk-debuginfo-install"))
+ return TRUE;
+#endif
+
+ return FALSE;
+}
+
+/**
* pk_action_lookup_get_message:
**/
static gchar *
@@ -98,6 +117,7 @@ pk_action_lookup_get_message (PolkitBackendActionLookup *lookup, const gchar *ac
{
PkRoleEnum role = PK_ROLE_ENUM_UNKNOWN;
gboolean only_trusted = TRUE;
+ const gchar *cmdline;
const gchar *role_text;
const gchar *only_trusted_text;
gchar *message = NULL;
@@ -116,6 +136,14 @@ pk_action_lookup_get_message (PolkitBackendActionLookup *lookup, const gchar *ac
if (only_trusted_text != NULL)
only_trusted = g_str_equal (only_trusted_text, "true");
+ /* get the command line */
+ cmdline = polkit_details_lookup (details, "cmdline");
+ if (role == PK_ROLE_ENUM_REPO_ENABLE &&
+ pk_action_lookup_cmdline_is_debuginfo_install (cmdline)) {
+ message = g_strdup (N_("To install debugging packages, extra sources need to be enabled"));
+ goto out;
+ }
+
/* use the message shipped in the policy file */
if (only_trusted)
goto out;
@@ -168,18 +196,35 @@ static gchar *
pk_action_lookup_get_icon_name (PolkitBackendActionLookup *lookup, const gchar *action_id,
PolkitDetails *details, PolkitActionDescription *action_description)
{
+ PkRoleEnum role = PK_ROLE_ENUM_UNKNOWN;
gboolean only_trusted = TRUE;
const gchar *only_trusted_text;
+ const gchar *role_text;
+ const gchar *cmdline;
gchar *value = NULL;
if (!g_str_has_prefix (action_id, "org.freedesktop.packagekit."))
goto out;
+ /* get role */
+ role_text = polkit_details_lookup (details, "role");
+ if (role_text != NULL)
+ role = pk_role_enum_from_text (role_text);
+
/* get only-trusted */
only_trusted_text = polkit_details_lookup (details, "only-trusted");
if (only_trusted_text != NULL)
only_trusted = g_str_equal (only_trusted_text, "true");
+ /* get the command line */
+ cmdline = polkit_details_lookup (details, "cmdline");
+ if (role == PK_ROLE_ENUM_REPO_ENABLE &&
+ pk_action_lookup_cmdline_is_debuginfo_install (cmdline)) {
+ /* TODO: need a debugging icon */
+ value = g_strdup ("network-server");
+ goto out;
+ }
+
/* only-trusted */
if (!only_trusted) {
value = g_strdup ("emblem-important");
@@ -218,6 +263,13 @@ pk_action_lookup_get_details (PolkitBackendActionLookup *lookup, const gchar *ac
polkit_details_insert (details, _("Only trusted"), str);
}
+ /* only-trusted */
+ str = polkit_details_lookup (action_details, "cmdline");
+ if (str != NULL) {
+ /* TRANSLATORS: the command line of the thing that wants the authentication */
+ polkit_details_insert (details, _("Command line"), str);
+ }
+
return details;
}
commit 16dd26b1841a2b9ede91e974021faab58f52e9ba
Author: Richard Hughes <richard at hughsie.com>
Date: Fri Jun 26 10:38:10 2009 +0100
Get the command line from all transactions, and pass it to all PolicyKit requests as a detail
diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index 512cfa5..c072c29 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -114,6 +114,7 @@ struct PkTransactionPrivate
gchar *last_package_id;
gchar *tid;
gchar *sender;
+ gchar *cmdline;
PkPackageList *package_list;
PkTransactionList *transaction_list;
PkTransactionDb *transaction_db;
@@ -1279,43 +1280,6 @@ out:
return uid;
}
-/**
- * pk_transaction_set_sender:
- */
-gboolean
-pk_transaction_set_sender (PkTransaction *transaction, const gchar *sender)
-{
- g_return_val_if_fail (PK_IS_TRANSACTION (transaction), FALSE);
- g_return_val_if_fail (sender != NULL, FALSE);
- g_return_val_if_fail (transaction->priv->sender == NULL, FALSE);
-
- egg_debug ("setting sender to %s", sender);
- transaction->priv->sender = g_strdup (sender);
- egg_dbus_monitor_assign (transaction->priv->monitor, EGG_DBUS_MONITOR_SYSTEM, sender);
-
- /* we get the UID for all callers as we need to know when to cancel */
-#ifdef USE_SECURITY_POLKIT
- transaction->priv->subject = polkit_system_bus_name_new (sender);
-#endif
- transaction->priv->uid = pk_transaction_get_uid (transaction, sender);
-
- return TRUE;
-}
-
-/**
- * pk_transaction_release_tid:
- **/
-static gboolean
-pk_transaction_release_tid (PkTransaction *transaction)
-{
- gboolean ret;
- g_return_val_if_fail (PK_IS_TRANSACTION (transaction), FALSE);
- /* release the ID as we are returning an error */
- ret = pk_transaction_list_remove (transaction->priv->transaction_list,
- transaction->priv->tid);
- return ret;
-}
-
#ifdef USE_SECURITY_POLKIT
/**
* pk_transaction_get_pid:
@@ -1351,7 +1315,6 @@ out:
return pid;
}
-
/**
* pk_transaction_get_cmdline:
**/
@@ -1388,15 +1351,50 @@ out:
#endif
/**
+ * pk_transaction_set_sender:
+ */
+gboolean
+pk_transaction_set_sender (PkTransaction *transaction, const gchar *sender)
+{
+ g_return_val_if_fail (PK_IS_TRANSACTION (transaction), FALSE);
+ g_return_val_if_fail (sender != NULL, FALSE);
+ g_return_val_if_fail (transaction->priv->sender == NULL, FALSE);
+
+ egg_debug ("setting sender to %s", sender);
+ transaction->priv->sender = g_strdup (sender);
+ egg_dbus_monitor_assign (transaction->priv->monitor, EGG_DBUS_MONITOR_SYSTEM, sender);
+
+ /* we get the UID for all callers as we need to know when to cancel */
+#ifdef USE_SECURITY_POLKIT
+ transaction->priv->subject = polkit_system_bus_name_new (sender);
+ transaction->priv->cmdline = pk_transaction_get_cmdline (transaction, transaction->priv->subject);
+#endif
+ transaction->priv->uid = pk_transaction_get_uid (transaction, sender);
+
+ return TRUE;
+}
+
+/**
+ * pk_transaction_release_tid:
+ **/
+static gboolean
+pk_transaction_release_tid (PkTransaction *transaction)
+{
+ gboolean ret;
+ g_return_val_if_fail (PK_IS_TRANSACTION (transaction), FALSE);
+ /* release the ID as we are returning an error */
+ ret = pk_transaction_list_remove (transaction->priv->transaction_list,
+ transaction->priv->tid);
+ return ret;
+}
+
+/**
* pk_transaction_commit:
**/
G_GNUC_WARN_UNUSED_RESULT static gboolean
pk_transaction_commit (PkTransaction *transaction)
{
gboolean ret;
-#ifdef USE_SECURITY_POLKIT
- gchar *cmdline;
-#endif
g_return_val_if_fail (PK_IS_TRANSACTION (transaction), FALSE);
g_return_val_if_fail (transaction->priv->tid != NULL, FALSE);
@@ -1426,10 +1424,9 @@ pk_transaction_commit (PkTransaction *transaction)
pk_transaction_db_set_uid (transaction->priv->transaction_db, transaction->priv->tid, transaction->priv->uid);
#ifdef USE_SECURITY_POLKIT
- /* save cmdline */
- cmdline = pk_transaction_get_cmdline (transaction, transaction->priv->subject);
- pk_transaction_db_set_cmdline (transaction->priv->transaction_db, transaction->priv->tid, cmdline);
- g_free (cmdline);
+ /* save cmdline in db */
+ if (transaction->priv->cmdline != NULL)
+ pk_transaction_db_set_cmdline (transaction->priv->transaction_db, transaction->priv->tid, transaction->priv->cmdline);
#endif
/* report to syslog */
@@ -1712,6 +1709,8 @@ pk_transaction_obtain_authorization (PkTransaction *transaction, gboolean only_t
details = polkit_details_new ();
polkit_details_insert (details, "role", pk_role_enum_to_text (transaction->priv->role));
polkit_details_insert (details, "only-trusted", transaction->priv->cached_only_trusted ? "true" : "false");
+ if (transaction->priv->cmdline != NULL)
+ polkit_details_insert (details, "cmdline", transaction->priv->cmdline);
/* do authorization async */
polkit_authority_check_authorization (transaction->priv->authority,
@@ -4182,6 +4181,7 @@ pk_transaction_init (PkTransaction *transaction)
#ifdef USE_SECURITY_POLKIT
transaction->priv->subject = NULL;
#endif
+ transaction->priv->cmdline = NULL;
transaction->priv->uid = PK_TRANSACTION_UID_INVALID;
transaction->priv->role = PK_ROLE_ENUM_UNKNOWN;
transaction->priv->status = PK_STATUS_ENUM_WAIT;
@@ -4290,6 +4290,7 @@ pk_transaction_finalize (GObject *object)
g_free (transaction->priv->cached_value);
g_free (transaction->priv->tid);
g_free (transaction->priv->sender);
+ g_free (transaction->priv->cmdline);
g_object_unref (transaction->priv->conf);
g_object_unref (transaction->priv->cache);
commit 2c6680f2ec54bb6af22d3b16c3243cbeecb88060
Author: Richard Hughes <richard at hughsie.com>
Date: Fri Jun 26 10:36:58 2009 +0100
glib: if we're running synchronous then track Finished() and return false if there is not success
diff --git a/lib/packagekit-glib/pk-client.c b/lib/packagekit-glib/pk-client.c
index 5c1c9c4..db68a18 100644
--- a/lib/packagekit-glib/pk-client.c
+++ b/lib/packagekit-glib/pk-client.c
@@ -106,6 +106,7 @@ struct _PkClientPrivate
PkBitfield cached_filters;
gint timeout;
guint timeout_id;
+ GError *error;
};
typedef enum {
@@ -506,8 +507,12 @@ pk_client_finished_cb (DBusGProxy *proxy, const gchar *exit_text, guint runtime,
client->priv->is_finishing = FALSE;
/* exit our private loop */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
+ if (exit_enum != PK_EXIT_ENUM_SUCCESS)
+ client->priv->error = g_error_new (PK_CLIENT_ERROR, PK_CLIENT_ERROR_FAILED,
+ "failed: %s", exit_text);
g_main_loop_quit (client->priv->loop);
+ }
/* unref what we previously ref'd */
g_object_unref (client);
@@ -1396,8 +1401,14 @@ pk_client_get_updates (PkClient *client, PkBitfield filters, GError **error)
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
g_free (filter_text);
@@ -1465,8 +1476,14 @@ pk_client_get_categories (PkClient *client, GError **error)
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
return ret;
@@ -1539,8 +1556,14 @@ pk_client_update_system (PkClient *client, gboolean only_trusted, GError **error
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
return ret;
@@ -1612,8 +1635,14 @@ pk_client_search_name (PkClient *client, PkBitfield filters, const gchar *search
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
g_free (filter_text);
@@ -1687,8 +1716,14 @@ pk_client_search_details (PkClient *client, PkBitfield filters, const gchar *sea
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
g_free (filter_text);
@@ -1760,8 +1795,14 @@ pk_client_search_group (PkClient *client, PkBitfield filters, const gchar *searc
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
g_free (filter_text);
@@ -1833,8 +1874,14 @@ pk_client_search_file (PkClient *client, PkBitfield filters, const gchar *search
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
g_free (filter_text);
@@ -1921,8 +1968,14 @@ pk_client_get_depends (PkClient *client, PkBitfield filters, gchar **package_ids
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
g_free (filter_text);
@@ -2001,8 +2054,14 @@ pk_client_download_packages (PkClient *client, gchar **package_ids, const gchar
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
return ret;
@@ -2070,8 +2129,14 @@ pk_client_get_packages (PkClient *client, PkBitfield filters, GError **error)
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
g_free (filter_text);
@@ -2201,8 +2266,14 @@ pk_client_get_requires (PkClient *client, PkBitfield filters, gchar **package_id
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
g_free (filter_text);
@@ -2285,8 +2356,14 @@ pk_client_what_provides (PkClient *client, PkBitfield filters, PkProvidesEnum pr
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
g_free (filter_text);
@@ -2370,8 +2447,14 @@ pk_client_get_update_detail (PkClient *client, gchar **package_ids, GError **err
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
return ret;
@@ -2438,8 +2521,14 @@ pk_client_rollback (PkClient *client, const gchar *transaction_id, GError **erro
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
return ret;
@@ -2513,8 +2602,14 @@ pk_client_resolve (PkClient *client, PkBitfield filters, gchar **packages, GErro
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
g_free (filter_text);
@@ -2598,8 +2693,14 @@ pk_client_get_details (PkClient *client, gchar **package_ids, GError **error)
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
return ret;
@@ -2667,8 +2768,14 @@ pk_client_get_distro_upgrades (PkClient *client, GError **error)
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
return ret;
@@ -2746,8 +2853,14 @@ pk_client_get_files (PkClient *client, gchar **package_ids, GError **error)
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
return ret;
@@ -2834,8 +2947,14 @@ pk_client_remove_packages (PkClient *client, gchar **package_ids, gboolean allow
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
return ret;
@@ -2904,8 +3023,14 @@ pk_client_refresh_cache (PkClient *client, gboolean force, GError **error)
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
return ret;
@@ -2986,8 +3111,14 @@ pk_client_install_packages (PkClient *client, gboolean only_trusted, gchar **pac
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
return ret;
@@ -3062,8 +3193,14 @@ pk_client_install_signature (PkClient *client, PkSigTypeEnum type, const gchar *
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
return ret;
@@ -3148,8 +3285,14 @@ pk_client_update_packages (PkClient *client, gboolean only_trusted, gchar **pack
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
return ret;
@@ -3266,8 +3409,14 @@ pk_client_install_files (PkClient *client, gboolean only_trusted, gchar **files_
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
g_strfreev (files);
@@ -3335,8 +3484,14 @@ pk_client_get_repo_list (PkClient *client, PkBitfield filters, GError **error)
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
g_free (filter_text);
@@ -3403,8 +3558,14 @@ pk_client_accept_eula (PkClient *client, const gchar *eula_id, GError **error)
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
return ret;
@@ -3472,8 +3633,14 @@ pk_client_repo_enable (PkClient *client, const gchar *repo_id, gboolean enabled,
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
return ret;
@@ -3547,8 +3714,14 @@ pk_client_repo_set_data (PkClient *client, const gchar *repo_id, const gchar *pa
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
return ret;
@@ -3658,8 +3831,14 @@ pk_client_get_old_transactions (PkClient *client, guint number, GError **error)
pk_client_change_status (client, PK_STATUS_ENUM_WAIT);
/* spin until finished */
- if (client->priv->synchronous)
+ if (client->priv->synchronous) {
g_main_loop_run (client->priv->loop);
+ if (client->priv->error != NULL) {
+ ret = FALSE;
+ if (error != NULL)
+ *error = g_error_copy (client->priv->error);
+ }
+ }
}
out:
return ret;
@@ -4338,6 +4517,7 @@ pk_client_reset (PkClient *client, GError **error)
g_strfreev (client->priv->cached_package_ids);
g_strfreev (client->priv->cached_full_paths);
g_object_unref (client->priv->package_list);
+ g_clear_error (&client->priv->error);
/* clear restart array */
g_ptr_array_foreach (client->priv->require_restart_list, (GFunc) pk_package_id_free, NULL);
@@ -4403,6 +4583,7 @@ pk_client_init (PkClient *client)
client->priv->proxy = NULL;
client->priv->timeout = -1;
client->priv->timeout_id = 0;
+ client->priv->error = NULL;
/* check dbus connections, exit if not valid */
client->priv->connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
@@ -4522,6 +4703,8 @@ pk_client_finalize (GObject *object)
g_free (client->priv->tid);
g_strfreev (client->priv->cached_package_ids);
g_strfreev (client->priv->cached_full_paths);
+ if (client->priv->error)
+ g_error_free (client->priv->error);
/* clear restart array */
g_ptr_array_foreach (client->priv->require_restart_list, (GFunc) pk_package_id_free, NULL);
commit dbcb8ec8d52d36584f245d83649de36498a3dbfa
Author: Mounir Lamouri (volkmar) <mounir.lamouri at gmail.com>
Date: Fri Jun 26 01:34:42 2009 +0200
portage: add free filter management to get_all_cpv
diff --git a/backends/portage/portageBackend.py b/backends/portage/portageBackend.py
index 1d6ff76..b406b83 100755
--- a/backends/portage/portageBackend.py
+++ b/backends/portage/portageBackend.py
@@ -280,15 +280,16 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
# NOTES:
# returns a list of cpv
# TODO: maybe improve filters management ?
+ # like licenses when populating the list ?
#
# FILTERS:
# - installed: ok
- # - free: TODO
+ # - free: ok
# - newest: ok
cpv = []
- # installed filter
+ # populate cpv and take care of installed filter
if FILTER_INSTALLED in fltlist:
# special case : cp = cpv
cpv.append(cp)
@@ -302,6 +303,29 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
if len(cpv) == 0:
return []
+ # free filter
+ if FILTER_FREE or FILTER_NOT_FREE in fltlist:
+ free_licenses = "@FSF-APPROVED"
+ if FILTER_FREE in fltlist:
+ licenses = "-* " + free_licenses
+ else:
+ licenses = "* -" + free_licenses
+ backup_license = self.portage_settings["ACCEPT_LICENSE"]
+ self.portage_settings["ACCEPT_LICENSE"] = licenses
+ self.portage_settings.backup_changes("ACCEPT_LICENSE")
+ self.portage_settings.regenerate()
+ keys = ["LICENSE", "USE", "SLOT"]
+ for x in cpv:
+ metadata = dict(izip(keys, portage.portdb.aux_get(x, keys)))
+ if self.portage_settings._getMissingLicenses(x, metadata):
+ cpv.remove(x)
+ self.portage_settings["ACCEPT_LICENSE"] = backup_license
+ self.portage_settings.backup_changes("ACCEPT_LICENSE")
+ self.portage_settings.regenerate()
+
+ if len(cpv) == 0:
+ return []
+
# newest filter
if FILTER_NEWEST in fltlist:
if FILTER_INSTALLED in fltlist:
@@ -328,7 +352,7 @@ class PackageKitPortageBackend(PackageKitBaseBackend, PackagekitPackage):
pkg_keywords, repo = portage.portdb.aux_get(cpv, ["KEYWORDS", "repository"])
pkg_keywords = pkg_keywords.split()
- sys_keywords = self.portage_settings.configdict["conf"].get("ACCEPT_KEYWORDS").split()
+ sys_keywords = self.portage_settings["ACCEPT_KEYWORDS"].split()
keywords = []
for x in sys_keywords:
More information about the PackageKit-commit
mailing list