[Rpm-maint] [PATCH] - create an argwarning() (so it can be expanded on later if necessary) - emit obnoxious warnings if people using --force or --nodeps

seth vidal skvidal at fedoraproject.org
Tue Jul 27 20:47:17 UTC 2010


From: Seth Vidal <skvidal at fedoraproject.org>

---
 lib/poptI.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/lib/poptI.c b/lib/poptI.c
index c30c3b5..b21fdc6 100644
--- a/lib/poptI.c
+++ b/lib/poptI.c
@@ -32,6 +32,13 @@ static void argerror(const char * desc)
     exit(EXIT_FAILURE);
 }
 
+
+static void argwarning(const char * desc)
+{
+    fprintf(stderr, _("%s: %s\n"), __progname, desc);
+}
+
+
 /**
  */
 static void installArgCallback( poptContext con,
@@ -90,6 +97,7 @@ static void installArgCallback( poptContext con,
 	break;
 
     case RPMCLI_POPT_NODEPS:
+    argwarning(_("using --nodeps may break other tools on your system and make recovery impossible."));
 	ia->noDeps = 1;
 	break;
 
@@ -102,6 +110,7 @@ static void installArgCallback( poptContext con,
 	break;
 
     case RPMCLI_POPT_FORCE:
+    argwarning(_("using --force may break other tools on your system and make recovery impossible."));
 	ia->probFilter |=
 		( RPMPROB_FILTER_REPLACEPKG
 		| RPMPROB_FILTER_REPLACEOLDFILES
-- 
1.7.1.1



More information about the Rpm-maint mailing list