From e1f302b4a6278b8179aba0b19f97503f0382a546 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Wed, 29 Jan 2020 23:06:13 +0100 Subject: [PATCH] Split hpath-directory into hpath-posix --- README.md | 1 + cabal.project | 1 + hpath-directory/hpath-directory.cabal | 8 +-- hpath-posix/CHANGELOG.md | 5 ++ hpath-posix/LICENSE | 30 ++++++++++ hpath-posix/README.md | 13 +++++ hpath-posix/Setup.hs | 2 + .../cbits/dirutils.c | 0 .../cbits/dirutils.h | 0 hpath-posix/hpath-posix.cabal | 56 +++++++++++++++++++ .../src/System/Posix/FD.hs | 0 .../src/System/Posix/Foreign.hsc | 0 .../Posix/RawFilePath/Directory/Traversals.hs | 0 13 files changed, 111 insertions(+), 5 deletions(-) create mode 100644 hpath-posix/CHANGELOG.md create mode 100644 hpath-posix/LICENSE create mode 100644 hpath-posix/README.md create mode 100644 hpath-posix/Setup.hs rename {hpath-directory => hpath-posix}/cbits/dirutils.c (100%) rename {hpath-directory => hpath-posix}/cbits/dirutils.h (100%) create mode 100644 hpath-posix/hpath-posix.cabal rename {hpath-directory => hpath-posix}/src/System/Posix/FD.hs (100%) rename {hpath-directory => hpath-posix}/src/System/Posix/Foreign.hsc (100%) rename {hpath-directory => hpath-posix}/src/System/Posix/RawFilePath/Directory/Traversals.hs (100%) diff --git a/README.md b/README.md index 3bad881..6d17804 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,4 @@ Set of libraries to deal with filepaths and files. * [![Hackage version](https://img.shields.io/hackage/v/hpath-filepath.svg?label=Hackage)](https://hackage.haskell.org/package/hpath-filepath) [hpath-filepath](./hpath-filepath): ByteString based filepath manipulation (can be used without hpath) * [![Hackage version](https://img.shields.io/hackage/v/hpath-directory.svg?label=Hackage)](https://hackage.haskell.org/package/hpath-directory) [hpath-directory](./hpath-directory): Hhigh-level IO operations for files/directories on raw ByteString filepaths (use hpath-io for the type-safe path version) * [![Hackage version](https://img.shields.io/hackage/v/hpath-io.svg?label=Hackage)](https://hackage.haskell.org/package/hpath-io) [hpath-io](./hpath-io): High-level IO operations for files/directories utilizing type-safe Path +* [![Hackage version](https://img.shields.io/hackage/v/hpath-posix.svg?label=Hackage)](https://hackage.haskell.org/package/hpath-posix) [hpath-posix](./hpath-posix): Some low-level POSIX glue code that is not in 'unix' diff --git a/cabal.project b/cabal.project index 6e4551e..48842ae 100644 --- a/cabal.project +++ b/cabal.project @@ -2,6 +2,7 @@ packages: ./hpath ./hpath-directory ./hpath-filepath ./hpath-io + ./hpath-posix package hpath-io ghc-options: -O2 -fspec-constr-recursive=16 -fmax-worker-args=16 diff --git a/hpath-directory/hpath-directory.cabal b/hpath-directory/hpath-directory.cabal index 8eb1330..b5f9156 100644 --- a/hpath-directory/hpath-directory.cabal +++ b/hpath-directory/hpath-directory.cabal @@ -1,7 +1,7 @@ cabal-version: >=1.10 name: hpath-directory -version: 0.13.0 +version: 0.13.1 synopsis: Alternative to 'directory' package with ByteString based filepaths description: This provides a safer alternative to the 'directory' package. FilePaths are ByteString based, so this @@ -34,17 +34,14 @@ library buildable: False exposed-modules: System.Posix.RawFilePath.Directory System.Posix.RawFilePath.Directory.Errors - System.Posix.RawFilePath.Directory.Traversals - System.Posix.Foreign, - System.Posix.FD -- other-modules: -- other-extensions: - c-sources: cbits/dirutils.c build-depends: base >= 4.8 && <5 , IfElse , bytestring >= 0.10 , exceptions >= 0.10 , hpath-filepath >= 0.10.3 + , hpath-posix >= 0.13 , safe-exceptions >= 0.1 , streamly >= 0.7 , streamly-bytestring >= 0.1.0.1 @@ -104,6 +101,7 @@ test-suite spec , bytestring >= 0.10.0.0 , hpath-directory , hpath-filepath >= 0.10 + , hpath-posix >= 0.13 , hspec >= 1.3 , process , time >= 1.8 diff --git a/hpath-posix/CHANGELOG.md b/hpath-posix/CHANGELOG.md new file mode 100644 index 0000000..5b56d6b --- /dev/null +++ b/hpath-posix/CHANGELOG.md @@ -0,0 +1,5 @@ +# Revision history for hpath-posix + +## 0.1.0.0 -- 2020-01-29 + +* First version. Released on an unsuspecting world. diff --git a/hpath-posix/LICENSE b/hpath-posix/LICENSE new file mode 100644 index 0000000..7ecfe24 --- /dev/null +++ b/hpath-posix/LICENSE @@ -0,0 +1,30 @@ +Copyright (c) 2020, Julian Ospald + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Julian Ospald nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/hpath-posix/README.md b/hpath-posix/README.md new file mode 100644 index 0000000..fd765f8 --- /dev/null +++ b/hpath-posix/README.md @@ -0,0 +1,13 @@ +# HPath-filepath + +[![Gitter chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/hasufell/hpath?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Hackage version](https://img.shields.io/hackage/v/hpath-posix.svg?label=Hackage)](https://hackage.haskell.org/package/hpath-posix) [![Build Status](https://api.travis-ci.org/hasufell/hpath.png?branch=master)](http://travis-ci.org/hasufell/hpath) [![Hackage-Deps](https://img.shields.io/hackage-deps/v/hpath-posix.svg)](http://packdeps.haskellers.com/feed?needle=hpath-posix) + +Some low-level POSIX glue code, that is not in 'unix'. + +This package is part of the HPath suite, also check out: + +* [hpath](https://hackage.haskell.org/package/hpath) +* [hpath-directory](https://hackage.haskell.org/package/hpath-directory) +* [hpath-filepath](https://hackage.haskell.org/package/hpath-filepath) +* [hpath-io](https://hackage.haskell.org/package/hpath-io) + diff --git a/hpath-posix/Setup.hs b/hpath-posix/Setup.hs new file mode 100644 index 0000000..9a994af --- /dev/null +++ b/hpath-posix/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/hpath-directory/cbits/dirutils.c b/hpath-posix/cbits/dirutils.c similarity index 100% rename from hpath-directory/cbits/dirutils.c rename to hpath-posix/cbits/dirutils.c diff --git a/hpath-directory/cbits/dirutils.h b/hpath-posix/cbits/dirutils.h similarity index 100% rename from hpath-directory/cbits/dirutils.h rename to hpath-posix/cbits/dirutils.h diff --git a/hpath-posix/hpath-posix.cabal b/hpath-posix/hpath-posix.cabal new file mode 100644 index 0000000..c754b4c --- /dev/null +++ b/hpath-posix/hpath-posix.cabal @@ -0,0 +1,56 @@ +cabal-version: >=1.10 + +name: hpath-posix +version: 0.13.0 +synopsis: Some low-level POSIX glue code, that is not in 'unix' +homepage: https://github.com/hasufell/hpath +bug-reports: https://github.com/hasufell/hpath/issues +license: BSD3 +license-file: LICENSE +author: Julian Ospald +maintainer: Julian Ospald +copyright: Julian Ospald 2020 +category: Filesystem +build-type: Simple +extra-source-files: CHANGELOG.md + cbits/dirutils.h +tested-with: GHC==7.10.3 + , GHC==8.0.2 + , GHC==8.2.2 + , GHC==8.4.4 + , GHC==8.6.5 + , GHC==8.8.1 + +library + if os(windows) + build-depends: unbuildable<0 + buildable: False + exposed-modules: System.Posix.RawFilePath.Directory.Traversals + System.Posix.Foreign + System.Posix.FD + -- other-modules: + -- other-extensions: + c-sources: cbits/dirutils.c + build-depends: base >= 4.8 && <5 + , IfElse + , bytestring >= 0.10 + , exceptions >= 0.10 + , hpath-filepath >= 0.10.3 + , safe-exceptions >= 0.1 + , streamly >= 0.7 + , streamly-bytestring >= 0.1.0.1 + , time >= 1.8 + , unix >= 2.5 + , unix-bytestring >= 0.3 + , utf8-string + if impl(ghc < 8.0) + build-depends: + fail >= 4.9 + + hs-source-dirs: src + default-language: Haskell2010 + default-extensions: PackageImports + +source-repository head + type: git + location: https://github.com/hasufell/hpath diff --git a/hpath-directory/src/System/Posix/FD.hs b/hpath-posix/src/System/Posix/FD.hs similarity index 100% rename from hpath-directory/src/System/Posix/FD.hs rename to hpath-posix/src/System/Posix/FD.hs diff --git a/hpath-directory/src/System/Posix/Foreign.hsc b/hpath-posix/src/System/Posix/Foreign.hsc similarity index 100% rename from hpath-directory/src/System/Posix/Foreign.hsc rename to hpath-posix/src/System/Posix/Foreign.hsc diff --git a/hpath-directory/src/System/Posix/RawFilePath/Directory/Traversals.hs b/hpath-posix/src/System/Posix/RawFilePath/Directory/Traversals.hs similarity index 100% rename from hpath-directory/src/System/Posix/RawFilePath/Directory/Traversals.hs rename to hpath-posix/src/System/Posix/RawFilePath/Directory/Traversals.hs