Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package ghc-hslua-module-text for
openSUSE:Factory checked in at 2021-11-11 21:36:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-hslua-module-text (Old)
and /work/SRC/openSUSE:Factory/.ghc-hslua-module-text.new.1890 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-hslua-module-text"
Thu Nov 11 21:36:34 2021 rev:10 rq:930334 version:1.0.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/ghc-hslua-module-text/ghc-hslua-module-text.changes
2020-12-22 11:40:42.233575529 +0100
+++
/work/SRC/openSUSE:Factory/.ghc-hslua-module-text.new.1890/ghc-hslua-module-text.changes
2021-11-11 21:36:48.544905590 +0100
@@ -1,0 +2,16 @@
+Mon Nov 1 08:44:59 UTC 2021 - [email protected]
+
+- Update hslua-module-text to version 1.0.0.
+ ## 1.0.0
+
+ Release pending.
+
+ - Use hslua 2.0.
+
+-------------------------------------------------------------------
+Tue Oct 19 07:23:46 UTC 2021 - [email protected]
+
+- Update hslua-module-text to version 0.3.0.1 revision 1.
+ Upstream has revised the Cabal build instructions on Hackage.
+
+-------------------------------------------------------------------
Old:
----
hslua-module-text-0.3.0.1.tar.gz
New:
----
hslua-module-text-1.0.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-hslua-module-text.spec ++++++
--- /var/tmp/diff_new_pack.8htpwB/_old 2021-11-11 21:36:49.052905961 +0100
+++ /var/tmp/diff_new_pack.8htpwB/_new 2021-11-11 21:36:49.056905963 +0100
@@ -1,7 +1,7 @@
#
# spec file for package ghc-hslua-module-text
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,15 +19,16 @@
%global pkg_name hslua-module-text
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.3.0.1
+Version: 1.0.0
Release: 0
Summary: Lua module for text
License: MIT
URL: https://hackage.haskell.org/package/%{pkg_name}
Source0:
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
BuildRequires: ghc-Cabal-devel
-BuildRequires: ghc-bytestring-devel
-BuildRequires: ghc-hslua-devel
+BuildRequires: ghc-hslua-core-devel
+BuildRequires: ghc-hslua-marshalling-devel
+BuildRequires: ghc-hslua-packaging-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-text-devel
ExcludeArch: %{ix86}
@@ -40,6 +41,9 @@
%description
UTF-8 aware subset of Lua's `string` module.
+This package is part of HsLua, a Haskell framework built around the embeddable
+scripting language <https://lua.org Lua>.
+
%package devel
Summary: Haskell %{pkg_name} library development files
Requires: %{name} = %{version}-%{release}
++++++ hslua-module-text-0.3.0.1.tar.gz -> hslua-module-text-1.0.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/hslua-module-text-0.3.0.1/ChangeLog.md
new/hslua-module-text-1.0.0/ChangeLog.md
--- old/hslua-module-text-0.3.0.1/ChangeLog.md 2001-09-09 03:46:40.000000000
+0200
+++ new/hslua-module-text-1.0.0/ChangeLog.md 2001-09-09 03:46:40.000000000
+0200
@@ -1,5 +1,11 @@
# Revision history for hslua-module-text
+## 1.0.0
+
+Release pending.
+
+- Use hslua 2.0.
+
## 0.3.0.1 -- 2020-10-16
- Relaxed upper bound for hslua, allow `hslua-1.3.*`.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/hslua-module-text-0.3.0.1/LICENSE
new/hslua-module-text-1.0.0/LICENSE
--- old/hslua-module-text-0.3.0.1/LICENSE 2001-09-09 03:46:40.000000000
+0200
+++ new/hslua-module-text-1.0.0/LICENSE 2001-09-09 03:46:40.000000000 +0200
@@ -1,4 +1,4 @@
-Copyright (c) 2017-2020 Albert Krewinkel
+Copyright (c) 2017-2021 Albert Krewinkel
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/hslua-module-text-0.3.0.1/hslua-module-text.cabal
new/hslua-module-text-1.0.0/hslua-module-text.cabal
--- old/hslua-module-text-0.3.0.1/hslua-module-text.cabal 2001-09-09
03:46:40.000000000 +0200
+++ new/hslua-module-text-1.0.0/hslua-module-text.cabal 2001-09-09
03:46:40.000000000 +0200
@@ -1,49 +1,68 @@
+cabal-version: 2.2
name: hslua-module-text
-version: 0.3.0.1
+version: 1.0.0
synopsis: Lua module for text
description: UTF-8 aware subset of Lua's `string` module.
-homepage: https://github.com/hslua/hslua-module-text
+ .
+ This package is part of HsLua, a Haskell framework
+ built around the embeddable scripting language
+ <https://lua.org Lua>.
+homepage: https://github.com/hslua/hslua
license: MIT
license-file: LICENSE
author: Albert Krewinkel
maintainer: [email protected]
-copyright: ?? 2017???2020 Albert Krewinkel
+copyright: ?? 2017???2021 Albert Krewinkel
category: Foreign
-build-type: Simple
extra-source-files: ChangeLog.md
test/test-text.lua
-cabal-version: >=1.10
tested-with: GHC == 8.0.2
, GHC == 8.2.2
, GHC == 8.4.4
, GHC == 8.6.5
, GHC == 8.8.3
- , GHC == 8.10.1
+ , GHC == 8.10.4
+ , GHC == 9.0.1
source-repository head
type: git
- location: https://github.com/hslua/hslua-module-text.git
+ location: https://github.com/hslua/hslua.git
+ subdir: hslua-module-text
+
+common common-options
+ default-language: Haskell2010
+ build-depends: base >= 4.8 && < 5
+ , hslua-core >= 2.0 && < 2.1
+ , hslua-packaging >= 2.0 && < 2.1
+ , text >= 1.0 && < 1.3
+ ghc-options: -Wall
+ -Wincomplete-record-updates
+ -Wnoncanonical-monad-instances
+ -Wredundant-constraints
+ if impl(ghc >= 8.2)
+ ghc-options: -Wcpp-undef
+ -Werror=missing-home-modules
+ if impl(ghc >= 8.4)
+ ghc-options: -Widentities
+ -Wincomplete-uni-patterns
+ -Wpartial-fields
+ -fhide-source-paths
library
- exposed-modules: Foreign.Lua.Module.Text
- build-depends: base >= 4.8 && < 5
- , bytestring >= 0.10.2 && < 0.11
- , hslua >= 1.2 && < 1.4
- , text >= 1 && < 1.3
+ import: common-options
+ exposed-modules: HsLua.Module.Text
hs-source-dirs: src
- default-language: Haskell2010
+ build-depends: hslua-marshalling >= 2.0 && < 2.1
other-extensions: OverloadedStrings
-test-suite test-hslua
- default-language: Haskell2010
+test-suite test-hslua-module-text
+ import: common-options
type: exitcode-stdio-1.0
main-is: test-hslua-module-text.hs
hs-source-dirs: test
ghc-options: -Wall -threaded
- build-depends: base
- , hslua
- , hslua-module-text
- , tasty
- , tasty-hunit
- , tasty-lua >= 0.2 && < 0.3
- , text
\ No newline at end of file
+ build-depends: hslua-module-text
+ , tasty >= 0.11
+ , tasty-hunit >= 0.9
+ , tasty-lua >= 1.0 && < 1.1
+ , text
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/hslua-module-text-0.3.0.1/src/Foreign/Lua/Module/Text.hs
new/hslua-module-text-1.0.0/src/Foreign/Lua/Module/Text.hs
--- old/hslua-module-text-0.3.0.1/src/Foreign/Lua/Module/Text.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/hslua-module-text-1.0.0/src/Foreign/Lua/Module/Text.hs 1970-01-01
01:00:00.000000000 +0100
@@ -1,157 +0,0 @@
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE TypeApplications #-}
-{-|
-Module : Foreign.Lua.Module.Text
-Copyright : ?? 2017???2020 Albert Krewinkel
-License : MIT
-Maintainer : Albert Krewinkel <[email protected]>
-Stability : alpha
-Portability : ForeignFunctionInterface
-
-Provide a lua module containing a selection of useful Text functions.
--}
-module Foreign.Lua.Module.Text
-
- ( -- * Module
- pushModule
- , preloadModule
- , documentedModule
- , description
- , functions
-
- -- * Legacy
- , pushModuleText
- , preloadTextModule
- ) where
-
-import Prelude hiding (reverse)
-import Control.Applicative ((<$>))
-import Data.ByteString (ByteString)
-import Data.Text (Text)
-import Data.Maybe (fromMaybe)
-import Foreign.Lua (NumResults, Lua, Peekable, Pushable, ToHaskellFunction)
-import Foreign.Lua.Call
-import Foreign.Lua.Module hiding (preloadModule, pushModule)
-import Foreign.Lua.Peek (Peeker, peekIntegral, peekText)
-import Foreign.Lua.Push (pushIntegral, pushText)
-import qualified Foreign.Lua as Lua
-import qualified Data.Text as T
-
-import qualified Foreign.Lua.Module as Module
---
--- Module
---
-
--- | Textual description of the "text" module.
-description :: Text
-description =
- "UTF-8 aware text manipulation functions, implemented in Haskell."
-
-documentedModule :: Module
-documentedModule = Module
- { moduleName = "paths"
- , moduleFields = []
- , moduleDescription = description
- , moduleFunctions = functions
- }
-
--- | Pushes the @text@ module to the Lua stack.
-pushModule :: Lua NumResults
-pushModule = 1 <$ Module.pushModule documentedModule
-
-pushModuleText :: Lua NumResults
-pushModuleText = 1 <$ Module.pushModule documentedModule
-
--- | Add the @text@ module under the given name to the table of
--- preloaded packages.
-preloadModule :: String -> Lua ()
-preloadModule name = Module.preloadModule $
- documentedModule { moduleName = T.pack name }
-
--- | Add the text module under the given name to the table of preloaded
--- packages.
-preloadTextModule :: String -> Lua ()
-preloadTextModule = flip Lua.preloadhs pushModuleText
-
---
--- Functions
---
-
-functions :: [(Text, HaskellFunction)]
-functions =
- [ ("len", len)
- , ("lower", lower)
- , ("reverse", reverse)
- , ("sub", sub)
- , ("upper", upper)
- ]
-
--- | Wrapper for @'T.length'@.
-len :: HaskellFunction
-len = toHsFnPrecursor T.length
- <#> textParam "s"
- =#> intResult "length"
- #? "Determines the number of characters in a string."
-
--- | Wrapper for @'T.toLower'@.
-lower :: HaskellFunction
-lower = toHsFnPrecursor T.toLower
- <#> textParam "s"
- =#> textResult "Lowercase copy of `s`"
- #? "Convert a string to lower case"
-
--- | Wrapper for @'T.reverse'@.
-reverse :: HaskellFunction
-reverse = toHsFnPrecursor T.reverse
- <#> textParam "s"
- =#> textResult "Reversed `s`"
- #? "Reverses a string."
-
--- | Returns a substring, using Lua's string indexing rules.
-sub :: HaskellFunction
-sub = toHsFnPrecursor substring
- <#> textParam "s"
- <#> textIndex "i" "substring start position"
- <#> textOptionalIndex "j" "substring end position"
- =#> textResult "text substring"
- #? "Returns a substring, using Lua's string indexing rules."
- where
- substring :: Text -> Int -> Maybe Int -> Text
- substring s i jopt =
- let j = fromMaybe (-1) jopt
- fromStart = if i >= 0 then i - 1 else T.length s + i
- fromEnd = if j < 0 then -j - 1 else T.length s - j
- in T.dropEnd fromEnd . T.drop fromStart $ s
-
--- | Wrapper for @'T.toUpper'@.
-upper :: HaskellFunction
-upper = toHsFnPrecursor T.toUpper
- <#> textParam "s"
- =#> textResult "Lowercase copy of `s`"
- #? "Convert a string to lower case"
-
---
--- Parameters
---
-
-textParam :: Text -> Parameter Text
-textParam name =
- parameter peekText "string" name "UTF-8 encoded string"
-
-textIndex :: Text -> Text -> Parameter Int
-textIndex = parameter (peekIntegral @Int) "integer"
-
-textOptionalIndex :: Text -> Text -> Parameter (Maybe Int)
-textOptionalIndex = optionalParameter (peekIntegral @Int) "integer"
-
---
--- Results
---
-
-textResult :: Text -- ^ Description
- -> FunctionResults Text
-textResult = functionResult pushText "string"
-
-intResult :: Text -- ^ Description
- -> FunctionResults Int
-intResult = functionResult (pushIntegral @Int) "integer"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/hslua-module-text-0.3.0.1/src/HsLua/Module/Text.hs
new/hslua-module-text-1.0.0/src/HsLua/Module/Text.hs
--- old/hslua-module-text-0.3.0.1/src/HsLua/Module/Text.hs 1970-01-01
01:00:00.000000000 +0100
+++ new/hslua-module-text-1.0.0/src/HsLua/Module/Text.hs 2001-09-09
03:46:40.000000000 +0200
@@ -0,0 +1,125 @@
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE TypeApplications #-}
+{-|
+Module : HsLua.Module.Text
+Copyright : ?? 2017???2021 Albert Krewinkel
+License : MIT
+Maintainer : Albert Krewinkel <[email protected]>
+Stability : alpha
+Portability : ForeignFunctionInterface
+
+Provides a Lua module containing a selection of useful Text functions.
+-}
+module HsLua.Module.Text
+ ( -- * Module
+ documentedModule
+ -- ** Functions
+ , len
+ , lower
+ , reverse
+ , sub
+ , upper
+ ) where
+
+import Prelude hiding (reverse)
+import Data.Text (Text)
+import Data.Maybe (fromMaybe)
+import HsLua.Marshalling (peekIntegral, peekText, pushIntegral, pushText)
+import HsLua.Packaging
+import qualified Data.Text as T
+
+-- | The @text@ module.
+documentedModule :: Module e
+documentedModule = Module
+ { moduleName = "text"
+ , moduleOperations = []
+ , moduleFields = []
+ , moduleFunctions =
+ [ len
+ , lower
+ , reverse
+ , sub
+ , upper
+ ]
+ , moduleDescription =
+ "UTF-8 aware text manipulation functions, implemented in Haskell."
+ }
+
+--
+-- Functions
+--
+
+-- | Wrapper for @'T.length'@.
+len :: DocumentedFunction e
+len = defun "len"
+ ### liftPure T.length
+ <#> textParam "s"
+ =#> intResult "length"
+ #? "Determines the number of characters in a string."
+
+-- | Wrapper for @'T.toLower'@.
+lower :: DocumentedFunction e
+lower = defun "lower"
+ ### liftPure T.toLower
+ <#> textParam "s"
+ =#> textResult "Lowercase copy of `s`"
+ #? "Converts a string to lower case."
+
+-- | Wrapper for @'T.reverse'@.
+reverse :: DocumentedFunction e
+reverse = defun "reverse"
+ ### liftPure T.reverse
+ <#> textParam "s"
+ =#> textResult "Reversed `s`"
+ #? "Reverses a string."
+
+-- | Returns a substring, using Lua's string indexing rules.
+sub :: DocumentedFunction e
+sub = defun "sub"
+ ### liftPure3 substring
+ <#> textParam "s"
+ <#> textIndex "i" "substring start position"
+ <#> textOptionalIndex "j" "substring end position"
+ =#> textResult "text substring"
+ #? "Returns a substring, using Lua's string indexing rules."
+ where
+ substring :: Text -> Int -> Maybe Int -> Text
+ substring s i jopt =
+ let j = fromMaybe (-1) jopt
+ fromStart = if i >= 0 then i - 1 else T.length s + i
+ fromEnd = if j < 0 then -j - 1 else T.length s - j
+ in T.dropEnd fromEnd . T.drop fromStart $ s
+
+-- | Wrapper for @'T.toUpper'@.
+upper :: DocumentedFunction e
+upper = defun "upper"
+ ### liftPure T.toUpper
+ <#> textParam "s"
+ =#> textResult "Uppercase copy of `s`"
+ #? "Converts a string to upper case."
+
+--
+-- Parameters
+--
+
+textParam :: Text -> Parameter e Text
+textParam name =
+ parameter peekText "string" name "UTF-8 encoded string"
+
+textIndex :: Text -> Text -> Parameter e Int
+textIndex = parameter (peekIntegral @Int) "integer"
+
+textOptionalIndex :: Text -> Text -> Parameter e (Maybe Int)
+textOptionalIndex = optionalParameter (peekIntegral @Int) "integer"
+
+--
+-- Results
+--
+
+textResult :: Text -- ^ Description
+ -> FunctionResults e Text
+textResult = functionResult pushText "string"
+
+intResult :: Text -- ^ Description
+ -> FunctionResults e Int
+intResult = functionResult (pushIntegral @Int) "integer"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/hslua-module-text-0.3.0.1/test/test-hslua-module-text.hs
new/hslua-module-text-1.0.0/test/test-hslua-module-text.hs
--- old/hslua-module-text-0.3.0.1/test/test-hslua-module-text.hs
2001-09-09 03:46:40.000000000 +0200
+++ new/hslua-module-text-1.0.0/test/test-hslua-module-text.hs 2001-09-09
03:46:40.000000000 +0200
@@ -1,40 +1,32 @@
-{-
-Copyright ?? 2017???2020 Albert Krewinkel
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE TypeApplications #-}
+{-|
+Module : Main
+Copyright : ?? 2017-2021 Albert Krewinkel
+License : MIT
+Maintainer : Albert Krewinkel <[email protected]>
+Stability : stable
+Portability : Requires language extensions ForeignFunctionInterface,
+ OverloadedStrings.
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
+Tests for the `text` Lua module.
-}
-{-# LANGUAGE OverloadedStrings #-}
+module Main (main) where
import Control.Monad (void)
-import Foreign.Lua (Lua)
-import Foreign.Lua.Module.Text (preloadTextModule, pushModuleText)
+import HsLua.Core as Lua
+import HsLua.Packaging
+import HsLua.Module.Text (documentedModule)
import Test.Tasty (TestTree, defaultMain, testGroup)
import Test.Tasty.HUnit (assertEqual, testCase)
import Test.Tasty.Lua (translateResultsFromFile)
-import qualified Foreign.Lua as Lua
-
main :: IO ()
main = do
- luaTest <- Lua.run $ do
- Lua.openlibs
- Lua.requirehs "text" (void pushModuleText)
+ luaTest <- run @Lua.Exception $ do
+ openlibs
+ registerModule documentedModule
+ pop 1
translateResultsFromFile "test/test-text.lua"
defaultMain $ testGroup "hslua-module-text" [tests, luaTest]
@@ -42,21 +34,21 @@
tests :: TestTree
tests = testGroup "FromLuaStack"
[ testCase "text module can be pushed to the stack" $
- Lua.run (void pushModuleText)
+ run (void (pushModule documentedModule) :: Lua ())
- , testCase "text module can be added to the preloader" . Lua.run $ do
- Lua.openlibs
- preloadTextModule "hstext"
- assertEqual' "function not added to preloader" Lua.TypeFunction =<< do
- Lua.getglobal' "package.preload.hstext"
- Lua.ltype (-1)
-
- , testCase "text module can be loaded as hstext" . Lua.run $ do
- Lua.openlibs
- preloadTextModule "hstext"
- assertEqual' "loading the module fails " Lua.OK =<<
- Lua.dostring "require 'hstext'"
+ , testCase "text module can be added to the preloader" . run $ do
+ openlibs
+ preloadModule documentedModule
+ assertEqual' "function not added to preloader" TypeFunction =<< do
+ _ <- dostring "return package.preload.text"
+ ltype top
+
+ , testCase "text module can be loaded as hstext" . run $ do
+ openlibs
+ preloadModuleWithName documentedModule "hstext"
+ assertEqual' "loading the module fails " OK =<<
+ dostring "require 'hstext'"
]
assertEqual' :: (Show a, Eq a) => String -> a -> a -> Lua ()
-assertEqual' msg expected = Lua.liftIO . assertEqual msg expected
+assertEqual' msg expected = liftIO . assertEqual msg expected
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/hslua-module-text-0.3.0.1/test/test-text.lua
new/hslua-module-text-1.0.0/test/test-text.lua
--- old/hslua-module-text-0.3.0.1/test/test-text.lua 2001-09-09
03:46:40.000000000 +0200
+++ new/hslua-module-text-1.0.0/test/test-text.lua 2001-09-09
03:46:40.000000000 +0200
@@ -46,13 +46,13 @@
test('capitalized word with umlaut', function ()
assert.are_equal(text.upper 'L??beck', 'L??BECK')
end),
- test('German ?? becomes double S', function ()
+ test('German eszett becomes double S', function ()
assert.are_equal(text.upper 'Spa??', 'SPASS')
end),
},
group 'reverse' {
- test('??tre becomes ert??', function ()
+ test('reverse word with accent circumflex', function ()
assert.are_equal(text.reverse '??tre', 'ert??')
end)
},