From 848b1ab3e5e4a787a23ca5d444f7722dde5e2740 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 19 May 2015 08:17:46 +0300 Subject: [PATCH] Collapse paths in keter bundle --- yesod-bin/ChangeLog.md | 4 ++++ yesod-bin/Keter.hs | 8 +++++++- yesod-bin/yesod-bin.cabal | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/yesod-bin/ChangeLog.md b/yesod-bin/ChangeLog.md index 8ca4c66c..fe7eb498 100644 --- a/yesod-bin/ChangeLog.md +++ b/yesod-bin/ChangeLog.md @@ -1,3 +1,7 @@ +## 1.4.9.2 + +* Collapse paths in keter bundles, see [mailing list thread](https://groups.google.com/d/msg/yesodweb/Ndd310qfSEc/pZOXldsKowsJ) + ## 1.4.9 * Command line options for `yesod init` [#986](https://github.com/yesodweb/yesod/pull/986) diff --git a/yesod-bin/Keter.hs b/yesod-bin/Keter.hs index 8f3c26f2..3bd27170 100644 --- a/yesod-bin/Keter.hs +++ b/yesod-bin/Keter.hs @@ -60,13 +60,19 @@ keter cabal noBuild noCopyTo = do go ("exec", String s) = tellFile s go ("extraFiles", Array a) = Fold.mapM_ tellExtra a go (_, v') = findFiles v' - tellFile s = tell ["config" T.unpack s] + tellFile s = tell [collapse $ "config" T.unpack s] tellExtra (String s) = tellFile s tellExtra _ = error "extraFiles should be a flat array" findFiles (Array v) = Fold.mapM_ findFiles v findFiles _ = return () bundleFiles = execWriter $ findFiles $ Object value + collapse = T.unpack . T.intercalate "/" . collapse' . T.splitOn "/" . T.pack + collapse' (_:"..":rest) = collapse' rest + collapse' (".":xs) = collapse' xs + collapse' (x:xs) = x : collapse' xs + collapse' [] = [] + unless noBuild $ do run cabal ["clean"] run cabal ["configure"] diff --git a/yesod-bin/yesod-bin.cabal b/yesod-bin/yesod-bin.cabal index 2222407f..c184ee7d 100644 --- a/yesod-bin/yesod-bin.cabal +++ b/yesod-bin/yesod-bin.cabal @@ -1,5 +1,5 @@ name: yesod-bin -version: 1.4.9.1 +version: 1.4.9.2 license: MIT license-file: LICENSE author: Michael Snoyman