Hello community,
here is the log from the commit of package ghc-hslua-module-text for
openSUSE:Factory checked in at 2018-10-25 08:16:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-hslua-module-text (Old)
and /work/SRC/openSUSE:Factory/.ghc-hslua-module-text.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-hslua-module-text"
Thu Oct 25 08:16:36 2018 rev:3 rq:642864 version:0.2.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/ghc-hslua-module-text/ghc-hslua-module-text.changes
2018-07-24 17:19:38.551088972 +0200
+++
/work/SRC/openSUSE:Factory/.ghc-hslua-module-text.new/ghc-hslua-module-text.changes
2018-10-25 08:17:17.184045960 +0200
@@ -1,0 +2,12 @@
+Wed Oct 10 02:02:34 UTC 2018 - [email protected]
+
+- Update hslua-module-text to version 0.2.0.
+ ## 0.2.0 -- 2018-09-24
+
+ - Use hslua 1.0.
+
+ ## 0.1.2.2 -- 2018-03-09
+
+ - Relax upper bound for base.
+
+-------------------------------------------------------------------
Old:
----
hslua-module-text-0.1.2.1.tar.gz
hslua-module-text.cabal
New:
----
hslua-module-text-0.2.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-hslua-module-text.spec ++++++
--- /var/tmp/diff_new_pack.SC3eMj/_old 2018-10-25 08:17:17.764045707 +0200
+++ /var/tmp/diff_new_pack.SC3eMj/_new 2018-10-25 08:17:17.764045707 +0200
@@ -12,22 +12,22 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global pkg_name hslua-module-text
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.1.2.1
+Version: 0.2.0
Release: 0
Summary: Lua module for text
License: MIT
Group: Development/Libraries/Haskell
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: ghc-Cabal-devel
+BuildRequires: ghc-bytestring-devel
BuildRequires: ghc-hslua-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-text-devel
@@ -53,7 +53,6 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-cp -p %{SOURCE1} %{pkg_name}.cabal
%build
%ghc_lib_build
++++++ hslua-module-text-0.1.2.1.tar.gz -> hslua-module-text-0.2.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/hslua-module-text-0.1.2.1/ChangeLog.md
new/hslua-module-text-0.2.0/ChangeLog.md
--- old/hslua-module-text-0.1.2.1/ChangeLog.md 2017-11-24 15:47:54.000000000
+0100
+++ new/hslua-module-text-0.2.0/ChangeLog.md 2018-09-24 08:20:00.000000000
+0200
@@ -1,5 +1,15 @@
# Revision history for hslua-module-text
+## 0.2.0 -- 2018-09-24
+
+- Use hslua 1.0.
+
+
+## 0.1.2.2 -- 2018-03-09
+
+- Relax upper bound for base.
+
+
## 0.1.2.1 -- 2017-11-24
- Add missing test file in the sources archive. This oversight had
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/hslua-module-text-0.1.2.1/hslua-module-text.cabal
new/hslua-module-text-0.2.0/hslua-module-text.cabal
--- old/hslua-module-text-0.1.2.1/hslua-module-text.cabal 2017-11-24
15:47:54.000000000 +0100
+++ new/hslua-module-text-0.2.0/hslua-module-text.cabal 2018-09-24
08:20:00.000000000 +0200
@@ -1,13 +1,13 @@
name: hslua-module-text
-version: 0.1.2.1
+version: 0.2.0
synopsis: Lua module for text
description: UTF-8 aware subset of Lua's `string` module.
-homepage: https://github.com/hslua/hslua-module-test
+homepage: https://github.com/hslua/hslua-module-text
license: MIT
license-file: LICENSE
author: Albert Krewinkel
maintainer: [email protected]
-copyright: © 2017 Albert Krewinkel
+copyright: © 2017–2018 Albert Krewinkel
category: Foreign
build-type: Simple
extra-source-files: ChangeLog.md
@@ -20,11 +20,13 @@
library
exposed-modules: Foreign.Lua.Module.Text
- build-depends: base >= 4.7 && < 4.11
- , hslua >= 0.9 && < 0.10
- , text >= 1 && < 1.3
+ build-depends: base >= 4.7 && < 5
+ , bytestring >= 0.10.2 && < 0.11
+ , hslua >= 1.0 && < 1.1
+ , text >= 1 && < 1.3
hs-source-dirs: src
default-language: Haskell2010
+ other-extensions: OverloadedStrings
test-suite test-hslua
default-language: Haskell2010
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/hslua-module-text-0.1.2.1/src/Foreign/Lua/Module/Text.hs
new/hslua-module-text-0.2.0/src/Foreign/Lua/Module/Text.hs
--- old/hslua-module-text-0.1.2.1/src/Foreign/Lua/Module/Text.hs
2017-11-24 15:47:54.000000000 +0100
+++ new/hslua-module-text-0.2.0/src/Foreign/Lua/Module/Text.hs 2018-09-24
08:20:00.000000000 +0200
@@ -1,5 +1,5 @@
{-
-Copyright © 2017 Albert Krewinkel
+Copyright © 2017–2018 Albert Krewinkel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,10 +19,10 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-}
-
+{-# LANGUAGE OverloadedStrings #-}
{-|
Module : Foreign.Lua.Module.Text
-Copyright : © 2017 Albert Krewinkel
+Copyright : © 2017–2018 Albert Krewinkel
License : MIT
Maintainer : Albert Krewinkel <[email protected]>
Stability : alpha
@@ -36,10 +36,10 @@
)where
import Control.Applicative ((<$>))
+import Data.ByteString (ByteString)
import Data.Text (Text)
import Data.Maybe (fromMaybe)
-import Foreign.Lua (FromLuaStack, NumResults, Lua, LuaInteger, ToLuaStack)
-import Foreign.Lua.FunctionCalling (ToHaskellFunction, newCFunction)
+import Foreign.Lua (NumResults, Lua, Peekable, Pushable, ToHaskellFunction)
import qualified Foreign.Lua as Lua
import qualified Data.Text as T
@@ -50,7 +50,7 @@
addFunction "lower" (return . T.toLower :: Text -> Lua Text)
addFunction "upper" (return . T.toUpper :: Text -> Lua Text)
addFunction "reverse" (return . T.reverse :: Text -> Lua Text)
- addFunction "len" (return . fromIntegral . T.length :: Text -> Lua
LuaInteger)
+ addFunction "len" (return . fromIntegral . T.length :: Text -> Lua
Lua.Integer)
addFunction "sub" sub
return 1
@@ -63,8 +63,8 @@
-- which produces the package.
addPackagePreloader :: String -> Lua NumResults -> Lua ()
addPackagePreloader name modulePusher = do
- Lua.getglobal' "package.preload"
- Lua.pushcfunction =<< newCFunction modulePusher
+ Lua.getfield Lua.registryindex Lua.preloadTableRegistryField
+ Lua.pushHaskellFunction modulePusher
Lua.setfield (-2) name
Lua.pop 1
@@ -77,20 +77,10 @@
Lua.rawset (-3)
-- | Returns a substring, using Lua's string indexing rules.
-sub :: Text -> LuaInteger -> OrNil LuaInteger -> Lua Text
+sub :: Text -> Lua.Integer -> Lua.Optional Lua.Integer -> Lua Text
sub s i j =
let i' = fromIntegral i
- j' = fromIntegral . fromMaybe (-1) $ toMaybe j
+ j' = fromIntegral . fromMaybe (-1) $ Lua.fromOptional j
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 return . T.dropEnd fromEnd . T.drop fromStart $ s
-
--- A lua value or nil
-newtype OrNil a = OrNil { toMaybe :: Maybe a }
-
-instance FromLuaStack a => FromLuaStack (OrNil a) where
- peek idx = do
- noValue <- Lua.isnoneornil idx
- if noValue
- then return (OrNil Nothing)
- else OrNil . Just <$> Lua.peek idx
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/hslua-module-text-0.1.2.1/test/test-hslua-module-text.hs
new/hslua-module-text-0.2.0/test/test-hslua-module-text.hs
--- old/hslua-module-text-0.1.2.1/test/test-hslua-module-text.hs
2017-11-24 15:47:54.000000000 +0100
+++ new/hslua-module-text-0.2.0/test/test-hslua-module-text.hs 2018-09-24
08:20:00.000000000 +0200
@@ -1,5 +1,5 @@
{-
-Copyright © 2017 Albert Krewinkel
+Copyright © 2017–2018 Albert Krewinkel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,8 +19,10 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-}
+{-# LANGUAGE OverloadedStrings #-}
+
import Control.Monad (void, when)
-import Foreign.Lua (Lua, runLua)
+import Foreign.Lua (Lua)
import Foreign.Lua.Module.Text (preloadTextModule, pushModuleText)
import Test.Tasty (TestTree, defaultMain, testGroup)
import Test.Tasty.HUnit (assertEqual, testCase)
@@ -34,22 +36,22 @@
tests :: TestTree
tests = testGroup "FromLuaStack"
[ testCase "text module can be pushed to the stack" $
- runLua (void pushModuleText)
+ Lua.run (void pushModuleText)
- , testCase "text module can be added to the preloader" . runLua $ do
+ , 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" . runLua $ do
+ , 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 "Lua tests pass" . runLua $ do
+ , testCase "Lua tests pass" . Lua.run $ do
Lua.openlibs
preloadTextModule "hstext"
assertEqual' "error while running lua tests" Lua.OK =<< do