poldek: poldek/ask.c - display questions on TTY

mis mis at pld-linux.org
Fri Jul 6 01:06:12 CEST 2007


Author: mis                          Date: Thu Jul  5 23:06:12 2007 GMT
Module: poldek                        Tag: HEAD
---- Log message:
- display questions on TTY

---- Files affected:
poldek/poldek:
   ask.c (1.9 -> 1.10) 

---- Diffs:

================================================================
Index: poldek/poldek/ask.c
diff -u poldek/poldek/ask.c:1.9 poldek/poldek/ask.c:1.10
--- poldek/poldek/ask.c:1.9	Sun Jul  1 23:04:26 2007
+++ poldek/poldek/ask.c	Fri Jul  6 01:06:07 2007
@@ -34,6 +34,8 @@
 #include "poldek_intern.h"
 #include "pkg.h"
 
+#define msg_ask(fmt, args...) poldek_log(LOGTTY|LOGINFO, fmt, ## args)
+
 static int term_confirm(void *foo, const struct poldek_ts *ts, int hint,
                         const char *question) 
 {
@@ -49,7 +51,7 @@
     if (hint == 0)    /* no */
         yn = "[N/y]";
 
-    poldek_log(LOGINFO, "%s %s", question, yn);
+    msg_ask("%s %s", question, yn);
     
     a = poldek_term_ask(STDIN_FILENO, "YyNn\n", NULL);
     a = toupper(a);
@@ -61,7 +63,7 @@
             n_assert(0);
     }
     
-    msg(-1, "_\n");
+    msg_ask("_\n");
     return a;
 }
 
@@ -99,7 +101,7 @@
     if (!isatty(STDIN_FILENO))
         return hint;
     
-    msgn(-1, _("There are more than one package which provide \"%s\":"), capname);
+    msg_ask(_("There are more than one package which provide \"%s\":"), capname);
     validchrs = alloca(64);
     p = validchrs;
     *p++ = '\n';
@@ -114,10 +116,10 @@
     }
     *p++ = 'Q';
     
-    msg(-1, _("Which one do you want to install ('Q' to abort)? [%c]"), 'a' + hint);
+    msg_ask(_("Which one do you want to install ('Q' to abort)? [%c]"), 'a' + hint);
     
     a = poldek_term_ask(STDIN_FILENO, validchrs, NULL);
-    msg(-1, "_\n");
+    msg_ask("_\n");
     
     if (a == '\n')
         return hint;
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/poldek/poldek/ask.c?r1=1.9&r2=1.10&f=u



More information about the pld-cvs-commit mailing list