[PATCH] bugfix: don't print an internal error if we don't pass an argument to --package

Utsav Handa utsavhanda at hotmail.com
Thu Jan 29 00:45:41 PST 2009


---
 client/pk-generate-pack.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/client/pk-generate-pack.c b/client/pk-generate-pack.c
index df040ee..2192e58 100644
--- a/client/pk-generate-pack.c
+++ b/client/pk-generate-pack.c
@@ -31,6 +31,7 @@
 #include <packagekit-glib/packagekit.h>
 
 #include "egg-debug.h"
+#include "egg-string.h"
 
 #include "pk-tools-common.h"
 
@@ -230,6 +231,14 @@ main (int argc, char *argv[])
 		return 1;
 	}
 
+	/* no argument given to --package */
+	if (package != NULL && egg_strzero (package)) {
+		/* TRANSLATORS: This is when the user fails to supply the package name */
+		g_print ("%s\n", _("A package name is required"));
+		g_print ("%s", options_help);
+		return 1;
+	}
+
 	/* fall back to the system copy */
 	if (package_list == NULL)
 		package_list = g_strdup (PK_SYSTEM_PACKAGE_LIST_FILENAME);
-- 
1.6.0.6


--=-lV+SxmnKFyrvv1DKBoIC
Content-Disposition: attachment; filename*0=0002-trivial-export-the-service-pack-filename-in-the-ser.patc; filename*1=h
Content-Type: text/x-patch; name="0002-trivial-export-the-service-pack-filename-in-the-ser.patch"; charset="UTF-8"
Content-Transfer-Encoding: 7bit



More information about the PackageKit mailing list