(defn dependency-order
"Topologically sort a collection of dependencies."
[coll]
(let [state (build-index (map pack-string coll))]
(map unpack-string
(distinct-by :provides
(:order (reduce dependency-order-visit (assoc state :order []) (keys state)))))))