summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobey Pointer <robey@src.gnome.org>2001-03-28 23:34:06 +0000
committerRobey Pointer <robey@src.gnome.org>2001-03-28 23:34:06 +0000
commit7145ee121091a3fdc26659c7b6a764a8936ef222 (patch)
treef3b0d7de1be0fa2d3536a22298a767e6de7e0e9d
parent5a9e529f92ee9a1bc2f8fd9f573127f5ba7efcf9 (diff)
downloadnautilus-7145ee121091a3fdc26659c7b6a764a8936ef222.tar.gz
reviewed by: Eskil Heyn Olsen <eskil@eazel.com>
who glanced at it before passing out * components/services/install/lib/eazel-install-logic2.c: (dedupe_foreach_depends): Backport a fix for deduping from the branch. (This may fix some bugs related to deduping suites; to be honest, nobody remembers what this patch was originally supposed to do.) * components/services/install/lib/eazel-install-object.c: (eazel_install_initialize): * components/services/install/lib/eazel-package-system-types.c: * components/services/install/lib/eazel-softcat-private.h: * components/services/install/lib/eazel-softcat.h: Change 'eazel_softcat_set_packages_pr_query' to 'eazel_softcat_set_packages_per_query' because I just can't see one extra letter making a difference in a function name that long anyway. * components/services/install/lib/eazel-softcat.c: (eazel_softcat_initialize), (eazel_softcat_set_packages_per_query), (eazel_softcat_get_info), (eazel_softcat_get_info_plural): Backport a fix for suites from the branch. This caused wrong error messages for the case where a suite contained only one package (which is currently nearly 99% of all suites in softcat). Adam noticed this a few days ago. * nautilus-installer/src/installer.c: (report_unusual_errors): Fix a trivial FIXME. These should be the last of the patches that need to be backported from the 1.0 branch.
-rw-r--r--ChangeLog39
-rw-r--r--components/services/install/lib/eazel-install-logic2.c29
-rw-r--r--components/services/install/lib/eazel-install-object.c2
-rw-r--r--components/services/install/lib/eazel-package-system-types.c2
-rw-r--r--components/services/install/lib/eazel-softcat-private.h2
-rw-r--r--components/services/install/lib/eazel-softcat.c91
-rw-r--r--components/services/install/lib/eazel-softcat.h2
-rw-r--r--nautilus-installer/src/installer.c6
8 files changed, 104 insertions, 69 deletions
diff --git a/ChangeLog b/ChangeLog
index f431140ae..b0d8dd512 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,42 @@
+2001-03-28 Robey Pointer <robey@eazel.com>
+
+ reviewed by: Eskil Heyn Olsen <eskil@eazel.com>
+ who glanced at it before passing out
+
+ * components/services/install/lib/eazel-install-logic2.c:
+ (dedupe_foreach_depends):
+
+ Backport a fix for deduping from the branch. (This may fix some
+ bugs related to deduping suites; to be honest, nobody remembers
+ what this patch was originally supposed to do.)
+
+ * components/services/install/lib/eazel-install-object.c:
+ (eazel_install_initialize):
+ * components/services/install/lib/eazel-package-system-types.c:
+ * components/services/install/lib/eazel-softcat-private.h:
+ * components/services/install/lib/eazel-softcat.h:
+
+ Change 'eazel_softcat_set_packages_pr_query' to
+ 'eazel_softcat_set_packages_per_query' because I just can't see
+ one extra letter making a difference in a function name that long
+ anyway.
+
+ * components/services/install/lib/eazel-softcat.c:
+ (eazel_softcat_initialize), (eazel_softcat_set_packages_per_query),
+ (eazel_softcat_get_info), (eazel_softcat_get_info_plural):
+
+ Backport a fix for suites from the branch. This caused wrong
+ error messages for the case where a suite contained only one
+ package (which is currently nearly 99% of all suites in softcat).
+ Adam noticed this a few days ago.
+
+ * nautilus-installer/src/installer.c: (report_unusual_errors):
+
+ Fix a trivial FIXME.
+
+ These should be the last of the patches that need to be backported
+ from the 1.0 branch.
+
2001-03-28 Eskil Heyn Olsen <eskil@eazel.com>
* components/services/install/lib/eazel-package-system-types.h:
diff --git a/components/services/install/lib/eazel-install-logic2.c b/components/services/install/lib/eazel-install-logic2.c
index adf33a081..7aaff78e7 100644
--- a/components/services/install/lib/eazel-install-logic2.c
+++ b/components/services/install/lib/eazel-install-logic2.c
@@ -968,6 +968,7 @@ dedupe_foreach_depends (PackageDependency *d,
EazelInstall *service)
{
PackageData *p1;
+ PackageData *p11;
g_assert (d);
g_assert (IS_PACKAGEDEPENDENCY (d));
@@ -981,28 +982,24 @@ dedupe_foreach_depends (PackageDependency *d,
return;
}
- if (~p1->fillflag & MUST_HAVE) {
- PackageData *p11;
-
- p11 = g_hash_table_lookup (service->private->dedupe_hash, p1->md5);
+ p11 = g_hash_table_lookup (service->private->dedupe_hash, p1->md5);
- if (p11) {
- if (p11 != p1) {
+ if (p11) {
+ if (p11 != p1) {
#if EI2_DEBUG & 0x4
- trilobite_debug ("\tdeduping(b) %p %s is already read at %p %s", p1, p1->name, p11, p11->name);
+ trilobite_debug ("\tdeduping(b) %p %s is already read at %p %s", p1, p1->name, p11, p11->name);
#endif
- gtk_object_ref (GTK_OBJECT (p11));
- gtk_object_unref (GTK_OBJECT (p1));
- d->package = p11;
- } else {
+ gtk_object_ref (GTK_OBJECT (p11));
+ gtk_object_unref (GTK_OBJECT (p1));
+ d->package = p11;
+ } else {
#if EI2_DEBUG & 0x4
- trilobite_debug ("\tnot deduping(b) myself %p %s", p11, p11->name, p1);
+ trilobite_debug ("\tnot deduping(b) myself %p %s", p11, p11->name, p1);
#endif
- }
- } else {
- add_to_dedupe_hash (service, p1);
- dedupe_foreach ((gpointer)p1, service);
}
+ } else {
+ add_to_dedupe_hash (service, p1);
+ dedupe_foreach ((gpointer)p1, service);
}
}
diff --git a/components/services/install/lib/eazel-install-object.c b/components/services/install/lib/eazel-install-object.c
index 20f952fd0..2b823c38f 100644
--- a/components/services/install/lib/eazel-install-object.c
+++ b/components/services/install/lib/eazel-install-object.c
@@ -733,7 +733,7 @@ eazel_install_initialize (EazelInstall *service) {
service->private->ignore_file_conflicts = FALSE;
service->private->softcat = eazel_softcat_new ();
- eazel_softcat_set_packages_pr_query (service->private->softcat, 50);
+ eazel_softcat_set_packages_per_query (service->private->softcat, 50);
eazel_install_set_rpmrc_file (service, "/usr/lib/rpm/rpmrc");
diff --git a/components/services/install/lib/eazel-package-system-types.c b/components/services/install/lib/eazel-package-system-types.c
index fc6eb9246..759785935 100644
--- a/components/services/install/lib/eazel-package-system-types.c
+++ b/components/services/install/lib/eazel-package-system-types.c
@@ -54,7 +54,7 @@ static int category_allocs = 0;
static gboolean at_exit_registered = FALSE;
- static void
+static void
at_exit_package_data_info (void)
{
if (packages_allocated == NULL) {
diff --git a/components/services/install/lib/eazel-softcat-private.h b/components/services/install/lib/eazel-softcat-private.h
index e5972a042..5c596871e 100644
--- a/components/services/install/lib/eazel-softcat-private.h
+++ b/components/services/install/lib/eazel-softcat-private.h
@@ -45,7 +45,7 @@ struct _EazelSoftCatPrivate {
/* This is used to track the server update status */
char *db_revision;
- int packages_pr_query;
+ int packages_per_query;
};
#endif /* EAZEL_SOFTCAT_PRIVATE_H */
diff --git a/components/services/install/lib/eazel-softcat.c b/components/services/install/lib/eazel-softcat.c
index 43bb21dd4..1cdf2f677 100644
--- a/components/services/install/lib/eazel-softcat.c
+++ b/components/services/install/lib/eazel-softcat.c
@@ -131,7 +131,7 @@ eazel_softcat_initialize (EazelSoftCat *softcat)
softcat->private->retries = 3;
softcat->private->delay = 100;
softcat->private->db_revision = NULL;
- softcat->private->packages_pr_query = 1;
+ softcat->private->packages_per_query = 1;
}
GtkType
@@ -287,9 +287,9 @@ eazel_softcat_get_authn (const EazelSoftCat *softcat, const char **username)
}
void
-eazel_softcat_set_packages_pr_query (EazelSoftCat *softcat, int number)
+eazel_softcat_set_packages_per_query (EazelSoftCat *softcat, int number)
{
- softcat->private->packages_pr_query = number;
+ softcat->private->packages_per_query = number;
}
void
@@ -813,58 +813,57 @@ eazel_softcat_get_info (EazelSoftCat *softcat, PackageData *package, int sense_f
packages = g_list_prepend (packages, package);
err = eazel_softcat_query (softcat, packages, sense_flags, fill_flags, &result_packages);
+ g_list_free (packages);
if (err != EAZEL_SOFTCAT_SUCCESS) {
return err;
}
- g_list_free (packages);
- if (g_list_length (result_packages) > 1) {
- if (package->suite_id) {
- /* More than one package returned and we queried on a suite Id.
- Make deps and put into "package", remember to strip dirs in
- provides if needed */
- GList *iterator;
+ if (package->suite_id) {
+ /* More than one package returned and we queried on a suite Id.
+ Make deps and put into "package", remember to strip dirs in
+ provides if needed */
+ GList *iterator;
- trilobite_debug ("softcat query returned suite with %d elements",
- g_list_length (result_packages));
- for (iterator = result_packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = PACKAGEDATA (iterator->data);
- PackageDependency *dep = packagedependency_new ();
-
- if (fill_flags & PACKAGE_FILL_NO_DIRS_IN_PROVIDES) {
- remove_directories_from_provides_list (pack);
- }
- gtk_object_ref (GTK_OBJECT (pack));
- pack->fillflag = fill_flags;
-
- dep->package = pack;
- dep->version = g_strdup (pack->version);
-
- if (dep->version) {
- /* FIXME: should a suite be EQ or GE ? If GE, any newer version
- that's already installed will be ok, if EQ, the suites depends
- on an exact version */
- dep->sense = EAZEL_SOFTCAT_SENSE_GE;
- } else {
- dep->sense = EAZEL_SOFTCAT_SENSE_ANY;
- }
-
- packagedata_add_pack_to_depends (package, dep);
+ trilobite_debug ("softcat query returned suite with %d elements",
+ g_list_length (result_packages));
+ for (iterator = result_packages; iterator; iterator = g_list_next (iterator)) {
+ PackageData *pack = PACKAGEDATA (iterator->data);
+ PackageDependency *dep = packagedependency_new ();
+
+ if (fill_flags & PACKAGE_FILL_NO_DIRS_IN_PROVIDES) {
+ remove_directories_from_provides_list (pack);
}
- } else {
- g_warning ("softcat query returned %d results!", g_list_length (result_packages));
- err = EAZEL_SOFTCAT_ERROR_MULTIPLE_RESPONSES;
- g_list_foreach (result_packages, (GFunc)gtk_object_unref, NULL);
- g_list_free (result_packages);
- return err;
+ gtk_object_ref (GTK_OBJECT (pack));
+ pack->fillflag = fill_flags;
+
+ dep->package = pack;
+ dep->version = g_strdup (pack->version);
+
+ if (dep->version) {
+ /* FIXME: should a suite be EQ or GE ? If GE, any newer version
+ that's already installed will be ok, if EQ, the suites depends
+ on an exact version */
+ dep->sense = EAZEL_SOFTCAT_SENSE_GE;
+ } else {
+ dep->sense = EAZEL_SOFTCAT_SENSE_ANY;
+ }
+
+ packagedata_add_pack_to_depends (package, dep);
}
- } else {
+ } else if (g_list_length (packages) > 1) {
+ g_warning ("softcat query returned %d results!", g_list_length (result_packages));
+ err = EAZEL_SOFTCAT_ERROR_MULTIPLE_RESPONSES;
+ g_list_foreach (result_packages, (GFunc)gtk_object_unref, NULL);
+ g_list_free (result_packages);
+ return err;
+ } else { /* 1 package, not a suite */
full_package = PACKAGEDATA (result_packages->data);
packagedata_fill_in_missing (package, full_package, fill_flags);
if (fill_flags & PACKAGE_FILL_NO_DIRS_IN_PROVIDES) {
remove_directories_from_provides_list (package);
}
}
+
g_list_foreach (result_packages, (GFunc)gtk_object_unref, NULL);
g_list_free (result_packages);
return err;
@@ -1037,7 +1036,7 @@ eazel_softcat_get_info_plural_helper (EazelSoftCat *softcat,
packages with same query signature (id or name).
foreach L in massives {
- foreach subL in L (subL will be the "next" packages_pr_query elements in L) {
+ foreach subL in L (subL will be the "next" packages_per_query elements in L) {
(voodoo to maintain the lists)
do a get_info_plural_helper (L, out, error)
(voodoo to maintain the lists)
@@ -1049,7 +1048,7 @@ eazel_softcat_get_info_plural_helper (EazelSoftCat *softcat,
So basically this function will accept any weird combo of crackass
packages and try and make the minimal amount of queries (depending
- on packages_pr_query)
+ on packages_per_query)
*/
@@ -1076,8 +1075,8 @@ eazel_softcat_get_info_plural (EazelSoftCat *softcat,
while (massives && massive) {
int i;
- /* Only put softcat->private->packages_pr_query into one query */
- for (i = 0; i < softcat->private->packages_pr_query; i++) {
+ /* Only put softcat->private->packages_per_query into one query */
+ for (i = 0; i < softcat->private->packages_per_query; i++) {
gpointer p;
/* Move head to partial */
diff --git a/components/services/install/lib/eazel-softcat.h b/components/services/install/lib/eazel-softcat.h
index 685f42cbc..a4ea5babb 100644
--- a/components/services/install/lib/eazel-softcat.h
+++ b/components/services/install/lib/eazel-softcat.h
@@ -79,7 +79,7 @@ const char *eazel_softcat_get_cgi_path (const EazelSoftCat *softcat);
void eazel_softcat_set_authn (EazelSoftCat *softcat, gboolean use_authn, const char *username);
gboolean eazel_softcat_get_authn (const EazelSoftCat *softcat, const char **username);
-void eazel_softcat_set_packages_pr_query (EazelSoftCat *softcat, int number);
+void eazel_softcat_set_packages_per_query (EazelSoftCat *softcat, int number);
void eazel_softcat_set_authn_flag (EazelSoftCat *softcat, gboolean use_authn);
void eazel_softcat_set_username (EazelSoftCat *softcat, const char *username);
void eazel_softcat_set_retry (EazelSoftCat *softcat, unsigned int retries, unsigned int delay_us);
diff --git a/nautilus-installer/src/installer.c b/nautilus-installer/src/installer.c
index 98a467e70..4ddaecb80 100644
--- a/nautilus-installer/src/installer.c
+++ b/nautilus-installer/src/installer.c
@@ -969,13 +969,13 @@ report_unusual_errors (const PackageData *pack, EazelInstaller *installer)
resolved = TRUE;
} else if (pack->status == PACKAGE_ALREADY_INSTALLED) {
g_message ("already installed: %s", pack->name);
- /* FIXME: after 1.0, change "Nautilus" back to "%s" -> category->name */
/* FIXME: this string isn't marked translatable, because it was added extremely late,
* and the installer doesn't actually use translations in the current builds. (we have
* an XML-file-based scheme that isn't ready just yet.)
*/
- message = g_strdup_printf ("You've already got the most recent version of Nautilus, "
- "so there's nothing new to install.");
+ message = g_strdup_printf ("You've already got the most recent version of %s, "
+ "so there's nothing new to install.",
+ category->name);
installer->failure_info = g_list_prepend (installer->failure_info, message);
resolved = TRUE;
}