Generate ocamldoc, multiple documentation fixes.
[goaljobs.git] / goaljobs.ml
index b5981ad..e83f00e 100644 (file)
@@ -35,7 +35,7 @@ let target v =
   if v then raise (Goal_result Goal_OK)
 let target_all vs = target (List.fold_left (&&) true vs)
 let target_exists vs = target (List.fold_left (||) false vs)
-let require () = ()
+let require f = f ()
 
 type period_t = Seconds | Days | Months | Years
 let seconds = (1, Seconds)
@@ -187,9 +187,10 @@ let url_exists url =
     sprintf "curl --output /dev/null --silent --head --fail %s" (quote url) in
   match Sys.command cmd with
   | 0 -> true
-  | 1 -> false
+  | 19|22 -> false
   | r ->
-    let msg = sprintf "curl error testing '%s' (exit code %d)" url r in
+    let msg = sprintf "curl error testing '%s': exit code %d, see curl(1)"
+      url r in
     goal_failed msg
 
 let file_contains_string filename str =
@@ -208,11 +209,12 @@ let url_contains_string url str =
     sprintf "curl --output %s --silent --fail %s" (quote tmp) (quote url) in
   (match Sys.command cmd with
   | 0 -> ()
-  | 1 ->
+  | 19|22 ->
     let msg = sprintf "curl failed to download URL '%s'" url in
     goal_failed msg
   | r ->
-    let msg = sprintf "curl error testing '%s' (exit code %d)" url r in
+    let msg = sprintf "curl error testing '%s': exit code %d, see curl(1)"
+      url r in
     goal_failed msg
   );
   let r = file_contains_string tmp str in
@@ -273,6 +275,7 @@ let do_shlines script =
   let lines = ref [] in
   let rec loop () =
     let line = input_line chan in
+    eprintf "%s\n%!" line;
     lines := line :: !lines;
     loop ()
   in