Pick prioritized value in add-repo if there is one

This commit is contained in:
Jean Niklas L'orange 2013-02-08 21:04:23 +01:00
parent cd52531897
commit 120c54ab3c

View file

@ -171,11 +171,12 @@
(meta repos))) (meta repos)))
(defn- add-repo [repos [id opts :as repo]] (defn- add-repo [repos [id opts :as repo]]
;; TODO - we completely ignore metadata here. Should follow
;; ^:replace/^:displace conventions and merge metadata
(update-first repos #(= id (first %)) (update-first repos #(= id (first %))
(fn [[_ existing]] (fn [[_ existing :as original]]
[id (meta-merge existing opts)]))) (if (different-priority? repo original)
(pick-prioritized repo original)
(with-meta [id (meta-merge existing opts)]
(merge (meta original) (meta repo)))))))
(def empty-dependencies (def empty-dependencies
(with-meta [] {:reduce add-dep})) (with-meta [] {:reduce add-dep}))