ght 0.3.0 → 0.3.1
raw patch · 2 files changed
+32/−12 lines, 2 filesdep +mtldep −transformersdep ~basePVP ok
version bump matches the API change (PVP)
Dependencies added: mtl
Dependencies removed: transformers
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- ght.cabal +18/−3
- tools/ght.hs +14/−9
ght.cabal view
@@ -1,5 +1,5 @@ Name: ght-Version: 0.3.0+Version: 0.3.1 License: GPL License-file: GPL-2 Author: Conrad Parker <conrad@metadecks.org>@@ -14,7 +14,13 @@ ------------------------------------------------------------ library- Build-Depends: base < 5, data-default, bytestring, binary, SHA, old-locale, time+ Build-Depends: base < 5,+ data-default,+ bytestring,+ binary,+ SHA,+ old-locale,+ time Exposed-Modules: Git.Commit Git.Pack @@ -25,4 +31,13 @@ Executable ght Main-Is: ght.hs Hs-Source-Dirs: ., tools- Build-Depends: base, data-default, transformers == 0.2.*, ui-command, unix, directory, filepath, bytestring, zlib, SHA+ Build-Depends: base < 5,+ bytestring,+ data-default,+ directory,+ filepath,+ mtl >= 2.0.0.0 && < 3,+ SHA,+ ui-command,+ unix,+ zlib
tools/ght.hs view
@@ -1,7 +1,7 @@ module Main where import Control.Monad (liftM, when)-import Control.Monad.IO.Class (liftIO)+import Control.Monad.Trans (liftIO) import Data.Default import Data.List (intersperse, sort)@@ -102,10 +102,10 @@ -- -- NOTE: this is a modified version of normalise from filepath,--- fixed to handle the case of a trailing dot. I sent a patch--- with this change to ndm on 20100211; once that is upstream,--- then this copy can be removed and the System.FilePath version--- used instead.+-- fixed to handle the case of a trailing dot. This version was+-- submitted via the libraries process as ticket #3975:+-- http://hackage.haskell.org/trac/ghc/ticket/3975+-- which was applied on 08 Jan 2011. -- | Normalise a file --@@ -126,13 +126,18 @@ -- > Windows: normalise "c:/file" == "C:\\file" -- > normalise "." == "." -- > Posix: normalise "./" == "./"-+-- > Posix: normalise "./." == "./"+-- > Posix: normalise "bob/fred/." == "bob/fred/" normalise :: FilePath -> FilePath normalise path = joinDrive (normaliseDrive drv) (f pth)- ++ [pathSeparator | not (null pth) && isPathSeparator (last pth)]+ ++ [pathSeparator | isDirPath pth] where (drv,pth) = splitDrive path + isDirPath xs = lastSep xs+ || not (null xs) && last xs == '.' && lastSep (init xs)+ lastSep xs = not (null xs) && isPathSeparator (last xs)+ f = joinPath . dropDots [] . splitDirectories . propSep propSep (a:b:xs)@@ -142,8 +147,8 @@ propSep (x:xs) = x : propSep xs propSep [] = [] - dropDots acc ["."] = ["."]- dropDots acc xs = dropDots' acc xs+ dropDots acc xs | all (==".") xs = ["."]+ dropDots acc xs = dropDots' acc xs dropDots' acc (".":xs) = dropDots' acc xs dropDots' acc (x:xs) = dropDots' (x:acc) xs