Fixed the loading of files provided by the rpm.

* components/rpmview/nautilus-rpm-view.c:
	(nautilus_rpm_view_update_from_uri):

	Fixed the loading of files provided by the rpm.

	* components/services/install/command-line/eazel-alt-install-corba.
	c: (tree_helper), (md5_check_failed):
	Clarified the debug output.

	* components/services/install/lib/Makefile.am:
	Removed the evil CFLAGS assignment that remove -Werror

	* components/services/install/lib/eazel-install-corba-callback.c:
	(impl_md5_check_failed), (impl_uninstall_failed),
	(eazel_install_callback_unref):
	Fixed some warnings.

	* components/services/install/lib/eazel-install-private.h:
	Moved the funky glist_step into -private.h
	Removed some rpm vars.

	* components/services/install/lib/eazel-install-object.c:
	(eazel_install_initialize),
	Removed some of the rpm variables in the private part.
	(eazel_install_emit_preflight_check_default),
	(eazel_install_emit_delete_files_default), (string_list_copy):
	Fixing warnings

	* components/services/install/lib/eazel-install-protocols.c:
	(gnome_vfs_fetch_remote_file), (eazel_install_fetch_package),
	(get_url_for_package):
	Fixing warnings. And made fetch_package be more generel, as
	opposed to having three different fetchers. So I've removed
	_which_provides and I need to remove _by_id.

	* components/services/install/lib/eazel-install-protocols.h:
	Removed fetch_which_provides.

	* components/services/install/lib/eazel-install-public.h:
	Moved the funky glist_step into -private.h

	* components/services/install/lib/eazel-install-rpm-glue.c:
	(eazel_install_pre_install_packages), (install_new_packages),
	(eazel_install_download_packages),
	(eazel_install_check_for_file_conflicts),
	(eazel_install_do_install_packages), (hest),
	(eazel_install_add_to_rpm_set),
	(eazel_install_requirement_dep_compare),
	(eazel_install_package_version_compare),
	(eazel_install_check_if_related_package),
	(eazel_install_fetch_rpm_dependencies),
	(eazel_install_fetch_dependencies),
	(eazel_install_do_rpm_dependency_check),
	(eazel_install_do_dependency_check), (eazel_install_ensure_deps),
	(eazel_uninstall_upward_traverse):
	Fixed most of bug 3373, completely revamped the dep checking. Now
	theres a packagesystem dependent depchecker and a seperate filedep
	check afterwards. The packagesystem dependent returns a list of
	package pairs <a,b>, where a requires b. fetch_dependencies then
	traverses that list, downloads and makes the nessecary checks. The
	makes fetch_dependencies package independent, and also fixes bug
	1698.
	Also various debug message fixing etc.

	* components/services/install/lib/eazel-install-rpm-signature.c:
	(read_rpm_signature), (trilobite_check_rpm_signature):
	Warning fixing.

	* components/services/install/lib/eazel-install-types.h:
	* components/services/install/lib/eazel-install-types.c:
	(packagedata_new), (packagedata_fill_from_rpm_header),
	(packagedata_fill_from_file), (packagedata_destroy),
	(packagerequirement_new):
	Added three new fields, eazel_id for the SoftCat id (as opposed to
	using the name field, the conflicts_checked boolean to prevent
	doing file conflict checking more then once and a boolean flag for
	tagging a package as being a source package.
	Also fixed 3344, the file list is now read correctly.
 	Created	the PacakgeRequirement structure, used for bug 3373.
	Fixed warnings.

	* components/services/install/lib/eazel-install-xml-package-list.c:
	(parse_package), (parse_category), (osd_parse_implementation),
	(osd_parse_softpkg):
	Fixed the uses of xml_get_value since I changed the semantics to
	be a "const char*" function.

	* components/services/install/server/main.c: (main):
	Print a string when terminating.

	* components/services/summary/lib/eazel-summary-shared.c:
	(parse_a_service), (parse_a_update_news_item):
	Fixed the uses of xml_get_value since I changed the semantics to
	be a "const char*" function.

	* components/services/trilobite/libtrilobite/helixcode-utils.h:
	* components/services/trilobite/libtrilobite/helixcode-utils.c:
	Changed xml_get_value to return const char* (bug 2448).
This commit is contained in:
Eskil Heyn Olsen 2000-10-03 03:51:49 +00:00
parent 99785dd779
commit b501e41501
21 changed files with 765 additions and 631 deletions

101
ChangeLog
View file

@ -1,3 +1,104 @@
2000-10-02 Eskil Heyn Olsen <eskil@eazel.com>
* components/rpmview/nautilus-rpm-view.c:
(nautilus_rpm_view_update_from_uri):
Fixed the loading of files provided by the rpm.
* components/services/install/command-line/eazel-alt-install-corba.
c: (tree_helper), (md5_check_failed):
Clarified the debug output.
* components/services/install/lib/Makefile.am:
Removed the evil CFLAGS assignment that remove -Werror
* components/services/install/lib/eazel-install-corba-callback.c:
(impl_md5_check_failed), (impl_uninstall_failed),
(eazel_install_callback_unref):
Fixed some warnings.
* components/services/install/lib/eazel-install-private.h:
Moved the funky glist_step into -private.h
Removed some rpm vars.
* components/services/install/lib/eazel-install-object.c:
(eazel_install_initialize),
Removed some of the rpm variables in the private part.
(eazel_install_emit_preflight_check_default),
(eazel_install_emit_delete_files_default), (string_list_copy):
Fixing warnings
* components/services/install/lib/eazel-install-protocols.c:
(gnome_vfs_fetch_remote_file), (eazel_install_fetch_package),
(get_url_for_package):
Fixing warnings. And made fetch_package be more generel, as
opposed to having three different fetchers. So I've removed
_which_provides and I need to remove _by_id.
* components/services/install/lib/eazel-install-protocols.h:
Removed fetch_which_provides.
* components/services/install/lib/eazel-install-public.h:
Moved the funky glist_step into -private.h
* components/services/install/lib/eazel-install-rpm-glue.c:
(eazel_install_pre_install_packages), (install_new_packages),
(eazel_install_download_packages),
(eazel_install_check_for_file_conflicts),
(eazel_install_do_install_packages), (hest),
(eazel_install_add_to_rpm_set),
(eazel_install_requirement_dep_compare),
(eazel_install_package_version_compare),
(eazel_install_check_if_related_package),
(eazel_install_fetch_rpm_dependencies),
(eazel_install_fetch_dependencies),
(eazel_install_do_rpm_dependency_check),
(eazel_install_do_dependency_check), (eazel_install_ensure_deps),
(eazel_uninstall_upward_traverse):
Fixed most of bug 3373, completely revamped the dep checking. Now
theres a packagesystem dependent depchecker and a seperate filedep
check afterwards. The packagesystem dependent returns a list of
package pairs <a,b>, where a requires b. fetch_dependencies then
traverses that list, downloads and makes the nessecary checks. The
makes fetch_dependencies package independent, and also fixes bug
1698.
Also various debug message fixing etc.
* components/services/install/lib/eazel-install-rpm-signature.c:
(read_rpm_signature), (trilobite_check_rpm_signature):
Warning fixing.
* components/services/install/lib/eazel-install-types.h:
* components/services/install/lib/eazel-install-types.c:
(packagedata_new), (packagedata_fill_from_rpm_header),
(packagedata_fill_from_file), (packagedata_destroy),
(packagerequirement_new):
Added three new fields, eazel_id for the SoftCat id (as opposed to
using the name field, the conflicts_checked boolean to prevent
doing file conflict checking more then once and a boolean flag for
tagging a package as being a source package.
Also fixed 3344, the file list is now read correctly.
Created the PacakgeRequirement structure, used for bug 3373.
Fixed warnings.
* components/services/install/lib/eazel-install-xml-package-list.c:
(parse_package), (parse_category), (osd_parse_implementation),
(osd_parse_softpkg):
Fixed the uses of xml_get_value since I changed the semantics to
be a "const char*" function.
* components/services/install/server/main.c: (main):
Print a string when terminating.
* components/services/summary/lib/eazel-summary-shared.c:
(parse_a_service), (parse_a_update_news_item):
Fixed the uses of xml_get_value since I changed the semantics to
be a "const char*" function.
* components/services/trilobite/libtrilobite/helixcode-utils.h:
* components/services/trilobite/libtrilobite/helixcode-utils.c:
Changed xml_get_value to return const char* (bug 2448).
2000-10-02 Darin Adler <darin@eazel.com>
More work on whittling the state machine down to size.

View file

@ -548,7 +548,9 @@ nautilus_rpm_view_update_from_uri (NautilusRPMView *rpm_view, const char *uri)
char *description;
char *default_icon_path;
char **path = NULL;
char **paths = NULL;
char **basenames = NULL;
int *pathindex;
char **links = NULL;
char *temp_version = NULL;
char *temp_release = NULL;
@ -573,6 +575,60 @@ nautilus_rpm_view_update_from_uri (NautilusRPMView *rpm_view, const char *uri)
return;
}
/* add the files in the package to the list */
gtk_clist_freeze (GTK_CLIST (rpm_view->details->package_file_list));
gtk_clist_clear (GTK_CLIST (rpm_view->details->package_file_list));
/* support the RPM 3.0 way and earlier way of accessing the files, depending on whether
RPMTAG_FILENAMES is defined or not */
#ifndef RPMTAG_FILENAMES
headerGetEntry(header_info, RPMTAG_BASENAMES, NULL, (void **)&basenames, &file_count);
headerGetEntry(header_info, RPMTAG_DIRINDEXES, NULL, (void **)&pathindex, NULL);
headerGetEntry(header_info, RPMTAG_DIRNAMES, NULL, (void **)&paths, NULL);
headerGetEntry(header_info, RPMTAG_FILELINKTOS, NULL, (void **)&links, NULL);
rpm_view->details->file_count = file_count;
for (index = 0; index < file_count; index++) {
if (*(links[index]) == '\0') {
g_snprintf(buffer, 511, "%s%s",
paths[pathindex[index]],
basenames[index]);
temp_str = buffer;
} else {
g_snprintf(buffer, 511, "%s%s -> %s",
paths[pathindex[index]],
basenames[index],
links[index]);
temp_str = buffer;
}
gtk_clist_append (GTK_CLIST(rpm_view->details->package_file_list), &temp_str);
}
#else
headerGetEntry(header_info, RPMTAG_FILENAMES, NULL, (void **)&basenames, &file_count);
headerGetEntry(header_info, RPMTAG_FILELINKTOS, NULL, (void **)&links, NULL);
rpm_view->details->file_count = file_count;
for (index = 0; index < file_count; index++) {
if (*(links[index]) == '\0') {
temp_str = basenames[index];
} else {
g_snprintf(buffer, 511, "%s -> %s", path[index], links[index]);
temp_str = buffer;
}
gtk_clist_append (GTK_CLIST(rpm_view->details->package_file_list), &temp_str);
}
#endif
temp_str = g_strdup_printf(_("Package Contents: %d files"), file_count);
gtk_clist_set_column_title (GTK_CLIST(rpm_view->details->package_file_list), 0, temp_str);
g_free(temp_str);
gtk_clist_thaw(GTK_CLIST(rpm_view->details->package_file_list));
iterator = headerInitIterator(header_info);
while (headerNextIterator(iterator, &iterator_tag, &type, (void**)&data_ptr, &data_size)) {
integer_ptr = (int*) data_ptr;
@ -683,54 +739,6 @@ nautilus_rpm_view_update_from_uri (NautilusRPMView *rpm_view, const char *uri)
gtk_widget_hide (rpm_view->details->package_uninstall_button);
gtk_widget_hide (rpm_view->details->package_verify_button);
}
/* add the files in the package to the list */
gtk_clist_freeze (GTK_CLIST (rpm_view->details->package_file_list));
gtk_clist_clear (GTK_CLIST (rpm_view->details->package_file_list));
/* support the RPM 3.0 way and earlier way of accessing the files, depending on whether
RPMTAG_FILENAMES is defined or not */
#ifndef RPMTAG_FILENAMES
headerGetEntry(header_info, RPMTAG_BASENAMES, NULL, (void **)&path, &file_count);
headerGetEntry(header_info, RPMTAG_FILELINKTOS, NULL, (void **)&links, NULL);
rpm_view->details->file_count = file_count;
for (index = 0; index < file_count; index++) {
if (*(links[index]) == '\0') {
temp_str = path[index];
} else {
g_snprintf(buffer, 511, "%s -> %s", path[index], links[index]);
temp_str = buffer;
}
gtk_clist_append (GTK_CLIST(rpm_view->details->package_file_list), &temp_str);
}
#else
headerGetEntry(header_info, RPMTAG_FILENAMES, NULL, (void **)&path, &file_count);
headerGetEntry(header_info, RPMTAG_FILELINKTOS, NULL, (void **)&links, NULL);
rpm_view->details->file_count = file_count;
for (index = 0; index < file_count; index++) {
if (*(links[index]) == '\0') {
temp_str = path[index];
} else {
g_snprintf(buffer, 511, "%s -> %s", path[index], links[index]);
temp_str = buffer;
}
gtk_clist_append (GTK_CLIST(rpm_view->details->package_file_list), &temp_str);
}
#endif
temp_str = g_strdup_printf(_("Package Contents: %d files"), file_count);
gtk_clist_set_column_title (GTK_CLIST(rpm_view->details->package_file_list), 0, temp_str);
g_free(temp_str);
g_free(path);
g_free(links);
gtk_clist_thaw(GTK_CLIST(rpm_view->details->package_file_list));
#ifdef EAZEL_SERVICES
/* NOTE: This adds a libeazelinstall packagedata object to the rpm_view */

View file

@ -322,10 +322,11 @@ tree_helper (EazelInstallCallback *service,
rpmfilename_from_packagedata (pd));
break;
default:
fprintf (stdout, "%s%s%s %s (status %d)\n",
fprintf (stdout, "%s%s%s-%s %s(status %d)\n",
indent, indent_type,
pd->name,
pd->status==PACKAGE_ALREADY_INSTALLED ? "already installed" : "",
pd->version,
pd->status==PACKAGE_ALREADY_INSTALLED ? "already installed " : "",
pd->status);
break;
}
@ -413,8 +414,8 @@ md5_check_failed (EazelInstallCallback *service,
gpointer unused)
{
fprintf (stdout, "Package %s failed md5 check!\n", package->name);
fprintf (stdout, "MD5 checksum is %s\n", package->md5);
fprintf (stdout, "should have been %s\n", actual_md5);
fprintf (stdout, "server MD5 checksum is %s\n", package->md5);
fprintf (stdout, "actual MD5 checksum is %s\n", actual_md5);
}
static PackageData*

View file

@ -5,8 +5,6 @@ CPPFLAGS = \
-DG_LOG_DOMAIN=\"eazel-install\" \
$(NULL)
CFLAGS=-g -O
INCLUDES = \
-I$(top_srcdir) \
-I$(top_builddir) \

View file

@ -169,7 +169,7 @@ impl_md5_check_failed (impl_POA_Trilobite_Eazel_InstallCallback *servant,
const CORBA_char *actual_md5,
CORBA_Environment * ev)
{
PackageData *pack, *needs;
PackageData *pack;
g_message ("impl_md5_check_failed (..., %s)", actual_md5);
pack = packagedata_from_corba_packagedatastruct (*corbapack);
gtk_signal_emit (GTK_OBJECT (servant->object), signals[MD5_CHECK_FAILED], pack, actual_md5);
@ -208,7 +208,7 @@ impl_uninstall_failed (impl_POA_Trilobite_Eazel_InstallCallback *servant,
CORBA_Environment * ev)
{
GList *categories;
PackageData *pack;
categories = parse_memory_xml_package_list ((char*)xmlcorbapack, strlen (xmlcorbapack));
if (categories==NULL) {
g_warning ("uninstall_failed called with error in xml.");
@ -306,15 +306,13 @@ eazel_install_callback_create_corba_object (BonoboObject *service) {
void
eazel_install_callback_unref (GtkObject *object)
{
EazelInstallCallback *service;
g_return_if_fail (object != NULL);
g_return_if_fail (EAZEL_INSTALL_CALLBACK (object));
bonobo_object_unref (BONOBO_OBJECT (object));
}
void
static void
eazel_install_callback_finalize (GtkObject *object)
{
EazelInstallCallback *service;

View file

@ -30,6 +30,10 @@
#include "eazel-install-query.h"
#include "eazel-install-xml-package-list.h"
#ifndef EAZEL_INSTALL_SLIM
#include <rpm/rpmmacro.h>
#endif
#ifndef EAZEL_INSTALL_NO_CORBA
#include <liboaf/liboaf.h>
#include <bonobo.h>
@ -544,10 +548,7 @@ eazel_install_initialize (EazelInstall *service) {
service->private->root_dirs = NULL;
service->private->cur_root = NULL;
service->private->transaction_dir = g_strdup_printf ("%s/.nautilus/transactions", g_get_home_dir() );
service->private->packsys.rpm.conflicts = NULL;
service->private->packsys.rpm.num_conflicts = 0;
service->private->packsys.rpm.dbs = g_hash_table_new (g_str_hash, g_str_equal);
service->private->packsys.rpm.set = NULL;
service->private->logfile = NULL;
service->private->logfilename = NULL;
service->private->name_to_package_hash = g_hash_table_new ((GHashFunc)g_str_hash,
@ -1065,7 +1066,8 @@ eazel_install_emit_preflight_check_default (EazelInstall *service,
CORBA_boolean result = FALSE;
CORBA_exception_init (&ev);
SANITY(service);
SANITY_VAL (service, FALSE);
if (service->callback != CORBA_OBJECT_NIL) {
CORBA_char *corbapackages;
corbapackages = xml_from_packagedata_list (packages);
@ -1244,8 +1246,9 @@ eazel_install_emit_delete_files_default (EazelInstall *service)
CORBA_Environment ev;
CORBA_boolean result = FALSE;
SANITY_VAL (service, TRUE);
CORBA_exception_init (&ev);
SANITY(service);
if (service->callback != CORBA_OBJECT_NIL) {
result = Trilobite_Eazel_InstallCallback_delete_files (service->callback, &ev);
}
@ -1282,8 +1285,9 @@ eazel_install_emit_done_default (EazelInstall *service, gboolean result)
/* Welcome to define madness. These are all the get/set methods. There is nothing of
interest beyond this point, except for a fucking big dragon*/
void string_list_copy (GList **in,
const GList *strings) {
static void
string_list_copy (GList **in,
const GList *strings) {
GList *iterator;
const GList *iterator_c;

View file

@ -26,6 +26,10 @@
#include "eazel-install-public.h"
/* Funky define to step a GList iterator one ahead */
#define glist_step(iterator) iterator = g_list_next (iterator)
struct _EazelInstallPrivate {
TransferOptions *topts;
InstallOptions *iopts;
@ -48,9 +52,6 @@ struct _EazelInstallPrivate {
union {
struct {
GHashTable *dbs;
rpmTransactionSet set;
struct rpmDependencyConflict *conflicts;
int num_conflicts;
unsigned long total_size,
current_installed_size,
num_packages,

View file

@ -40,10 +40,11 @@
#include <libgnomevfs/gnome-vfs.h>
#endif /* EAZEL_INSTALL_SLIM */
/* #define EAZEL_INSTALL_PROTOCOL_USE_OLD_CGI */
/* evil evil hack because RPM doesn't understand that a package for i386 is still okay to run on i686! */
#define ASSUME_ix86_IS_i386
typedef struct {
EazelInstall *service;
const char *file_to_report;
@ -326,12 +327,6 @@ gnome_vfs_xfer_callback (GnomeVFSXferProgressInfo *info,
return FALSE;
}
static void
free_string (char *str, gpointer unused) \
{
g_free (str);
}
gboolean
gnome_vfs_fetch_remote_file (EazelInstall *service,
char *url,
@ -342,9 +337,6 @@ gnome_vfs_fetch_remote_file (EazelInstall *service,
GnomeVFSXferOptions xfer_options = 0;
GnomeVFSURI *src_uri;
GnomeVFSURI *dest_uri;
GList *src_uri_list, *dest_uri_list;
char *tmp;
char *t_file;
gnome_vfs_callback_struct *cbstruct;
@ -382,6 +374,9 @@ gnome_vfs_fetch_remote_file (EazelInstall *service,
trilobite_debug ("File download successfull");
} else {
trilobite_debug ("File download failed");
if (result == GNOME_VFS_ERROR_BAD_PARAMETERS) {
trilobite_debug ("gnome_vfs_xfer_uri returned BAD_PARAMETERS");
}
}
/* Free the various stuff */
@ -419,7 +414,7 @@ local_fetch_remote_file (EazelInstall *service,
return result;
}
eazel_install_file_fetch_function*
static eazel_install_file_fetch_function*
eazel_install_fill_file_fetch_table (void)
{
eazel_install_file_fetch_function *res;
@ -528,6 +523,14 @@ eazel_install_fetch_package (EazelInstall *service,
{
if (package->remote_url) {
url = g_strdup (package->remote_url);
} else if (package->eazel_id) {
url = get_url_for_package (service, RPMSEARCH_ENTRY_ID,
package->eazel_id,
package);
} else if (g_list_length (package->provides)==1) {
url = get_url_for_package (service, RPMSEARCH_ENTRY_PROVIDES,
package->provides->data,
package);
} else {
url = get_url_for_package (service, RPMSEARCH_ENTRY_NAME, package, package);
}
@ -567,55 +570,6 @@ eazel_install_fetch_package (EazelInstall *service,
return result;
}
gboolean eazel_install_fetch_package_which_provides (EazelInstall *service,
const char *file,
PackageData *package)
{
gboolean result;
char *url;
char *targetname;
g_assert (package != NULL);
result = FALSE;
switch (eazel_install_get_protocol (service)) {
case PROTOCOL_FTP:
case PROTOCOL_HTTP:
{
url = get_url_for_package (service, RPMSEARCH_ENTRY_PROVIDES, (const gpointer)file, package);
}
break;
case PROTOCOL_LOCAL:
g_warning (_("Using local protocol cannot resolve library dependencies"));
url = NULL;
break;
};
if (url == NULL) {
g_warning (_("Could not get a URL for %s"), file);
} else {
/* FIXME bugzilla.eazel.com 1315:
Loose the check once a proper rpmsearch.cgi is up and running */
if (filename_from_url (url) && strlen (filename_from_url (url))>1) {
targetname = g_strdup_printf ("%s/%s",
eazel_install_get_tmp_dir (service),
filename_from_url (url));
result = eazel_install_fetch_file (service, url, NULL, targetname);
if (result) {
packagedata_fill_from_file (package, targetname);
} else {
package->status = PACKAGE_DEPENDENCY_FAIL;
g_warning (_("File download failed"));
}
g_free (targetname);
}
g_free (url);
}
return result;
}
gboolean eazel_install_fetch_package_by_id (EazelInstall *service,
const char *id,
PackageData *package)
@ -742,6 +696,7 @@ get_url_for_package (EazelInstall *service,
g_list_free (packages);
}
#else /* EAZEL_INSTALL_PROTOCOL_USE_OLD_CGI */
trilobite_debug ("using old cgi");
if (body) {
/* body is already null-terminated, luckily */
url = g_strdup (body);
@ -753,14 +708,17 @@ get_url_for_package (EazelInstall *service,
case RPMSEARCH_ENTRY_NAME:
g_warning (_("Could not retrieve a URL for %s"),
rpmfilename_from_packagedata ((PackageData*)data));
trilobite_debug ("entry type was NAME");
break;
case RPMSEARCH_ENTRY_PROVIDES:
g_warning (_("Could not retrieve a URL for %s"),
(char*)data);
trilobite_debug ("entry type was PROVIDES");
break;
case RPMSEARCH_ENTRY_ID:
g_warning (_("Could not retrieve a URL for id %s"),
(char *)data);
trilobite_debug ("entry type was ID");
break;
}
}

View file

@ -39,10 +39,6 @@ gboolean eazel_install_fetch_file (EazelInstall *service,
gboolean eazel_install_fetch_package (EazelInstall *service,
PackageData *package);
gboolean eazel_install_fetch_package_which_provides (EazelInstall *service,
const char *file,
PackageData *package);
gboolean eazel_install_fetch_package_by_id (EazelInstall *service,
const char *id,
PackageData *package);

View file

@ -48,9 +48,6 @@ extern "C" {
#define IS_EAZEL_INSTALL(obj) (GTK_CHECK_TYPE ((obj), TYPE_EAZEL_INSTALL))
#define IS_EAZEL_INSTALL_CLASS(klass)(GTK_CHECK_CLASS_TYPE ((klass), TYPE_EAZEL_INSTALL))
/* Funky define to step a GList iterator one ahead */
#define glist_step(iterator) iterator = g_list_next (iterator)
typedef enum {
EAZEL_INSTALL_USE_RPM
} PackageSystem;;

File diff suppressed because it is too large Load diff

View file

@ -32,9 +32,10 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <glib.h>
#include <netinet/in.h>
#include <libtrilobite/trilobite-core-utils.h>
#include "eazel-install-rpm-signature.h"
/* some older versions of librpm are COMPLETELY INCOMPATIBLE with newer versions,
* even though they have the same library version number!
* so, parsing the RPM file headers must be done by hand. :( :( :(
@ -103,7 +104,7 @@ read_rpm_lead (int fd)
/* returns -1 if there is no GPG signature, 0 on success */
/* on success, you must g_free the signature when done */
static int
read_rpm_signature (int fd, void **signature, int *signature_len)
read_rpm_signature (int fd, char **signature, int *signature_len)
{
RPMHeader header;
RPMEntry *entry = NULL;
@ -241,7 +242,7 @@ trilobite_check_rpm_signature (const char *filename, const char *keyring_filenam
int stdin_fd, stdout_fd, stderr_fd;
char *temp_filename;
char *p;
void *signature = NULL;
char *signature = NULL;
int err;
int i;
int status;

View file

@ -120,12 +120,14 @@ packagedata_new ()
pack->version = NULL;
pack->minor = NULL;
pack->archtype = NULL;
pack->source_package = FALSE;
pack->description = NULL;
pack->bytesize = 0;
pack->distribution = trilobite_get_distribution ();
pack->filename = NULL;
pack->eazel_id = NULL;
pack->remote_url = NULL;
pack->conflicts_checked = FALSE;
pack->install_root = NULL;
pack->provides = NULL;
pack->soft_depends = NULL;
@ -194,38 +196,47 @@ packagedata_fill_from_rpm_header (PackageData *pack,
headerGetEntry (*hd,
RPMTAG_NAME, NULL,
(void **) &tmp, NULL);
g_free (pack->name);
pack->name = g_strdup (tmp);
headerGetEntry (*hd,
RPMTAG_VERSION, NULL,
(void **) &tmp, NULL);
g_free (pack->version);
pack->version = g_strdup (tmp);
headerGetEntry (*hd,
RPMTAG_RELEASE, NULL,
(void **) &tmp, NULL);
g_free (pack->minor);
pack->minor = g_strdup (tmp);
headerGetEntry (*hd,
RPMTAG_ARCH, NULL,
(void **) &tmp, NULL);
g_free (pack->archtype);
pack->archtype = g_strdup (tmp);
headerGetEntry (*hd,
RPMTAG_SIZE, NULL,
(void **) &sizep, NULL);
(void **) &sizep, NULL);
pack->bytesize = *sizep;
headerGetEntry (*hd,
RPMTAG_DESCRIPTION, NULL,
(void **) &tmp, NULL);
g_free (pack->description);
pack->description = g_strdup (tmp);
pack->packsys_struc = (gpointer)hd;
g_list_foreach (pack->provides, (GFunc)g_free, NULL);
g_list_free (pack->provides);
{
char **paths = NULL;
char **names = NULL;
int *indexes;
int count;
int index;
@ -233,22 +244,25 @@ packagedata_fill_from_rpm_header (PackageData *pack,
Lets see if RPMTAG_PROVIDES works for the older ones */
#ifdef RPMTAG_BASENAMES
headerGetEntry (*hd,
RPMTAG_BASENAMES, NULL,
(void**)&names, &count);
RPMTAG_DIRINDEXES, NULL,
(void**)&indexes, NULL);
headerGetEntry (*hd,
RPMTAG_DIRNAMES, NULL,
(void**)&paths, &count);
(void**)&paths, NULL);
headerGetEntry (*hd,
RPMTAG_BASENAMES, NULL,
(void**)&names, &count);
#else /* RPMTAG_BASENAMES */
/* This will most like make eazel_install_chekc_for_file_conflicts break... */
headerGetEntry (*hd,
RPMTAG_FILENAMES, NULL,
(void**)&names, &count);
#endif /* RPMTAG_BASENAMES */
for (index=0; index<count; index++) {
char *fullname;
if (paths) {
fullname = g_strdup_printf ("%s%s", paths[index], names[index]);
fullname = g_strdup_printf ("%s%s", paths[indexes[index]], names[index]);
} else {
fullname = g_strdup (names[index]);
}
@ -272,25 +286,41 @@ packagedata_new_from_file (const char *file)
/* FIXME bugzilla.eazel.com 1532:
RPM specific code */
void
gboolean
packagedata_fill_from_file (PackageData *pack, const char *filename)
{
static FD_t fd;
Header *hd;
/* Already loaded a packsys struc ? */
if (pack->packsys_struc) {
return TRUE;
}
/* Open rpm */
fd = fdOpen (filename, O_RDONLY, 0);
if (fd == NULL) {
g_warning (_("Cannot open %s"), filename);
pack->status = PACKAGE_CANNOT_OPEN;
return FALSE;
}
/* Get Header block */
hd = g_new0 (Header, 1);
rpmReadPackageHeader (fd, hd, NULL, NULL, NULL);
rpmReadPackageHeader (fd, hd, &pack->source_package, NULL, NULL);
packagedata_fill_from_rpm_header (pack, hd);
/* Set filename field */
if (pack->filename != filename) {
g_free (pack->filename);
pack->filename = g_strdup (filename);
}
pack->status = PACKAGE_UNKNOWN_STATUS;
fdClose (fd);
return TRUE;
}
void
@ -317,6 +347,8 @@ packagedata_destroy (PackageData *pack, gboolean deep)
pack->bytesize = 0;
g_free (pack->filename);
pack->filename = NULL;
g_free (pack->eazel_id);
pack->eazel_id = NULL;
g_free (pack->remote_url);
pack->remote_url = NULL;
g_free (pack->install_root);
@ -538,6 +570,17 @@ packagedata_modstatus_str_to_enum (const char *st)
return result;
}
PackageRequirement*
packagerequirement_new (PackageData *pack,
PackageData *req)
{
PackageRequirement *result;
result = g_new0 (PackageRequirement, 1);
result->package = pack;
result->required = req;
return result;
}
/* The evil marshal func */
typedef void (*GtkSignal_NONE__POINTER_INT_INT_INT_INT_INT_INT) (GtkObject * object,

View file

@ -137,7 +137,7 @@ struct _CategoryData {
GList* packages;
GList* depends; /* used only for the GUI: GList<char *> -- other category names */
};
CategoryData *categorydata_new ();
CategoryData *categorydata_new (void);
void categorydata_destroy_foreach (CategoryData *cd, gpointer ununsed);
void categorydata_destroy (CategoryData *pd);
@ -158,6 +158,12 @@ struct _PackageData {
char *md5;
char *install_root;
char *eazel_id;
gboolean source_package;
gboolean conflicts_checked; /* set to TRUE when the files provided by the package
have been checked against already installed packages */
/*
toplevel = TRUE if this a package the user requested.
It's used to ensure that a "install_failed" signal is
@ -197,7 +203,7 @@ PackageData* packagedata_new_from_rpm_header (Header*);
PackageData* packagedata_new_from_rpm_conflict (struct rpmDependencyConflict);
PackageData* packagedata_new_from_rpm_conflict_reversed (struct rpmDependencyConflict);
void packagedata_fill_from_file (PackageData *pack, const char *filename);
gboolean packagedata_fill_from_file (PackageData *pack, const char *filename);
void packagedata_fill_from_rpm_header (PackageData *pack, Header*);
void packagedata_remove_soft_dep (PackageData *remove, PackageData *from);
@ -213,6 +219,13 @@ void packagedata_add_pack_to_breaks (PackageData *pack, PackageData *b);
void packagedata_add_pack_to_soft_deps (PackageData *pack, PackageData *b);
void packagedata_add_pack_to_hard_deps (PackageData *pack, PackageData *b);
typedef struct {
PackageData *package;
PackageData *required;
} PackageRequirement;
PackageRequirement* packagerequirement_new (PackageData *pack, PackageData *req);
/* Evil marshal func */
void eazel_install_gtk_marshal_NONE__POINTER_INT_INT_INT_INT_INT_INT (GtkObject * object,

View file

@ -45,7 +45,7 @@ parse_package (xmlNode* package, gboolean set_toplevel) {
xmlNodePtr dep;
PackageData* rv;
char *temp;
const char *temp;
rv = packagedata_new ();
@ -122,7 +122,7 @@ parse_category (xmlNode* cat) {
char *text;
category = categorydata_new ();
category->name = xml_get_value (cat, "name");
category->name = g_strdup (xml_get_value (cat, "name"));
pkg = cat->childs;
if (pkg == NULL) {
@ -579,28 +579,26 @@ osd_parse_implementation (PackageData *pack,
xmlNodePtr node)
{
xmlNodePtr child;
char *temp;
child = node->childs;
while (child) {
if (g_strcasecmp (child->name, "PROCESSOR")==0) {
pack->archtype = xml_get_value (child, "VALUE");
pack->archtype = g_strdup (xml_get_value (child, "VALUE"));
} else if (g_strcasecmp (child->name, "OS")==0) {
char *dtmp = xmlGetProp (child, "VALUE");
if (dtmp) {
pack->distribution.name = trilobite_get_distribution_enum (dtmp,
TRUE);
}
g_free (dtmp);
} else if (g_strcasecmp (child->name, "CODEBASE")==0) {
pack->remote_url = xml_get_value (child, "HREF");
const char *temp;
pack->remote_url = g_strdup (xml_get_value (child, "HREF"));
temp = xml_get_value (child, "SIZE");
if (temp) {
pack->bytesize = atoi (temp);
} else {
pack->bytesize = 0;
}
g_free (temp);
} else if (g_strcasecmp (child->name, "DEPENDENCY")==0) {
/* presume this is a soft-depends */
osd_parse_dependency (pack, child);
@ -622,9 +620,9 @@ osd_parse_softpkg (xmlNodePtr softpkg)
result = packagedata_new ();
result->name = xml_get_value (softpkg, "NAME");
result->version = xml_get_value (softpkg, "VERSION");
result->md5 = xml_get_value (softpkg, "MD5");
result->name = g_strdup (xml_get_value (softpkg, "NAME"));
result->version = g_strdup (xml_get_value (softpkg, "VERSION"));
result->md5 = g_strdup (xml_get_value (softpkg, "MD5"));
child = softpkg->childs;
while (child) {

View file

@ -152,6 +152,8 @@ int main(int argc, char *argv[]) {
bonobo_main ();
} while (trilobites_active > 0);
g_message ("EazelInstall service terminating");
CORBA_exception_free (&ev);
return 0;

View file

@ -120,11 +120,11 @@ parse_a_service (xmlNodePtr node)
return_value->name = g_strdup (xml_get_value (node, "NAME"));
return_value->icon = g_strdup (xml_get_value (node, "ICON"));
return_value->button_label = (xml_get_value (node, "BUTTON_LABEL"));
return_value->uri = (xml_get_value (node, "URI"));
return_value->description_header = (xml_get_value (node, "DESCRIPTION_HEADER"));
return_value->description = (xml_get_value (node, "DESCRIPTION"));
tempbuf = (xml_get_value (node, "ENABLED"));
return_value->button_label = g_strdup (xml_get_value (node, "BUTTON_LABEL"));
return_value->uri = g_strdup (xml_get_value (node, "URI"));
return_value->description_header = g_strdup (xml_get_value (node, "DESCRIPTION_HEADER"));
return_value->description = g_strdup (xml_get_value (node, "DESCRIPTION"));
tempbuf = g_strdup (xml_get_value (node, "ENABLED"));
if (tempbuf[0] == 'T' || tempbuf[0] == 't') {
return_value->enabled = TRUE;
}
@ -161,12 +161,12 @@ parse_a_update_news_item (xmlNodePtr node)
return_value = update_news_data_new ();
return_value->name = g_strdup (xml_get_value (node, "NAME"));
return_value->version = (xml_get_value (node, "VERSION"));
return_value->version = g_strdup (xml_get_value (node, "VERSION"));
return_value->priority = g_strdup (xml_get_value (node, "PRIORITY"));
return_value->description = g_strdup (xml_get_value (node, "DESCRIPTION"));
return_value->icon = g_strdup (xml_get_value (node, "ICON"));
return_value->button_label = g_strdup (xml_get_value (node, "BUTTON_LABEL"));
return_value->uri = (xml_get_value (node, "URI"));
return_value->uri = g_strdup (xml_get_value (node, "URI"));
return return_value;

View file

@ -120,11 +120,11 @@ parse_a_service (xmlNodePtr node)
return_value->name = g_strdup (xml_get_value (node, "NAME"));
return_value->icon = g_strdup (xml_get_value (node, "ICON"));
return_value->button_label = (xml_get_value (node, "BUTTON_LABEL"));
return_value->uri = (xml_get_value (node, "URI"));
return_value->description_header = (xml_get_value (node, "DESCRIPTION_HEADER"));
return_value->description = (xml_get_value (node, "DESCRIPTION"));
tempbuf = (xml_get_value (node, "ENABLED"));
return_value->button_label = g_strdup (xml_get_value (node, "BUTTON_LABEL"));
return_value->uri = g_strdup (xml_get_value (node, "URI"));
return_value->description_header = g_strdup (xml_get_value (node, "DESCRIPTION_HEADER"));
return_value->description = g_strdup (xml_get_value (node, "DESCRIPTION"));
tempbuf = g_strdup (xml_get_value (node, "ENABLED"));
if (tempbuf[0] == 'T' || tempbuf[0] == 't') {
return_value->enabled = TRUE;
}
@ -161,12 +161,12 @@ parse_a_update_news_item (xmlNodePtr node)
return_value = update_news_data_new ();
return_value->name = g_strdup (xml_get_value (node, "NAME"));
return_value->version = (xml_get_value (node, "VERSION"));
return_value->version = g_strdup (xml_get_value (node, "VERSION"));
return_value->priority = g_strdup (xml_get_value (node, "PRIORITY"));
return_value->description = g_strdup (xml_get_value (node, "DESCRIPTION"));
return_value->icon = g_strdup (xml_get_value (node, "ICON"));
return_value->button_label = g_strdup (xml_get_value (node, "BUTTON_LABEL"));
return_value->uri = (xml_get_value (node, "URI"));
return_value->uri = g_strdup (xml_get_value (node, "URI"));
return return_value;

View file

@ -34,7 +34,7 @@
Change this into a const char * function, and modify all uses of
it to g_strdup / peek */
char*
const char*
xml_get_value (xmlNode* node, const char* name)
{
char* ret;

View file

@ -35,7 +35,7 @@
#include <gnome-xml/tree.h>
#include <gnome-xml/parser.h>
char* xml_get_value (xmlNode* node, const char* name);
const char* xml_get_value (xmlNode* node, const char* name);
gboolean check_for_root_user (void);
gboolean check_for_redhat (void);

View file

@ -62,24 +62,24 @@ host_triplet = i686-pc-linux-gnu
AMMONITE_CFLAGS = -I/gnome/include
AMMONITE_LIBS = -L/gnome/lib -lammonite -lammonite-gtk
AS = @AS@
BONOBOX_CFLAGS = -I/gnome/include -DNEED_GNOMESUPPORT_H -I/gnome/lib/gnome-libs/include -I/gnome/include/gtk-1.2 -I/gnome/include/glib-1.2 -I/gnome/lib/glib/include -I/usr/X11R6/include -I/gnome/include/gnome-xml
BONOBOX_CFLAGS = -I/gnome/include -DNEED_GNOMESUPPORT_H -I/gnome/lib/gnome-libs/include -I/gnome/lib/glib/include -I/usr/X11R6/include -I/gnome/include/gnome-xml
BONOBOX_LIBS = -rdynamic -L/gnome/lib -L/usr/X11R6/lib -L/usr/lib -lbonobo -lgnomeui -lart_lgpl -lgdk_imlib -lSM -lICE -lgnome -lgnomesupport -lesd -laudiofile -ldb1 -lgdk_pixbuf -ltiff -ljpeg -lpng -lz -lgtk -lgdk -lgmodule -ldl -lXext -lX11 -loaf -lORBitCosNaming -lORBit -lIIOP -lORBitutil -lglib -lnsl -lm -lbonobox
BONOBO_CFLAGS = -I/gnome/include -DNEED_GNOMESUPPORT_H -I/gnome/lib/gnome-libs/include -I/gnome/include/gtk-1.2 -I/gnome/include/glib-1.2 -I/gnome/lib/glib/include -I/usr/X11R6/include -I/gnome/include/gnome-xml
BONOBO_CFLAGS = -I/gnome/include -DNEED_GNOMESUPPORT_H -I/gnome/lib/gnome-libs/include -I/gnome/lib/glib/include -I/usr/X11R6/include -I/gnome/include/gnome-xml
BONOBO_LIBS = -rdynamic -L/gnome/lib -L/usr/X11R6/lib -L/usr/lib -lbonobo -lgnomeui -lart_lgpl -lgdk_imlib -lSM -lICE -lgnome -lgnomesupport -lesd -laudiofile -ldb1 -lgdk_pixbuf -ltiff -ljpeg -lpng -lz -lgtk -lgdk -lgmodule -ldl -lXext -lX11 -loaf -lORBitCosNaming -lORBit -lIIOP -lORBitutil -lglib -lnsl -lm
BONOBO_PRINT_CFLAGS =
BONOBO_PRINT_LIBS =
CATALOGS = da.gmo de.gmo fr.gmo ga.gmo gl.gmo it.gmo ja.gmo ko.gmo no.gmo pt_BR.gmo ru.gmo sv.gmo tr.gmo uk.gmo zh_TW.Big5.gmo
CATALOGS = ca.gmo da.gmo de.gmo fr.gmo ga.gmo gl.gmo it.gmo ja.gmo ko.gmo no.gmo pt_BR.gmo ru.gmo sv.gmo tr.gmo uk.gmo zh_TW.Big5.gmo
CATOBJEXT = .gmo
CC = gcc
CPP = gcc -E
CXX = c++
CC = /usr/bin/gcc
CPP = /usr/bin/gcc -E
CXX = /usr/bin/g++
DATADIRNAME = share
DLLTOOL = @DLLTOOL@
EAZEL_SERVICES = 1
GCONF_CFLAGS = -I/gnome/include/gconf/1 -I/gnome/include -I/gnome/include/glib-1.2 -I/gnome/lib/glib/include -I/gnome/include/gtk-1.2 -I/usr/X11R6/include
GCONF_CFLAGS = -I/gnome/include/gconf/1 -I/gnome/include -I/gnome/include/glib-1.2 -I/gnome/lib/glib/include -I/usr/X11R6/include
GCONF_CONFIG = /gnome/bin/gconf-config
GCONF_LIBS = -rdynamic -L/gnome/lib -L/usr/X11R6/lib -lgconf-gtk-1 -lgconf-1 -loaf -lORBitCosNaming -lORBit -lIIOP -lORBitutil -lnsl -lgtk -lgdk -lgmodule -lglib -ldl -lXext -lX11 -lm
GDK_PIXBUF_CFLAGS = -I/gnome/include -I/gnome/include/gtk-1.2 -I/gnome/include/glib-1.2 -I/gnome/lib/glib/include -I/usr/X11R6/include
GDK_PIXBUF_CFLAGS = -I/gnome/include -I/gnome/include/gtk-1.2 -I/gnome/lib/glib/include -I/gnome/include -I/usr/X11R6/include
GDK_PIXBUF_CONFIG = /gnome/bin/gdk-pixbuf-config
GDK_PIXBUF_LIBS = -L/gnome/lib -lgdk_pixbuf -L/gnome/lib -L/usr/X11R6/lib -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl -lXext -lX11 -lm
GENCAT =
@ -89,18 +89,18 @@ GHTTP_LIBS = -L/gnome/lib -lghttp
GLIB_CFLAGS = -I/gnome/include/glib-1.2 -I/gnome/lib/glib/include
GLIB_CONFIG = /gnome/bin/glib-config
GLIB_LIBS = -L/gnome/lib -lglib
GMOFILES = da.gmo de.gmo fr.gmo ga.gmo gl.gmo it.gmo ja.gmo ko.gmo no.gmo pt_BR.gmo ru.gmo sv.gmo tr.gmo uk.gmo zh_TW.Big5.gmo
GMOFILES = ca.gmo da.gmo de.gmo fr.gmo ga.gmo gl.gmo it.gmo ja.gmo ko.gmo no.gmo pt_BR.gmo ru.gmo sv.gmo tr.gmo uk.gmo zh_TW.Big5.gmo
GMSGFMT = /usr/bin/msgfmt
GNOMECANVASPIXBUF_INCLUDEDIR =
GNOMECANVASPIXBUF_LIBS = -rdynamic -L/gnome/lib -L/usr/X11R6/lib -lgdk_pixbuf -ltiff -ljpeg -lpng -lz -lgtk -lgdk -lgmodule -lglib -ldl -lXext -lX11 -lm -lgnomecanvaspixbuf
GNOMEUI_CFLAGS = -I/gnome/include -DNEED_GNOMESUPPORT_H -I/gnome/lib/gnome-libs/include -I/gnome/include/gtk-1.2 -I/gnome/include/glib-1.2 -I/gnome/lib/glib/include -I/usr/X11R6/include
GNOMEUI_CFLAGS = -I/gnome/include -DNEED_GNOMESUPPORT_H -I/gnome/lib/gnome-libs/include -I/gnome/include/gtk-1.2 -I/gnome/lib/glib/include -I/usr/X11R6/include
GNOMEUI_LIBS = -rdynamic -L/gnome/lib -L/usr/X11R6/lib -L/usr/lib -lgnomeui -lart_lgpl -lgdk_imlib -lSM -lICE -lgtk -lgdk -lgmodule -lXext -lX11 -lgnome -lgnomesupport -lesd -laudiofile -lm -ldb1 -lglib -ldl
GNOME_CFLAGS = -I/gnome/include -DNEED_GNOMESUPPORT_H -I/gnome/lib/gnome-libs/include -I/gnome/include/gtk-1.2 -I/gnome/include/glib-1.2 -I/gnome/lib/glib/include -I/usr/X11R6/include
GNOME_CFLAGS = -I/gnome/include -DNEED_GNOMESUPPORT_H -I/gnome/lib/gnome-libs/include -I/gnome/include/gtk-1.2 -I/gnome/lib/glib/include -I/usr/X11R6/include
GNOME_CONFIG = /gnome/bin/gnome-config
GNOME_LIBS = -L/gnome/lib -L/usr/lib -lgnome -lgnomesupport -lesd -laudiofile -lm -ldb1 -lglib -ldl
GNORBA_CFLAGS =
GNORBA_LIBS =
GTK_CFLAGS = -I/gnome/include/gtk-1.2 -I/gnome/include/glib-1.2 -I/gnome/lib/glib/include -I/usr/X11R6/include
GTK_CFLAGS = -I/gnome/include/gtk-1.2 -I/gnome/lib/glib/include -I/gnome/include -I/usr/X11R6/include
GTK_CONFIG = /gnome/bin/gtk-config
GTK_LIBS = -L/gnome/lib -L/usr/X11R6/lib -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl -lXext -lX11 -lm
GT_NO =
@ -121,6 +121,7 @@ MEDUSA_CFLAGS = -I/gnome/include -I/gnome/lib/vfs/include -I/gnome/include/glib-
MEDUSA_LIBS = -rdynamic -L/gnome/lib -lmedusa -lgnomevfs -lgmodule -lgthread -lglib -lpthread -ldl
MKINSTALLDIRS = ./mkinstalldirs
MOZILLA_COMPONENT_CFLAGS = -I/usr/include/mozilla
MOZILLA_COMPONENT_DEBUG_FLAGS =
MOZILLA_COMPONENT_LDFLAGS = -L/usr/lib/mozilla
MOZILLA_COMPONENT_LIBS = -lgtkembedmoz -lgtksuperwin -lxpcom -lnspr4 -lplc4 -lplds4
MOZILLA_EAZEL_PROTOCOL_HANDLER_LIBS =
@ -136,7 +137,7 @@ ORBIT_IDL = /gnome/bin/orbit-idl
ORBIT_LIBS = -L/gnome/lib -lORBit -lIIOP -lORBitutil -lglib -lnsl -lm
PACKAGE = nautilus
PAM_LIBS = -ldl -lpam -lpam_misc
POFILES = da.po de.po fr.po ga.po gl.po it.po ja.po ko.po no.po pt_BR.po ru.po sv.po tr.po uk.po zh_TW.Big5.po
POFILES = ca.po da.po de.po fr.po ga.po gl.po it.po ja.po ko.po no.po pt_BR.po ru.po sv.po tr.po uk.po zh_TW.Big5.po
POSUB = po
RANLIB = ranlib
RPM_LIBS = -lrpm -lz -lbz2 -lpopt -ldb