From 80a1c932b9e90caaf75857a3dd8ebfcd77fa93a5 Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Mon, 4 Jun 2007 17:39:52 +0000 Subject: check if we have a vendor name before using it (main): fix bug when no 2007-06-04 Vincent Untz * src/install.c: (process_one_file): check if we have a vendor name before using it (main): fix bug when no vendor name or target dir is specified (we'd use an empty string in this case), don't require vendor name Fix bug #9988 --- ChangeLog | 8 ++++++++ src/install.c | 14 +++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index d44dd70..3dbca7a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-06-04 Vincent Untz + + * src/install.c: (process_one_file): check if we have a vendor name + before using it + (main): fix bug when no vendor name or target dir is specified (we'd + use an empty string in this case), don't require vendor name + Fix bug #9988 + 2007-06-04 Vincent Untz Don't use GKeyFile in the validator, so we really control everything. diff --git a/src/install.c b/src/install.c index 0a0ea0e..5678d03 100644 --- a/src/install.c +++ b/src/install.c @@ -97,8 +97,6 @@ process_one_file (const char *filename, GError *rebuild_error; GSList *tmp; - g_assert (vendor_name); - kf = g_key_file_new (); if (!g_key_file_load_from_file (kf, filename, G_KEY_FILE_KEEP_COMMENTS| @@ -201,7 +199,7 @@ process_one_file (const char *filename, dirname = g_path_get_dirname (filename); basename = g_path_get_basename (filename); - if (!g_str_has_prefix (basename, vendor_name)) + if (vendor_name && !g_str_has_prefix (basename, vendor_name)) { char *new_base; new_base = g_strconcat (vendor_name, "-", basename, NULL); @@ -578,22 +576,16 @@ main (int argc, char **argv) return 1; } - if (vendor_name == NULL) + if (vendor_name == NULL && g_getenv ("DESKTOP_FILE_VENDOR")) vendor_name = g_strdup (g_getenv ("DESKTOP_FILE_VENDOR")); - if (vendor_name == NULL) - { - g_printerr (_("Must specify the vendor namespace for these files with --vendor\n")); - return 1; - } - if (copy_generic_name_to_name && copy_name_to_generic_name) { g_printerr (_("Specifying both --copy-name-to-generic-name and --copy-generic-name-to-name at once doesn't make much sense.\n")); return 1; } - if (target_dir == NULL) + if (target_dir == NULL && g_getenv ("DESKTOP_FILE_INSTALL_DIR")) target_dir = g_strdup (g_getenv ("DESKTOP_FILE_INSTALL_DIR")); if (target_dir == NULL) -- cgit v1.2.3