[PATCH] trivial: check the user specified a non-zero length --output parameter

Richard Hughes richard at hughsie.com
Thu Jan 29 01:25:40 PST 2009


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

diff --git a/client/pk-generate-pack.c b/client/pk-generate-pack.c
index b57186b..0a1070e 100644
--- a/client/pk-generate-pack.c
+++ b/client/pk-generate-pack.c
@@ -239,6 +239,14 @@ main (int argc, char *argv[])
 		goto out;
 	}
 
+	/* no argument given to --output */
+	if (directory != NULL && egg_strzero (directory)) {
+		/* TRANSLATORS: This is when the user fails to supply the output */
+		g_print ("%s\n", _("A output directory or file name is required"));
+		retval = 1;
+		goto out;
+	}
+
 	/* 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="0005-trivial-check-for-DownloadPackages-in-pkgenpack-as.patch"
Content-Type: text/x-patch; name="0005-trivial-check-for-DownloadPackages-in-pkgenpack-as.patch"; charset="UTF-8"
Content-Transfer-Encoding: 7bit



More information about the PackageKit mailing list