Force npconfig to only update system mozilla plugin dir if requested.

 -- Rob Andrews <rob@choralone.org>  Mon, 09 Mar 2009 22:59:45 +0000

--- nspluginwrapper/src/npw-config.c.orig	2009-03-09 22:55:18.000000000 +0000
+++ nspluginwrapper/src/npw-config.c	2009-03-09 22:59:48.000000000 +0000
@@ -42,6 +42,7 @@
 static bool g_auto = false;
 static bool g_verbose = false;
 static bool g_allow_native = false;
+static bool g_systemonly = false;
 static const char NPW_CONFIG[] = "nspluginwrapper";
 
 static void error(const char *format, ...)
@@ -1001,6 +1002,7 @@
   printf("   -h --help               print this message\n");
   printf("   -v --verbose            flag: set verbose mode\n");
   printf("   -a --auto               flag: set automatic mode for plugins discovery\n");
+  printf("   -s --systemonly         when auto updating, only process the system plugin directory\n");
   printf("   -n --native             flag: allow native plugin(s) to be wrapped\n");
   printf("   -l --list               list plugins currently installed\n");
   printf("   -u --update             update plugin(s) currently installed\n");
@@ -1053,9 +1055,16 @@
 {
   int i;
 
-  if (g_auto)
+  if (g_auto && !g_systemonly)
 	return auto_update_plugins();
 
+  if (g_auto && g_systemonly)
+  {
+	if (g_verbose)
+	  printf("Auto-updating system plugin path.\n");
+	return process_plugin_dir(get_system_mozilla_plugin_dir(), (is_plugin_cb)is_wrapper_plugin_0, (process_plugin_cb)update_plugin);
+  }
+
   if (argc < 1)
 	error("expected plugin(s) file name to update");
 
@@ -1122,6 +1131,12 @@
   return 0;
 }
 
+static int process_system_only(int argc, char *argv[])
+{
+  g_systemonly = true;
+  return 0;
+}
+
 int main(int argc, char *argv[])
 {
   char **args;
@@ -1150,6 +1165,7 @@
 	{ 'h', "help",		process_help,		1 },
 	{ 'v', "verbose",	process_verbose,	0 },
 	{ 'a', "auto",		process_auto,		0 },
+	{ 's', "systemonly",	process_system_only,	0 },
 	{ 'n', "native",	process_native,		0 },
 	{ 'l', "list",		process_list,		1 },
 	{ 'u', "update",	process_update,		1 },
