[Git][haskell-team/DHG_packages][master] 7 commits: Initial packaging of filepath-bytestring-1.4.2.1.0

Sean Whitton gitlab at salsa.debian.org
Wed Dec 11 23:11:48 GMT 2019



Sean Whitton pushed to branch master at Debian Haskell Group / DHG_packages


Commits:
a8d7cb8a by Sean Whitton at 2019-12-11T22:30:29Z
Initial packaging of filepath-bytestring-1.4.2.1.0

- - - - -
fd5d668d by Sean Whitton at 2019-12-11T22:52:19Z
filepath-bytestring: add missing Generate.hs to source package

from upstream git tree

- - - - -
b33db591 by Sean Whitton at 2019-12-11T22:52:23Z
filepath-bytestring: add quickcheck build-dep

- - - - -
78d5ba92 by Sean Whitton at 2019-12-11T22:55:03Z
filepath-bytestring: drop to debhelper compat 10 for CDBS

- - - - -
719e1a4c by Sean Whitton at 2019-12-11T23:06:43Z
filepath-bytestring: fixes to description from Lintian

- - - - -
590fbe1e by Sean Whitton at 2019-12-11T23:07:10Z
filepath-bytestring: upload to NEW

- - - - -
701dae4c by Sean Whitton at 2019-12-11T23:11:40Z
Merge branch 'master' of https://salsa.debian.org/haskell-team/DHG_packages

- - - - -


8 changed files:

- + p/haskell-filepath-bytestring/debian/changelog
- + p/haskell-filepath-bytestring/debian/compat
- + p/haskell-filepath-bytestring/debian/control
- + p/haskell-filepath-bytestring/debian/copyright
- + p/haskell-filepath-bytestring/debian/missing-sources/Generate.hs
- + p/haskell-filepath-bytestring/debian/rules
- + p/haskell-filepath-bytestring/debian/source/format
- + p/haskell-filepath-bytestring/debian/watch


Changes:

=====================================
p/haskell-filepath-bytestring/debian/changelog
=====================================
@@ -0,0 +1,11 @@
+haskell-filepath-bytestring (1.4.2.1.0-1) unstable; urgency=medium
+
+  * Initial release.
+
+ -- Sean Whitton <spwhitton at spwhitton.name>  Wed, 11 Dec 2019 16:06:57 -0700
+
+filepath-bytestring (1.4.2.1.0) unstable; urgency=medium
+
+  * Initial release, based on filepath 1.4.2.1.
+
+ -- Joey Hess <id at joeyh.name>  Tue, 10 Dec 2019 15:21:14 -0400


=====================================
p/haskell-filepath-bytestring/debian/compat
=====================================
@@ -0,0 +1 @@
+10


