diff options
author | Vincent Untz <vuntz@gnome.org> | 2007-06-04 17:39:52 +0000 |
---|---|---|
committer | Vincent Untz <vuntz@gnome.org> | 2007-06-04 17:39:52 +0000 |
commit | 80a1c932b9e90caaf75857a3dd8ebfcd77fa93a5 (patch) | |
tree | 060e38a45ba09589df88590dc845947b9aa671b2 | |
parent | 14f6fe3f1eb4699d5020e2b4ea729419b898abc2 (diff) |
check if we have a vendor name before using it (main): fix bug when no
2007-06-04 Vincent Untz <vuntz@gnome.org>
* 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
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | src/install.c | 14 |
2 files changed, 11 insertions, 11 deletions
@@ -1,5 +1,13 @@ 2007-06-04 Vincent Untz <vuntz@gnome.org> + * 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 <vuntz@gnome.org> + Don't use GKeyFile in the validator, so we really control everything. * src/validate.c: remove some FIXME/TODO 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) |