OS.Process.failure)
| SOME m =>
case m of
- MsgYes => (print "Package exists.\n";
- OS.Process.success)
+ MsgAptQuery {section,description} => (print "Package exists.\n";
+ print ("Section: " ^ section ^ "\n");
+ print ("Description: " ^ description ^ "\n");
+ OS.Process.success)
| MsgNo => (print "Package does not exist.\n";
- OS.Process.failure)
+ OS.Process.failure
+ (* It might be the Wrong Thing (tm) to use MsgNo like this *))
| MsgError s => (print ("APT existence query failed: " ^ s ^ "\n");
OS.Process.failure)
| _ => (print "Unexpected server reply.\n";
fun answerQuery q =
case q of
QApt pkg => if Apt.installed pkg then MsgYes else MsgNo
- | QAptExists pkg => if Apt.exists pkg then MsgYes else MsgNo
+ | QAptExists pkg => (case Apt.info pkg of
+ SOME {section, description} => MsgAptQuery {section = section, description = description}
+ | NONE => MsgNo)
| QCron user => if Cron.allowed user then MsgYes else MsgNo
| QFtp user => if Ftp.allowed user then MsgYes else MsgNo
| QTrustedPath user => if TrustedPath.query user then MsgYes else MsgNo