=====================================
p/haskell-filepath-bytestring/debian/control
=====================================
@@ -0,0 +1,74 @@
+Source: haskell-filepath-bytestring
+Maintainer: Debian Haskell Group <pkg-haskell-maintainers at lists.alioth.debian.org>
+Uploaders: Sean Whitton <spwhitton at spwhitton.name>
+Priority: optional
+Section: haskell
+Build-Depends: debhelper (>= 10),
+ haskell-devscripts-minimal | haskell-devscripts (>= 0.9),
+ cdbs,
+ ghc,
+ ghc-prof,
+ libghc-quickcheck2-dev (>= 2.7) <!nocheck>,
+ libghc-quickcheck2-dev (<< 2.14) <!nocheck>,
+Build-Depends-Indep: ghc-doc,
+Standards-Version: 4.4.1
+Homepage: https://hackage.haskell.org/package/filepath-bytestring
+Vcs-Browser: https://salsa.debian.org/haskell-team/DHG_packages/tree/master/p/haskell-filepath-bytestring
+Vcs-Git: https://salsa.debian.org/haskell-team/DHG_packages.git
+X-Description: library for manipulating RawFilePaths
+ This package provides functionality for manipulating RawFilePath
+ values. It can be used as a drop in replacement for the filepath library
+ to get the benefits of using ByteStrings. It provides three modules:
+ .
+   * "System.FilePath.Posix.ByteString" manipulates POSIX/Linux style
+   RawFilePath values (with / as the path separator).
+ .
+   * "System.FilePath.Windows.ByteString" manipulates Windows style
+   RawFilePath values (with either \ or / as the path separator, and
+   deals with drives).
+ .
+   * "System.FilePath.ByteString" is an alias for the module
+   appropriate to your platform.
+ .
+ All three modules provide the same API, and the same documentation
+ (calling out differences in the different variants).
+
+Package: libghc-filepath-bytestring-dev
+Architecture: any
+Depends: ${haskell:Depends},
+ ${misc:Depends},
+ ${shlibs:Depends},
+Recommends: ${haskell:Recommends},
+Suggests: ${haskell:Suggests},
+Conflicts: ${haskell:Conflicts},
+Provides: ${haskell:Provides},
+Description: ${haskell:ShortDescription}${haskell:ShortBlurb}
+ ${haskell:LongDescription}
+ .
+ ${haskell:Blurb}
+
+Package: libghc-filepath-bytestring-prof
+Architecture: any
+Depends: ${haskell:Depends},
+ ${misc:Depends},
+Recommends: ${haskell:Recommends},
+Suggests: ${haskell:Suggests},
+Conflicts: ${haskell:Conflicts},
+Provides: ${haskell:Provides},
+Description: ${haskell:ShortDescription}${haskell:ShortBlurb}
+ ${haskell:LongDescription}
+ .
+ ${haskell:Blurb}
+
+Package: libghc-filepath-bytestring-doc
+Architecture: all
+Section: doc
+Depends: ${haskell:Depends},
+ ${misc:Depends},
+Recommends: ${haskell:Recommends},
+Suggests: ${haskell:Suggests},
+Conflicts: ${haskell:Conflicts},
+Description: ${haskell:ShortDescription}${haskell:ShortBlurb}
+ ${haskell:LongDescription}
+ .
+ ${haskell:Blurb}


