summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEskil Heyn Olsen <eskil@src.gnome.org>2000-08-07 23:30:15 +0000
committerEskil Heyn Olsen <eskil@src.gnome.org>2000-08-07 23:30:15 +0000
commitf30421e0680a1b37618b8e46d369659d3cd5568f (patch)
tree51a4035df776258f1b5ddc31cdc22cdcc3c606f7
parent091d96bb1c61fe168838c677b93e0bcf89e361f7 (diff)
downloadnautilus-f30421e0680a1b37618b8e46d369659d3cd5568f.tar.gz
The cli tool can now read from a local xml file and if the rpm's are
* components/services/install/command-line/eazel-alt-install-corba.c: (set_parameters_from_command_line): * components/services/install/idl/trilobite-eazel-install.idl: * components/services/install/lib/eazel-install-corba-types.c: (corba_category_list_from_categorydata_list): * components/services/install/lib/eazel-install-corba.c: (impl_Eazel_Install__set_package_list), (impl_Eazel_Install__get_package_list), (eazel_install_get_epv): * components/services/install/lib/eazel-install-protocols.c: (filename_from_url): * components/services/install/lib/eazel-install-rpm-glue.c: (eazel_install_do_rpm_transaction_process_pipe), (do_rpm_transaction): The cli tool can now read from a local xml file and if the rpm's are present (this depends on all fields in the xml being filled) it will use those. * components/services/install/lib/eazel-install-xml-package-list.c: (generate_xml_package_list): * nautilus-installer/src/installer.c: (installer): * nautilus-installer/src/main.c: Some patches for reading local files (bug#2021)
-rw-r--r--ChangeLog25
-rw-r--r--components/services/install/command-line/eazel-alt-install-corba.c26
-rw-r--r--components/services/install/idl/trilobite-eazel-install.idl2
-rw-r--r--components/services/install/lib/eazel-install-corba-types.c2
-rw-r--r--components/services/install/lib/eazel-install-corba.c20
-rw-r--r--components/services/install/lib/eazel-install-protocols.c6
-rw-r--r--components/services/install/lib/eazel-install-rpm-glue.c10
-rw-r--r--components/services/install/lib/eazel-install-xml-package-list.c10
-rw-r--r--nautilus-installer/src/installer.c12
-rw-r--r--nautilus-installer/src/main.c2
10 files changed, 81 insertions, 34 deletions
diff --git a/ChangeLog b/ChangeLog
index 046ae8fc9..d7a6a7d0d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2000-08-07 Eskil Heyn Olsen <eskil@eazel.com>
+
+ * components/services/install/command-line/eazel-alt-install-corba.c:
+ (set_parameters_from_command_line):
+ * components/services/install/idl/trilobite-eazel-install.idl:
+ * components/services/install/lib/eazel-install-corba-types.c:
+ (corba_category_list_from_categorydata_list):
+ * components/services/install/lib/eazel-install-corba.c:
+ (impl_Eazel_Install__set_package_list),
+ (impl_Eazel_Install__get_package_list), (eazel_install_get_epv):
+ * components/services/install/lib/eazel-install-protocols.c:
+ (filename_from_url):
+ * components/services/install/lib/eazel-install-rpm-glue.c:
+ (eazel_install_do_rpm_transaction_process_pipe),
+ (do_rpm_transaction):
+ The cli tool can now read from a local xml file and if the rpm's
+ are present (this depends on all fields in the xml being filled)
+ it will use those.
+
+ * components/services/install/lib/eazel-install-xml-package-list.c:
+ (generate_xml_package_list):
+ * nautilus-installer/src/installer.c: (installer):
+ * nautilus-installer/src/main.c:
+ Some patches for reading local files (bug#2021)
+
2000-08-07 set J Shane Culpepper <pepper@eazel.com>
* components/services/inventory/Makefile.am:
diff --git a/components/services/install/command-line/eazel-alt-install-corba.c b/components/services/install/command-line/eazel-alt-install-corba.c
index 39d940d50..83e285538 100644
--- a/components/services/install/command-line/eazel-alt-install-corba.c
+++ b/components/services/install/command-line/eazel-alt-install-corba.c
@@ -70,28 +70,30 @@ int arg_dry_run,
arg_query;
char *arg_server,
*arg_config_file,
+ *arg_package_list,
*arg_tmp_dir;
CORBA_ORB orb;
CORBA_Environment ev;
static const struct poptOption options[] = {
+ {"config", '\0', POPT_ARG_STRING, &arg_config_file, 0, N_("Specify config file (/var/eazel/services/eazel-services-config.xml)"), NULL},
{"debug", '0', POPT_ARG_NONE, &arg_debug, 0 , N_("Show debug output"), NULL},
{"delay", '\0', POPT_ARG_NONE, &arg_delay, 0 , N_("10 sec delay after starting service"), NULL},
- {"port", '\0', POPT_ARG_INT, &arg_port, 0 , N_("Set port numer (80)"), NULL},
- {"test", 't', POPT_ARG_NONE, &arg_dry_run, 0, N_("Test run"), NULL},
+ {"downgrade", 'd', POPT_ARG_NONE, &arg_downgrade, 0, N_("Allow downgrades"), NULL},
{"erase", 'e', POPT_ARG_NONE, &arg_erase, 0, N_("Erase packages"), NULL},
+ {"file",'\0', POPT_ARG_NONE, &arg_file, 0, N_("RPM args are filename"), NULL},
{"force", 'F', POPT_ARG_NONE, &arg_force, 0, N_("Force install"), NULL},
- {"upgrade", 'u', POPT_ARG_NONE, &arg_upgrade, 0, N_("Allow upgrades"), NULL},
- {"downgrade", 'd', POPT_ARG_NONE, &arg_downgrade, 0, N_("Allow downgrades"), NULL},
- {"tmp", '\0', POPT_ARG_STRING, &arg_tmp_dir, 0, N_("Set tmp dir (/tmp/eazel-install)"), NULL},
- {"server", '\0', POPT_ARG_STRING, &arg_server, 0, N_("Specify server"), NULL},
- {"query", 'q', POPT_ARG_NONE, &arg_query, 0, N_("Run Query"), NULL},
- {"http", 'h', POPT_ARG_NONE, &arg_http, 0, N_("Use http"), NULL},
{"ftp", 'f', POPT_ARG_NONE, &arg_ftp, 0, N_("Use ftp"), NULL},
{"local", 'l', POPT_ARG_NONE, &arg_local, 0, N_("Use local"), NULL},
- {"file",'\0', POPT_ARG_NONE, &arg_file, 0, N_("RPM args are filename"), NULL},
- {"config", '\0', POPT_ARG_STRING, &arg_config_file, 0, N_("Specify config file (/var/eazel/services/eazel-services-config.xml)"), NULL},
+ {"http", 'h', POPT_ARG_NONE, &arg_http, 0, N_("Use http"), NULL},
+ {"packagefile", '\0', POPT_ARG_STRING, &arg_package_list, 0, N_("Specify package file"), NULL},
+ {"port", '\0', POPT_ARG_INT, &arg_port, 0 , N_("Set port numer (80)"), NULL},
+ {"query", 'q', POPT_ARG_NONE, &arg_query, 0, N_("Run Query"), NULL},
+ {"server", '\0', POPT_ARG_STRING, &arg_server, 0, N_("Specify server"), NULL},
+ {"test", 't', POPT_ARG_NONE, &arg_dry_run, 0, N_("Test run"), NULL},
+ {"tmp", '\0', POPT_ARG_STRING, &arg_tmp_dir, 0, N_("Set tmp dir (/tmp/eazel-install)"), NULL},
+ {"upgrade", 'u', POPT_ARG_NONE, &arg_upgrade, 0, N_("Allow upgrades"), NULL},
{NULL, '\0', 0, NULL, 0}
};
@@ -150,6 +152,10 @@ set_parameters_from_command_line (Trilobite_Eazel_Install service)
if (arg_force) {
Trilobite_Eazel_Install__set_force (service, TRUE, &ev);
}
+ if (arg_package_list) {
+ Trilobite_Eazel_Install__set_package_list (service, arg_package_list, &ev);
+ check_ev ("packagelist");
+ }
/*
Trilobite_Eazel_Install__set_rpmrc_file (service, DEFAULT_RPMRC, &ev);
diff --git a/components/services/install/idl/trilobite-eazel-install.idl b/components/services/install/idl/trilobite-eazel-install.idl
index 66e07b188..dc54fcae3 100644
--- a/components/services/install/idl/trilobite-eazel-install.idl
+++ b/components/services/install/idl/trilobite-eazel-install.idl
@@ -131,6 +131,8 @@ module Trilobite {
attribute boolean force; /* force install specified package (DANGER WILL ROBINSON) */
attribute boolean update; /* enable update (default is FALSE) */
attribute boolean downgrade; /* enable update (default is FALSE) */
+ attribute string package_list; /* Local package list to use, rather then download
+ from server */
attribute string server; /* server to use for both file and package list download */
attribute long server_port; /* */
diff --git a/components/services/install/lib/eazel-install-corba-types.c b/components/services/install/lib/eazel-install-corba-types.c
index c400c55ed..90b17ea0b 100644
--- a/components/services/install/lib/eazel-install-corba-types.c
+++ b/components/services/install/lib/eazel-install-corba-types.c
@@ -192,8 +192,6 @@ corba_category_list_from_categorydata_list (GList *categories)
GList *iterator;
int i;
- g_return_val_if_fail (categories != NULL, NULL);
-
corbacats = Trilobite_Eazel_CategoryStructList__alloc ();
corbacats->_length = g_list_length (categories);
corbacats->_buffer = CORBA_sequence_Trilobite_Eazel_CategoryStruct_allocbuf (corbacats->_length);
diff --git a/components/services/install/lib/eazel-install-corba.c b/components/services/install/lib/eazel-install-corba.c
index 02f761e0c..e39a93a2f 100644
--- a/components/services/install/lib/eazel-install-corba.c
+++ b/components/services/install/lib/eazel-install-corba.c
@@ -287,6 +287,23 @@ impl_Eazel_Install__get_log_file (impl_POA_Trilobite_Eazel_Install *servant,
}
static void
+impl_Eazel_Install__set_package_list (impl_POA_Trilobite_Eazel_Install *servant,
+ const CORBA_char *value,
+ CORBA_Environment *ev)
+{
+ eazel_install_set_package_list (servant->object, value);
+}
+
+
+static CORBA_char*
+impl_Eazel_Install__get_package_list (impl_POA_Trilobite_Eazel_Install *servant,
+ const CORBA_char *value,
+ CORBA_Environment *ev)
+{
+ return eazel_install_get_package_list (servant->object);
+}
+
+static void
impl_Eazel_Install__set_protocol (impl_POA_Trilobite_Eazel_Install *servant,
const Trilobite_Eazel_ProtocolEnum value,
CORBA_Environment *ev)
@@ -381,6 +398,9 @@ eazel_install_get_epv ()
epv->_set_log_file = (gpointer)&impl_Eazel_Install__set_log_file;
epv->_get_log_file = (gpointer)&impl_Eazel_Install__get_log_file;
+ epv->_set_package_list = (gpointer)&impl_Eazel_Install__set_package_list;
+ epv->_get_package_list = (gpointer)&impl_Eazel_Install__get_package_list;
+
epv->_set_tmp_dir = (gpointer)&impl_Eazel_Install__set_tmp_dir;
epv->_get_tmp_dir = (gpointer)&impl_Eazel_Install__get_tmp_dir;
diff --git a/components/services/install/lib/eazel-install-protocols.c b/components/services/install/lib/eazel-install-protocols.c
index e4a69083d..c1472545e 100644
--- a/components/services/install/lib/eazel-install-protocols.c
+++ b/components/services/install/lib/eazel-install-protocols.c
@@ -232,7 +232,11 @@ filename_from_url (char *url)
while ((ptr != url) && (*ptr != '/')) {
ptr--;
}
- filename = g_strdup (ptr + 1);
+ if (ptr == url) {
+ filename = g_strdup (ptr);
+ } else {
+ filename = g_strdup (ptr + 1);
+ }
return filename;
}
diff --git a/components/services/install/lib/eazel-install-rpm-glue.c b/components/services/install/lib/eazel-install-rpm-glue.c
index c2c8b0663..57569b1f7 100644
--- a/components/services/install/lib/eazel-install-rpm-glue.c
+++ b/components/services/install/lib/eazel-install-rpm-glue.c
@@ -551,6 +551,7 @@ eazel_install_do_rpm_transaction_process_pipe (EazelInstall *service,
/* while something there... */
while (!feof (pipe)) {
+ fflush (pipe);
fgets (tmp, 1023, pipe);
if (feof (pipe)) {
break;
@@ -614,11 +615,7 @@ eazel_install_do_rpm_transaction_process_pipe (EazelInstall *service,
service->private->packsys.rpm.total_size);
}
}
- } else {
- if (fflush (pipe)==0) {
- g_warning ("cannot flush");
- }
- }
+ }
}
fclose (pipe);
@@ -752,6 +749,7 @@ do_rpm_transaction (EazelInstall *service,
char **argv;
int i;
int flags;
+ int useless_stderr;
GList *iterator;
/* Create argv list */
@@ -769,7 +767,7 @@ do_rpm_transaction (EazelInstall *service,
res = service->private->packsys.rpm.num_packages;
}
/* start /bin/rpm... */
- if (res==0 && trilobite_pexec ("/bin/rpm", argv, NULL, &fd, NULL)!=0) {
+ if (res==0 && trilobite_pexec ("/bin/rpm", argv, NULL, &fd, &useless_stderr)!=0) {
g_warning ("Could not start rpm");
res = service->private->packsys.rpm.num_packages;
} else {
diff --git a/components/services/install/lib/eazel-install-xml-package-list.c b/components/services/install/lib/eazel-install-xml-package-list.c
index 45c37bc6b..fbaeba333 100644
--- a/components/services/install/lib/eazel-install-xml-package-list.c
+++ b/components/services/install/lib/eazel-install-xml-package-list.c
@@ -277,7 +277,7 @@ generate_xml_package_list (const char* pkg_template_file,
char** entry_array;
char** package_array;
char *tags[] = {"NAME", "VERSION", "MINOR", "ARCH", "BYTESIZE", "SUMMARY", NULL};
- int num_tags = 6;
+ int num_tags = 5;
int lines;
doc = xmlNewDoc ("1.0");
@@ -313,11 +313,11 @@ generate_xml_package_list (const char* pkg_template_file,
package = xmlNewChild (packages, NULL, "PACKAGE", NULL);
- for (i = 1; i <= num_tags; i++) {
- if (package_array[i]) {
- data = xmlNewChild (package, NULL, tags[i], package_array[i]);
+ for (i = 0; i <= num_tags; i++) {
+ if (package_array[i+1]) {
+ data = xmlNewChild (package, NULL, tags[i], package_array[i+1]);
} else {
- g_error ("line %d, tag %d (%s) is missing", index+1, i+1, tags[i]);
+ g_warning ("line %d, tag %d (%s) is missing", index+1, i+1, tags[i]);
}
}
g_strfreev (package_array);
diff --git a/nautilus-installer/src/installer.c b/nautilus-installer/src/installer.c
index 9aecbc55a..81ab3f04f 100644
--- a/nautilus-installer/src/installer.c
+++ b/nautilus-installer/src/installer.c
@@ -20,7 +20,6 @@
#define HOSTNAME "testmachine.eazel.com"
#define PORT_NUMBER 80
-#define PROTOCOL PROTOCOL_HTTP
#define TMP_DIR "/tmp/eazel-install"
#define RPMRC "/usr/lib/rpm/rpmrc"
#define REMOTE_RPM_DIR "/RPMS"
@@ -36,7 +35,7 @@ static char *package_list[LAST] = {
char *failure_info;
int installer_debug;
int installer_test;
-
+int installer_local;
static void
eazel_install_progress (EazelInstall *service,
@@ -337,7 +336,7 @@ void installer (GtkWidget *window,
"update", TRUE,
"uninstall", method==UNINSTALL ? TRUE : FALSE,
"downgrade", TRUE,
- "protocol", PROTOCOL,
+ "protocol", installer_local ? PROTOCOL_LOCAL: PROTOCOL_HTTP,
"tmp_dir", TMP_DIR,
"rpmrc_file", RPMRC,
"server", HOSTNAME,
@@ -347,13 +346,6 @@ void installer (GtkWidget *window,
NULL));
g_assert (service != NULL);
- eazel_install_set_server (service, HOSTNAME);
- eazel_install_set_rpmrc_file (service, RPMRC);
- eazel_install_set_package_list_storage_path (service, "/package-list.xml");
- eazel_install_set_rpm_storage_path (service, REMOTE_RPM_DIR);
- eazel_install_set_tmp_dir (service, TMP_DIR);
- eazel_install_set_server_port (service, PORT_NUMBER);
- eazel_install_set_protocol (service, PROTOCOL);
if (!installer_debug) {
eazel_install_open_log (service, "/tmp/nautilus-install.log");
}
diff --git a/nautilus-installer/src/main.c b/nautilus-installer/src/main.c
index d3f3a9624..5d1247de6 100644
--- a/nautilus-installer/src/main.c
+++ b/nautilus-installer/src/main.c
@@ -16,10 +16,12 @@
extern int installer_debug;
extern int installer_test;
+extern int installer_local;
static const struct poptOption options[] = {
{"debug", 'd', POPT_ARG_NONE, &installer_debug, 0 , N_("Show debug output"), NULL},
{"test", 't', POPT_ARG_NONE, &installer_test, 0, N_("Test run"), NULL},
+ {"local", 'l', POPT_ARG_NONE, &installer_local, 0, N_("Read local rpm's."), NULL},
{NULL, '\0', 0, NULL, 0}
};