commit ghc-autoexporter for openSUSE:Factory
Hello community, here is the log from the commit of package ghc-autoexporter for openSUSE:Factory checked in at 2017-08-31 20:46:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-autoexporter (Old) and /work/SRC/openSUSE:Factory/.ghc-autoexporter.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "ghc-autoexporter" Thu Aug 31 20:46:15 2017 rev:2 rq:513205 version:1.1.1 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-autoexporter/ghc-autoexporter.changes 2017-05-09 18:15:46.837800817 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-autoexporter.new/ghc-autoexporter.changes 2017-08-31 20:46:17.293145620 +0200 @@ -1,0 +2,5 @@ +Thu Jul 27 14:04:55 UTC 2017 - psimons@suse.com + +- Update to version 1.1.1 revision 1. + +------------------------------------------------------------------- Old: ---- autoexporter-1.0.0.tar.gz New: ---- autoexporter-1.1.1.tar.gz autoexporter.cabal ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-autoexporter.spec ++++++ --- /var/tmp/diff_new_pack.k6X2iG/_old 2017-08-31 20:46:18.680950823 +0200 +++ /var/tmp/diff_new_pack.k6X2iG/_new 2017-08-31 20:46:18.684950261 +0200 @@ -18,13 +18,14 @@ %global pkg_name autoexporter Name: ghc-%{pkg_name} -Version: 1.0.0 +Version: 1.1.1 Release: 0 Summary: Automatically re-export modules License: MIT Group: Development/Languages/Other Url: https://hackage.haskell.org/package/%{pkg_name} Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz +Source1: https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/1.cabal#/%{pkg_name}.cabal BuildRequires: chrpath BuildRequires: ghc-Cabal-devel BuildRequires: ghc-directory-devel @@ -48,6 +49,7 @@ %prep %setup -q -n %{pkg_name}-%{version} +cp -p %{SOURCE1} %{pkg_name}.cabal %build %ghc_lib_build ++++++ autoexporter-1.0.0.tar.gz -> autoexporter-1.1.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoexporter-1.0.0/README.markdown new/autoexporter-1.1.1/README.markdown --- old/autoexporter-1.0.0/README.markdown 2016-12-30 16:53:13.000000000 +0100 +++ new/autoexporter-1.1.1/README.markdown 2017-07-22 21:36:12.000000000 +0200 @@ -54,11 +54,16 @@ Autoexporter will generally behave as you'd expect, but there are a couple things to look out for: -- Only immediate children will be re-exported. If you use this in some module - `M`, it won't pull in `M.A.B`. - - You cannot selectively include or exclude any modules. +- By default, only immediate children will be re-exported. If you use this in + some module `M`, it won't pull in `M.A.B`. If you need deep re-exporting, + please pass `--deep` to Autoexporter like this: + +```haskell +{-# OPTIONS_GHC -F -pgmF autoexporter -optF --deep #-} +``` + [Autoexporter]: https://github.com/tfausak/autoexporter [Version badge]: https://www.stackage.org/package/autoexporter/badge/nightly?label=version [version]: https://www.stackage.org/nightly/package/autoexporter diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoexporter-1.0.0/autoexporter.cabal new/autoexporter-1.1.1/autoexporter.cabal --- old/autoexporter-1.0.0/autoexporter.cabal 2016-12-30 16:55:06.000000000 +0100 +++ new/autoexporter-1.1.1/autoexporter.cabal 2017-07-22 21:37:03.000000000 +0200 @@ -1,9 +1,9 @@ --- This file has been generated from package.yaml by hpack version 0.15.0. +-- This file has been generated from package.yaml by hpack version 0.17.0. -- -- see: https://github.com/sol/hpack name: autoexporter -version: 1.0.0 +version: 1.1.1 synopsis: Automatically re-export modules. description: Autoexporter automatically re-exports modules. category: Utility @@ -32,7 +32,7 @@ build-depends: base >=4.7 && <4.10 , Cabal >=1.22 && <1.25 - , directory >=1.2 && <1.4 + , directory >=1.2.5 && <1.4 , filepath >=1.3 && <1.5 exposed-modules: Autoexporter diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoexporter-1.0.0/package.yaml new/autoexporter-1.1.1/package.yaml --- old/autoexporter-1.0.0/package.yaml 2016-12-30 16:54:52.000000000 +0100 +++ new/autoexporter-1.1.1/package.yaml 2017-07-22 21:36:12.000000000 +0200 @@ -19,7 +19,7 @@ dependencies: - base >=4.7 && <4.10 - Cabal >=1.22 && <1.25 - - directory >=1.2 && <1.4 + - directory >=1.2.5 && <1.4 - filepath >=1.3 && <1.5 source-dirs: source/library license: MIT @@ -27,4 +27,4 @@ maintainer: Taylor Fausak name: autoexporter synopsis: Automatically re-export modules. -version: '1.0.0' +version: '1.1.1' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoexporter-1.0.0/source/library/Autoexporter.hs new/autoexporter-1.1.1/source/library/Autoexporter.hs --- old/autoexporter-1.0.0/source/library/Autoexporter.hs 2016-12-30 16:48:05.000000000 +0100 +++ new/autoexporter-1.1.1/source/library/Autoexporter.hs 2017-07-22 21:36:12.000000000 +0200 @@ -2,12 +2,16 @@ import qualified Data.List as List import qualified Data.Maybe as Maybe +import qualified Data.Traversable as Traversable import qualified Distribution.ModuleName as ModuleName import qualified Distribution.Text as Text import qualified System.Directory as Directory import qualified System.Environment as Environment import qualified System.FilePath as FilePath +data ExportScope = ExportScopeShallow + | ExportScopeDeep + main :: IO () main = do args <- Environment.getArgs @@ -16,17 +20,39 @@ mainWithArgs :: [String] -> IO () mainWithArgs args = case args of - [name, inputFile, outputFile] -> autoexport name inputFile outputFile + [name, inputFile, outputFile, "--deep"] -> + autoexport ExportScopeDeep name inputFile outputFile + [name, inputFile, outputFile] -> + autoexport ExportScopeShallow name inputFile outputFile _ -> fail ("unexpected arguments: " ++ show args) -autoexport :: String -> FilePath -> FilePath -> IO () -autoexport name inputFile outputFile = do +autoexport :: ExportScope -> String -> FilePath -> FilePath -> IO () +autoexport exportScope name inputFile outputFile = do let moduleName = makeModuleName name let directory = FilePath.dropExtension inputFile - files <- Directory.getDirectoryContents directory + files <- findFiles exportScope directory let output = makeOutput moduleName directory files writeFile outputFile output +findFiles :: ExportScope -> FilePath -> IO [FilePath] +findFiles exportScope dir = + case exportScope of + ExportScopeShallow -> + fmap (filter isHaskellFile) (Directory.listDirectory dir) + ExportScopeDeep -> + findFilesDeep dir + +findFilesDeep :: FilePath -> IO [FilePath] +findFilesDeep dir = do + rootItems <- Directory.listDirectory dir + childItems <- Traversable.for rootItems $ \item -> do + let path = dir FilePath.</> item + dirExists <- Directory.doesDirectoryExist path + if dirExists + then fmap (fmap (item FilePath.</>)) (findFilesDeep path) + else pure [] + pure $ mconcat (filter isHaskellFile rootItems : childItems) + makeModuleName :: FilePath -> String makeModuleName name = let path = FilePath.dropExtension name diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoexporter-1.0.0/stack.yaml new/autoexporter-1.1.1/stack.yaml --- old/autoexporter-1.0.0/stack.yaml 2016-12-30 17:08:53.000000000 +0100 +++ new/autoexporter-1.1.1/stack.yaml 2017-07-22 21:36:12.000000000 +0200 @@ -1 +1 @@ -resolver: lts-7.14 +resolver: lts-8.0 ++++++ autoexporter.cabal ++++++ -- This file has been generated from package.yaml by hpack version 0.17.0. -- -- see: https://github.com/sol/hpack name: autoexporter version: 1.1.1 x-revision: 1 synopsis: Automatically re-export modules. description: Autoexporter automatically re-exports modules. category: Utility homepage: https://github.com/tfausak/autoexporter#readme bug-reports: https://github.com/tfausak/autoexporter/issues maintainer: Taylor Fausak license: MIT license-file: LICENSE.markdown build-type: Simple cabal-version: >= 1.10 extra-source-files: CHANGELOG.markdown package.yaml README.markdown stack.yaml source-repository head type: git location: https://github.com/tfausak/autoexporter library hs-source-dirs: source/library ghc-options: -Wall build-depends: base >=4.8 && <4.10 , Cabal >=1.22 && <1.25 , directory >=1.2.5 && <1.4 , filepath >=1.3 && <1.5 exposed-modules: Autoexporter default-language: Haskell2010 executable autoexporter main-is: Main.hs hs-source-dirs: source/executable ghc-options: -Wall build-depends: base , autoexporter default-language: Haskell2010
participants (1)
-
root@hilbert.suse.de