pantry-0.10.1: Content addressable Haskell package management

Safe Haskell | Safe-Inferred
Language | Haskell2010

Pantry.Internal

Synopsis

- normalizeParents :: FilePath -> Either String FilePath
- makeTarRelative :: FilePath -> FilePath -> Either String FilePath

# Documentation

normalizeParents :: FilePath -> Either String FilePath Source #

Like `System.FilePath.normalise`, however:

- Only works on relative paths, absolute paths fail
- Strips trailing slashes
- Only works on forward slashes, even on Windows
- Normalizes parent dirs `foo..` get stripped
- Cannot begin with a parent directory (`../`)
- Spelled like an American, sorry

makeTarRelative Source #

Arguments

:: FilePath | base file
-> FilePath | relative part
-> Either String FilePath |

Following tar file rules (Unix file paths only), make the second file relative to the first file.