[PackageKit-commit] packagekit: Branch 'master' - 2 commits
Richard Hughes
hughsient at kemper.freedesktop.org
Sun Oct 12 08:58:54 PDT 2008
backends/alpm/pk-backend-alpm.c | 23 ++++---------
backends/urpmi/helpers/urpmi-dispatched-backend.pl | 35 +++++++++------------
2 files changed, 22 insertions(+), 36 deletions(-)
New commits:
commit 85ecb538b13cf5186b0b1530e100bc8076886b97
Author: Aurelien Lefebvre <alefebvre at mandriva.com>
Date: Sun Oct 12 15:28:55 2008 +0200
urpmi: fix in backend with new package ids delimiter (&)
diff --git a/backends/urpmi/helpers/urpmi-dispatched-backend.pl b/backends/urpmi/helpers/urpmi-dispatched-backend.pl
index e769f50..cad4f33 100755
--- a/backends/urpmi/helpers/urpmi-dispatched-backend.pl
+++ b/backends/urpmi/helpers/urpmi-dispatched-backend.pl
@@ -146,10 +146,8 @@ sub get_depends {
my ($urpm, $args) = @_;
my @filterstab = split(/;/, @{$args}[0]);
- shift @{$args};
- my $recursive_text = pop @{$args};
- my $recursive_option = $recursive_text eq "yes" ? 1 : 0;
- my @packageidstab = @{$args};
+ my $recursive_option = @{$args}[1] eq "yes" ? 1 : 0;
+ my @packageidstab = split(/&/, @{$args}[2]);
pk_print_status(PK_STATUS_ENUM_DEP_RESOLVE);
@@ -201,7 +199,7 @@ sub get_details {
my ($urpm, $args) = @_;
- my @packageidstab = @{$args};
+ my @packageidstab = split(/&/, @{$args}[0]);
pk_print_status(PK_STATUS_ENUM_QUERY);
foreach (@packageidstab) {
@@ -256,7 +254,7 @@ sub get_files {
my ($urpm, $args) = @_;
- my @packageidstab = @{$args};
+ my @packageidstab = split(/&/, @{$args}[0]);
pk_print_status(PK_STATUS_ENUM_QUERY);
foreach (@packageidstab) {
@@ -303,10 +301,8 @@ sub get_requires {
my ($urpm, $args) = @_;
my @filterstab = split(/;/, @{$args}[0]);
- shift @{$args};
- my $recursive_text = pop @{$args};
- my $recursive_option = $recursive_text eq "yes" ? 1 : 0;
- my @packageidstab = @{$args};
+ my $recursive_option = @{$args}[1] eq "yes" ? 1 : 0;
+ my @packageidstab = split(/&/, @{$args}[2]);
my @pkgnames;
foreach (@packageidstab) {
@@ -335,7 +331,7 @@ sub get_update_detail {
my ($urpm, $args) = @_;
pk_print_status(PK_STATUS_ENUM_QUERY);
- my @packageidstab = @{$args};
+ my @packageidstab = split(/&/, @{$args}[0]);
foreach (@packageidstab) {
_print_package_update_details($urpm, $_);
@@ -377,7 +373,7 @@ sub install_packages {
my ($urpm, $args) = @_;
- my @packageidstab = @{$args};
+ my @packageidstab = split(/&/, @{$args}[0]);
my @names;
foreach(@packageidstab) {
@@ -476,9 +472,8 @@ sub remove_packages {
my $urpmi_lock = urpm::lock::urpmi_db($urpm, 'exclusive', wait => 1);
- my $allowdeps_text = shift @{$args};
- my $allowdeps_option = $allowdeps_text eq "yes" ? 1 : 0;
- my @packageidstab = @{$args};
+ my $allowdeps_option = @{$args}[0] eq "yes" ? 1 : 0;
+ my @packageidstab = split(/&/, @{$args}[1]);
my @names;
foreach(@packageidstab) {
@@ -530,8 +525,7 @@ sub resolve {
my ($urpm, $args) = @_;
my @filters = split(/;/, @{$args}[0]);
- shift @{$args};
- my @patterns = @{$args};
+ my @patterns = split(/&/, @{$args}[1]);
pk_print_status(PK_STATUS_ENUM_QUERY);
@@ -569,8 +563,7 @@ sub search_details {
my ($urpm, $args) = @_;
my @filters = split(/;/, @{$args}[0]);
- shift @{$args};
- my $search_term = pop @{$args};
+ my $search_term = @{$args}[1];
pk_print_status(PK_STATUS_ENUM_QUERY);
@@ -669,8 +662,10 @@ sub update_packages {
my ($urpm, $args) = @_;
+ my @packageidstab = split(/&/, @{$args}[0]);
+
my @names;
- foreach(@{$args}) {
+ foreach(@packageidstab) {
my @pkgid = split(/;/, $_);
push @names, $pkgid[0];
}
commit 9624773cdfd49c1f5f708f28d0c3d2bfed93f189
Author: Valeriy Lyasotskiy <onestep at ukr.net>
Date: Fri Oct 10 20:19:52 2008 +0300
alpm: always hide available package if it have the same version as installed
diff --git a/backends/alpm/pk-backend-alpm.c b/backends/alpm/pk-backend-alpm.c
index e9e0f0d..cd99495 100644
--- a/backends/alpm/pk-backend-alpm.c
+++ b/backends/alpm/pk-backend-alpm.c
@@ -51,7 +51,6 @@
int progress_percentage;
int subprogress_percentage;
PkBackend *backend_instance = NULL;
-alpm_list_t *local_result = NULL;
gchar *dl_file_name;
GHashTable *group_map;
@@ -834,10 +833,13 @@ backend_get_files (PkBackend *backend, gchar **package_ids)
}
int
-backend_pkg_cmp (const void *data1, const void *data2) {
+backend_pkg_cmp (pmpkg_t *pkg1, pmpkg_t *pkg2) {
int comparison;
- pmpkg_t *pkg1 = (pmpkg_t *) data1;
- pmpkg_t *pkg2 = (pmpkg_t *) data2;
+ /* check for no package */
+ if (pkg1 == NULL)
+ return -1;
+ if (pkg2 == NULL)
+ return 1;
/* compare package names */
comparison = strcmp (alpm_pkg_get_name (pkg1), alpm_pkg_get_name (pkg2));
if (comparison != 0)
@@ -912,11 +914,9 @@ backend_search (PkBackend *backend, pmdb_t *repo, const gchar *needle, PkAlpmSea
match = FALSE;
}
- if (match && (repo_is_local || alpm_list_find (local_result, pkg, backend_pkg_cmp) == NULL)) {
+ if (match && (repo_is_local || backend_pkg_cmp (pkg, alpm_db_get_pkg (alpm_option_get_localdb (), alpm_pkg_get_name (pkg))) != 0)) {
/* we found what we wanted */
emit_package (backend, pkg, repo_name, info);
- if (repo_is_local)
- local_result = alpm_list_add (local_result, pkg);
}
}
}
@@ -931,7 +931,6 @@ backend_get_packages_thread (PkBackend *backend)
gboolean search_installed = pk_bitfield_contain (filters, PK_FILTER_ENUM_INSTALLED);
gboolean search_not_installed = pk_bitfield_contain (filters, PK_FILTER_ENUM_NOT_INSTALLED);
- local_result = NULL;
if (!search_not_installed) {
/* search in local db */
@@ -946,8 +945,6 @@ backend_get_packages_thread (PkBackend *backend)
backend_search (backend, alpm_list_getdata (repos), NULL, PK_ALPM_SEARCH_TYPE_NULL);
}
- alpm_list_free (local_result);
-
pk_backend_finished (backend);
return TRUE;
}
@@ -1326,7 +1323,6 @@ backend_resolve_thread (PkBackend *backend)
for (iterator = 0; iterator < g_strv_length (package_ids); ++iterator) {
gboolean search_installed = pk_bitfield_contain (filters, PK_FILTER_ENUM_INSTALLED);
gboolean search_not_installed = pk_bitfield_contain (filters, PK_FILTER_ENUM_NOT_INSTALLED);
- local_result = NULL;
if (!search_not_installed) {
/* search in local db */
@@ -1340,8 +1336,6 @@ backend_resolve_thread (PkBackend *backend)
for (repos = alpm_option_get_syncdbs (); repos; repos = alpm_list_next (repos))
backend_search (backend, alpm_list_getdata (repos), package_ids[iterator], PK_ALPM_SEARCH_TYPE_RESOLVE);
}
-
- alpm_list_free (local_result);
}
pk_backend_finished (backend);
@@ -1372,7 +1366,6 @@ backend_search_thread (PkBackend *backend)
gboolean search_installed = pk_bitfield_contain (filters, PK_FILTER_ENUM_INSTALLED);
gboolean search_not_installed = pk_bitfield_contain (filters, PK_FILTER_ENUM_NOT_INSTALLED);
- local_result = NULL;
if (!search_not_installed) {
/* search in local db */
@@ -1387,8 +1380,6 @@ backend_search_thread (PkBackend *backend)
backend_search (backend, alpm_list_getdata (repos), search, search_type);
}
- alpm_list_free (local_result);
-
pk_backend_finished (backend);
return TRUE;
}
More information about the PackageKit-commit
mailing list