Changes on new server
[bpt/portal.git] / aptquery.sml
index 1a5939e..bf0ec6a 100644 (file)
@@ -33,14 +33,7 @@ fun query name =
            let
                val _ = Unix.reap proc
 
-               val proc = Unix.execute ("/usr/bin/dpkg", ["-l", name])
-               val inf = Unix.textInstreamOf proc
-               val installed =
-                   case TextIO.inputLine inf of
-                       NONE => false
-                     | SOME line => String.sub (line, 0) = #"D"
-
-               val _ = Unix.reap proc
+               val installed = OS.Process.isSuccess (OS.Process.system ("/usr/bin/dpkg -p " ^ name ^ " >/dev/null 2>/dev/null"))
            in
                SOME {name = name, section = section, descr = descr, installed = installed}
            end
@@ -48,4 +41,4 @@ fun query name =
                  NONE)
     end
 
-end
\ No newline at end of file
+end