From 150fb501445caa6c83a0c8f8e97008dc8efba053 Mon Sep 17 00:00:00 2001 From: Micha Niskin Date: Thu, 31 Dec 2015 04:34:09 -0500 Subject: [PATCH] Target task should fall back to copying when hardlinks not possible - Fixes #373 --- CHANGES.md | 11 +++++++++++ boot/core/src/boot/core.clj | 5 ++++- boot/worker/src/boot/pom.clj | 4 ++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index f9e84a36..55aed32e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,16 @@ # Changes +## 2.5.4 + +#### Fixed + +- The `target` task falls back to copying when hardlinks aren't possible + [#373][373]. +- Use a `ByteArrayInputStream` instead of a `StringBufferInputStream` when + parsing `pom.xml` strings. + +[373]: https://github.com/boot-clj/boot/issues/373 + ## 2.5.3 #### Improved diff --git a/boot/core/src/boot/core.clj b/boot/core/src/boot/core.clj index 74d7f4ba..30c44aee 100644 --- a/boot/core/src/boot/core.clj +++ b/boot/core/src/boot/core.clj @@ -773,7 +773,10 @@ (fn [fs & {:keys [link]}] (let [link (when link :tmp) [a b] [@prev (reset! prev (output-fileset fs))]] - (mapv deref (for [d @dirs] (future (fs/patch! (fs/mkfs d) a b :link link)))))))) + (doseq [d @dirs :let [p! (partial fs/patch! (fs/mkfs d) a b :link)]] + (future (try (p! link) + (catch Throwable t + (if-not link (throw t) (p! nil)))))))))) (defn- run-tasks "Given a task pipeline, builds the initial fileset, sets the initial build diff --git a/boot/worker/src/boot/pom.clj b/boot/worker/src/boot/pom.clj index 873147a2..eafd0dd4 100644 --- a/boot/worker/src/boot/pom.clj +++ b/boot/worker/src/boot/pom.clj @@ -11,7 +11,7 @@ [clojure.data.zip.xml :refer [attr text xml-> xml1->]]) (:import [java.util Properties] - [java.io StringBufferInputStream] + [java.io ByteArrayInputStream] [java.util.jar JarEntry JarOutputStream])) ;;; elements ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -25,7 +25,7 @@ ;;; private ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defn pom-xml-parse-string [xml-str] - (let [z (-> xml-str StringBufferInputStream. parse xml-zip) + (let [z (-> xml-str .getBytes ByteArrayInputStream. parse xml-zip) gid (util/guard (xml1-> z :groupId text)) aid (util/guard (xml1-> z :artifactId text))] {:project (util/guard (if (= gid aid) (symbol aid) (symbol gid aid)))