=====================================
p/haskell-filepath-bytestring/debian/copyright
=====================================
@@ -0,0 +1,44 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: filepath-bytestring
+Upstream-Contact: Joey Hess <id at joeyh.name>
+Source: https://hackage.haskell.org/package/filepath-bytestring
+
+Files: *
+Copyright: (C) 2005-2019 Neil Mitchell
+ (C) 2019 Joey Hess
+License: BSD-3-clause
+
+Files: debian/*
+Copyright: (C) 2019 Sean Whitton <spwhitton at spwhitton.name>
+License: BSD-3-clause
+
+License: BSD-3-clause
+ 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 Neil Mitchell 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.


=====================================
p/haskell-filepath-bytestring/debian/missing-sources/Generate.hs
=====================================
@@ -0,0 +1,174 @@
+{-# LANGUAGE RecordWildCards, ViewPatterns #-}
+
+module Generate(main) where
+
+import Control.Exception
+import Control.Monad
+import Data.Char
+import Data.List
+import System.Directory
+import System.IO
+
+equivtests :: [(Int, String)]
+equivtests =
+        [ (0, "isPathSeparator")
+        , (0, "isSearchPathSeparator")
+        , (0, "isExtSeparator")
+        , (1, "splitExtension")
+        , (1, "takeExtension")
+        , (2, "replaceExtension")
+        , (1, "dropExtension")
+        , (2, "addExtension")
+        , (1, "hasExtension")
+        , (1, "splitExtensions")
+        , (1, "dropExtensions")
+        , (1, "takeExtensions")
+        , (2, "replaceExtensions")
+        , (2, "isExtensionOf")
+        , (2, "stripExtension")
+        , (1, "splitFileName")
+        , (1, "takeFileName")
+        , (2, "replaceFileName")
+        , (1, "dropFileName")
+        , (1, "takeBaseName")
+        , (2, "replaceBaseName")
+        , (1, "takeDirectory")
+        , (2, "replaceDirectory")
+        , (2, "combine")
+        , (1, "splitPath")
+        , (3, "joinPath")
+        , (1, "splitDirectories")
+        , (1, "splitDrive")
+        , (2, "joinDrive")
+        , (1, "takeDrive")
+        , (1, "hasDrive")
+        , (1, "dropDrive")
+        , (1, "isDrive")
+        , (1, "hasTrailingPathSeparator")
+        , (1, "addTrailingPathSeparator")
+        , (1, "dropTrailingPathSeparator")
+        ]
+
+main :: IO ()
+main = do
+    src <- readFile "System/FilePath/Internal.hs"
+    let tests = map renderTest $ concatMap parseTest $ lines src
+    writeFileBinaryChanged "tests/TestGen.hs" $ unlines $
+        ["-- GENERATED CODE: See ../Generate.hs"
+        ,"{-# LANGUAGE OverloadedStrings #-}"
+        ,"module TestGen(tests) where"
+        ,"import TestUtil"
+        ,"import Data.Char"
+        ,"import qualified System.FilePath.Windows.ByteString as W"
+        ,"import qualified System.FilePath.Posix.ByteString as P"
+        ,"import Data.ByteString (isPrefixOf, isSuffixOf, null, any)"
+        ,"import Prelude hiding (isPrefixOf, isSuffixOf, null, any)"
+        --,"{-# ANN module \"HLint: ignore\" #-}"
+        ,"tests :: [(String, Property)]"
+        ,"tests ="] ++
+        ["    " ++ c ++ "(" ++ show t1 ++ ", " ++ t2 ++ ")" | (c,(t1,t2)) <- zip ("[":repeat ",") tests] ++
+        ["    ]"]
+
+    let mkequivs porw l = ["    " ++ c ++ "(" ++ show ("equiv " ++ porw ++ "." ++ t2) ++ ", equiv_" ++ show t1 ++ " Our" ++ porw ++ "." ++ t2 ++ " Their" ++ porw ++ "." ++ t2 ++ ")" | (c,(t1,t2)) <- l]
+    writeFileBinaryChanged "tests/TestEquiv.hs" $ unlines $
+        ["-- GENERATED CODE: See ../Generate.hs"
+        ,"module TestEquiv(equivtests) where"
+        ,"import TestUtil"
+        ,"import System.FilePath.ByteString (RawFilePath)"
+        ,"import qualified System.FilePath.Windows.ByteString as OurWindows"
+        ,"import qualified System.FilePath.Windows as TheirWindows"
+        ,"import qualified System.FilePath.Posix.ByteString as OurPosix"
+        ,"import qualified System.FilePath.Posix as TheirPosix"
+        ,"equivtests :: [(String, Property)]"
+        ,"equivtests ="] ++
+        mkequivs "Posix" (zip ("[":repeat ",") equivtests) ++
+        mkequivs "Windows" (zip (repeat ",") equivtests) ++
+        ["    ]"]
+
+data PW = P | W deriving Show -- Posix or Windows
+data Test = Test
+    {testPlatform :: PW
+    ,testVars :: [(String,String)]   -- generator constructor, variable
+    ,testBody :: [String]
+    }
+
+
+parseTest :: String -> [Test]
+parseTest (stripPrefix "-- > " -> Just x) = platform $ toLexemes x
+    where
+        platform ("untested":x) = []
+        platform ("Windows":":":x) = [valid W x]
+        platform ("Posix"  :":":x) = [valid P x]
+        platform x                 = [valid P x, valid W x]
+
+        valid p ("Valid":x) = free p a $ drop 1 b
+            where (a,b) = break (== "=>") x
+        valid p x = free p [] x
+
+        free p val x = Test p [(ctor v, v) | v <- vars] x
+            where vars = nub $ sort [v | v@[c] <- x, isAlpha c]
+                  ctor v | v < "x" = ""
+                         | v `elem` val = "QFilePathValid" ++ show p
+                         | otherwise = "QFilePath"
+parseTest _ = []
+
+
+toLexemes :: String -> [String]
+toLexemes x = case lex x of
+    [("","")] -> []
+    [(x,y)] -> x : toLexemes y
+    y -> error $ "Generate.toLexemes, " ++ show x ++ " -> " ++ show y
+
+
+fromLexemes :: [String] -> String
+fromLexemes = unwords . f
+    where
+        f ("`":x:"`":xs) = ("`" ++ x ++ "`") : f xs
+        f (x:y:xs) | x `elem` ["[","("] || y `elem` [",",")","]"] = f $ (x ++ y) : xs
+        f (x:xs) = x : f xs
+        f [] = []
+
+
+renderTest :: Test -> (String, String)
+renderTest Test{..} = (body, code)
+    where
+        code = "property $ " ++ if null testVars then body else "\\" ++ unwords vars ++ " -> " ++ convvars body
+        vars = [if null ctor then v else "(" ++ ctor ++ " " ++ ('v':v) ++ ")" | (ctor,v) <- testVars]
+
+        convvars = convvars' $ map snd $ filter (not . null . fst) testVars
+        convvars' [] b = b
+        convvars' (v:vs) b = convvars' vs $
+                "let " ++ v ++ " = toRawFilePath v" ++ v ++ " in " ++ b
+
+        body = fromLexemes $ map (qualify testPlatform) testBody
+
+
+qualify :: PW -> String -> String
+qualify pw str
+    | str `elem` fpops || (all isAlpha str && length str > 1 && str `notElem` prelude) = show pw ++ "." ++ str
+    | otherwise = str
+    where
+        prelude = ["elem","uncurry","snd","fst","not","null","if","then","else"
+                  ,"True","False","Just","Nothing","fromJust","concat","isPrefixOf","isSuffixOf","any"
+                  ,"fromIntegral","ord","mempty","mconcat"]
+        fpops = ["</>","<.>","-<.>"]
+
+
+---------------------------------------------------------------------
+-- UTILITIES
+
+writeFileBinary :: FilePath -> String -> IO ()
+writeFileBinary file x = withBinaryFile file WriteMode $ \h -> hPutStr h x
+
+readFileBinary' :: FilePath -> IO String
+readFileBinary' file = withBinaryFile file ReadMode $ \h -> do
+    s <- hGetContents h
+    evaluate $ length s
+    return s
+
+writeFileBinaryChanged :: FilePath -> String -> IO ()
+writeFileBinaryChanged file x = do
+    b <- doesFileExist file
+    old <- if b then fmap Just $ readFileBinary' file else return Nothing
+    when (Just x /= old) $
+        writeFileBinary file x


=====================================
p/haskell-filepath-bytestring/debian/rules
=====================================
@@ -0,0 +1,9 @@
+#!/usr/bin/make -f
+
+DEB_SETUP_BIN_NAME = debian/hlibrary.setup
+DEB_CABAL_PACKAGE = filepath-bytestring
+DEB_DEFAULT_COMPILER = ghc
+DEB_ENABLE_TESTS = yes
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/hlibrary.mk


=====================================
p/haskell-filepath-bytestring/debian/source/format
=====================================
@@ -0,0 +1 @@
+3.0 (quilt)


=====================================
p/haskell-filepath-bytestring/debian/watch
=====================================
@@ -0,0 +1,2 @@
+version=3
+https://hackage.haskell.org/package/filepath-bytestring/distro-monitor .*-([0-9\.]+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))



View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/compare/14262f55bf09b39d3e687fbcdeb04a73fc987da9...701dae4c539c034537ff92de4749e62c98ff2040

-- 
View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/compare/14262f55bf09b39d3e687fbcdeb04a73fc987da9...701dae4c539c034537ff92de4749e62c98ff2040
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-haskell-commits/attachments/20191211/504c35c2/attachment-0001.html>


More information about the Pkg-haskell-commits mailing list