   {[page] :page repos :repos search :search update :update}
   (let [page (if page (Integer. page) 1)]
     (binding [sherlock/*page-size* 10]
-      (doseq [[id url] (select-repos repos)]
-        (download-index id url)
-        (when update (update-repo id url))
-        (needs-updating? id url)
+      (doseq [[id url] (select-repos repos) :when (published? url)]
+        (batch-update id url update)
         (print-results
          id page
          (sherlock/get-page page (sherlock/search url (join " " search) page)))))))

      repositories)))

(defn hash-url [url]
  (str (sherlock/remote-index-url url) ".md5"))

(defn hash-location [url]
  (file (str (sherlock/index-location url) ".md5")))

        cake.core
        [bake.core :only [log]]
        [clojure.string :only [join]]
        [clojure.java.io :only [as-url file copy reader]])
  (:require [sherlock.core :as sherlock])
  (:import java.net.HttpURLConnection))

(defn select-repos [repos]
  (let [repositories (:repositories *project*)]
