Merge pull request #3745 from Vaelatern/ganeti
New package: ganeti-2.15.2
This commit is contained in:
commit
0640c2b2ff
|
@ -0,0 +1,31 @@
|
|||
commit b80982fe6035739c1aae7e86a5b1e6de0414a9a6
|
||||
Author: Apollon Oikonomopoulos <apoikos@debian.org>
|
||||
Date: Tue Apr 21 18:29:47 2015 +0300
|
||||
|
||||
Makefile.am: use C.UTF-8
|
||||
|
||||
There is no need to use en_US.UTF-8 with newer libc versions. Use
|
||||
C.UTF-8 to avoid an extra B-D on locales-all.
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 364b26b..3f64939 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -2179,7 +2179,7 @@ man/%.7.in man/%.8.in man/%.1.in: man/%.gen man/footer.rst
|
||||
trap 'echo auto-removing $@; rm $@' EXIT; \
|
||||
$(PANDOC) -s -f rst -t man $< man/footer.rst | \
|
||||
sed -e 's/\\@/@/g' > $@; \
|
||||
- if test -n "$(MAN_HAS_WARNINGS)"; then LC_ALL=en_US.UTF-8 $(CHECK_MAN_WARNINGS) $@; fi; \
|
||||
+ if test -n "$(MAN_HAS_WARNINGS)"; then LC_ALL=C.UTF-8 $(CHECK_MAN_WARNINGS) $@; fi; \
|
||||
$(CHECK_MAN_DASHES) $@; \
|
||||
trap - EXIT
|
||||
|
||||
@@ -2816,7 +2816,7 @@ $(APIDOC_HS_DIR)/index.html: $(HS_LIBTESTBUILT_SRCS) Makefile
|
||||
$(HSCOLOUR) -print-css > $$i/hscolour.css; \
|
||||
done
|
||||
set -e ; \
|
||||
- export LC_ALL=en_US.UTF-8; \
|
||||
+ export LC_ALL=C.UTF-8; \
|
||||
OPTGHC="--optghc=-isrc --optghc=-itest/hs"; \
|
||||
OPTGHC="$$OPTGHC --optghc=-optP-include --optghc=-optP$(HASKELL_PACKAGE_VERSIONS_FILE)"; \
|
||||
for file in $(HS_LIBTESTBUILT_SRCS); do \
|
|
@ -0,0 +1,216 @@
|
|||
commit 3aaf10bfa95efec2f2a667cae34caf76b0a0370b
|
||||
Author: Bhimanavajjula Aditya <bsrk@google.com>
|
||||
Date: Wed Sep 9 12:10:22 2015 +0200
|
||||
|
||||
Define MonadPlus instance definitions using Alternative
|
||||
|
||||
This is a compatibility fix for base-4.8. All MonadPlus definitions
|
||||
have Alternative as a prerequisite. Hence, instead of defining
|
||||
Alternative in terms of MonadPlus, we define MonadPlus in terms of
|
||||
Alternative.
|
||||
|
||||
Signed-off-by: Bhimanavajjula Aditya <bsrk@google.com>
|
||||
Signed-off-by: Petr Pudlak <pudlak@google.com>
|
||||
Reviewed-by: Petr Pudlak <pudlak@google.com>
|
||||
|
||||
--- a/src/Ganeti/BasicTypes.hs
|
||||
+++ b/src/Ganeti/BasicTypes.hs
|
||||
@@ -123,13 +123,17 @@
|
||||
fmap _ (Bad msg) = Bad msg
|
||||
fmap fn (Ok val) = Ok (fn val)
|
||||
|
||||
-instance (Error a, Monoid a) => MonadPlus (GenericResult a) where
|
||||
- mzero = Bad $ strMsg "zero Result when used as MonadPlus"
|
||||
+instance (Error a, Monoid a) => Alternative (GenericResult a) where
|
||||
+ empty = Bad $ strMsg "zero Result when used as empty"
|
||||
-- for mplus, when we 'add' two Bad values, we concatenate their
|
||||
-- error descriptions
|
||||
- (Bad x) `mplus` (Bad y) = Bad (x `mappend` strMsg "; " `mappend` y)
|
||||
- (Bad _) `mplus` x = x
|
||||
- x@(Ok _) `mplus` _ = x
|
||||
+ (Bad x) <|> (Bad y) = Bad (x `mappend` strMsg "; " `mappend` y)
|
||||
+ (Bad _) <|> x = x
|
||||
+ x@(Ok _) <|> _ = x
|
||||
+
|
||||
+instance (Error a, Monoid a) => MonadPlus (GenericResult a) where
|
||||
+ mzero = empty
|
||||
+ mplus = (<|>)
|
||||
|
||||
instance (Error a) => MonadError a (GenericResult a) where
|
||||
throwError = Bad
|
||||
@@ -143,10 +147,6 @@
|
||||
_ <*> (Bad x) = Bad x
|
||||
(Ok f) <*> (Ok x) = Ok $ f x
|
||||
|
||||
-instance (Error a, Monoid a) => Alternative (GenericResult a) where
|
||||
- empty = mzero
|
||||
- (<|>) = mplus
|
||||
-
|
||||
-- | This is a monad transformation for Result. It's implementation is
|
||||
-- based on the implementations of MaybeT and ErrorT.
|
||||
--
|
||||
@@ -233,17 +233,18 @@
|
||||
{-# INLINE liftBaseWith #-}
|
||||
{-# INLINE restoreM #-}
|
||||
|
||||
-instance (Monad m, Error a, Monoid a) => MonadPlus (ResultT a m) where
|
||||
- mzero = ResultT $ return mzero
|
||||
+instance (Monad m, Error a, Monoid a)
|
||||
+ => Alternative (ResultT a m) where
|
||||
+ empty = ResultT $ return mzero
|
||||
-- Ensure that 'y' isn't run if 'x' contains a value. This makes it a bit
|
||||
-- more complicated than 'mplus' of 'GenericResult'.
|
||||
- mplus x y = elimResultT combine return x
|
||||
+ x <|> y = elimResultT combine return x
|
||||
where combine x' = ResultT $ liftM (mplus (Bad x')) (runResultT y)
|
||||
|
||||
-instance (Alternative m, Monad m, Error a, Monoid a)
|
||||
- => Alternative (ResultT a m) where
|
||||
- empty = mzero
|
||||
- (<|>) = mplus
|
||||
+instance (Monad m, Error a, Monoid a)
|
||||
+ => MonadPlus (ResultT a m) where
|
||||
+ mzero = empty
|
||||
+ mplus = (<|>)
|
||||
|
||||
-- | Changes the error message of a result value, if present.
|
||||
-- Note that since 'GenericResult' is also a 'MonadError', this function
|
||||
--- a/src/Ganeti/Utils.hs
|
||||
+++ b/src/Ganeti/Utils.hs
|
||||
@@ -1,4 +1,4 @@
|
||||
-{-# LANGUAGE FlexibleContexts, ScopedTypeVariables #-}
|
||||
+{-# LANGUAGE FlexibleContexts, ScopedTypeVariables, CPP #-}
|
||||
|
||||
{-| Utility functions. -}
|
||||
|
||||
@@ -109,7 +109,11 @@
|
||||
import qualified Data.Either as E
|
||||
import Data.Function (on)
|
||||
import Data.IORef
|
||||
+#if MIN_VERSION_base(4,8,0)
|
||||
+import Data.List hiding (isSubsequenceOf)
|
||||
+#else
|
||||
import Data.List
|
||||
+#endif
|
||||
import qualified Data.Map as M
|
||||
import Data.Maybe (fromMaybe)
|
||||
import qualified Data.Set as S
|
||||
--- a/test/hs/Test/Ganeti/Utils.hs
|
||||
+++ b/test/hs/Test/Ganeti/Utils.hs
|
||||
@@ -43,7 +43,11 @@
|
||||
import Control.Applicative ((<$>), (<*>))
|
||||
import Data.Char (isSpace)
|
||||
import qualified Data.Either as Either
|
||||
+#if MIN_VERSION_base(4,8,0)
|
||||
+import Data.List hiding (isSubsequenceOf)
|
||||
+#else
|
||||
import Data.List
|
||||
+#endif
|
||||
import Data.Maybe (listToMaybe)
|
||||
import qualified Data.Set as S
|
||||
import System.Time
|
||||
--- a/src/Ganeti/Hypervisor/Xen/XmParser.hs
|
||||
+++ b/src/Ganeti/Hypervisor/Xen/XmParser.hs
|
||||
@@ -71,7 +71,7 @@
|
||||
doubleP = LCDouble <$> A.rational <* A.skipSpace <* A.endOfInput
|
||||
innerDoubleP = LCDouble <$> A.rational
|
||||
stringP = LCString . unpack <$> A.takeWhile1 (not . (\c -> isSpace c
|
||||
- || c `elem` "()"))
|
||||
+ || c `elem` ("()" :: String)))
|
||||
wspace = AC.many1 A.space
|
||||
rparen = A.skipSpace *> A.char ')'
|
||||
finalP = listConfigP <* rparen
|
||||
@@ -163,5 +163,5 @@
|
||||
uptimeLineParser = do
|
||||
name <- A.takeTill isSpace <* A.skipSpace
|
||||
idNum <- A.decimal <* A.skipSpace
|
||||
- uptime <- A.takeTill (`elem` "\n\r") <* A.skipSpace
|
||||
+ uptime <- A.takeTill (`elem` ("\n\r" :: String)) <* A.skipSpace
|
||||
return . UptimeInfo (unpack name) idNum $ unpack uptime
|
||||
--- a/src/Ganeti/Query/Filter.hs
|
||||
+++ b/src/Ganeti/Query/Filter.hs
|
||||
@@ -183,10 +183,10 @@
|
||||
-- note: the next two implementations are the same, but we have to
|
||||
-- repeat them due to the encapsulation done by FilterValue
|
||||
containsFilter (QuotedString val) lst = do
|
||||
- lst' <- fromJVal lst
|
||||
+ lst' <- fromJVal lst :: ErrorResult [String]
|
||||
return $! val `elem` lst'
|
||||
containsFilter (NumericValue val) lst = do
|
||||
- lst' <- fromJVal lst
|
||||
+ lst' <- fromJVal lst :: ErrorResult [Integer]
|
||||
return $! val `elem` lst'
|
||||
|
||||
|
||||
--- a/src/Ganeti/THH.hs
|
||||
+++ b/src/Ganeti/THH.hs
|
||||
@@ -1164,8 +1164,13 @@
|
||||
-> Q [Dec]
|
||||
genDictObject save_fn load_fn sname fields = do
|
||||
let name = mkName sname
|
||||
+ -- newName fails in ghc 7.10 when used on keywords
|
||||
+ newName' "data" = newName "data_ghcBug10599"
|
||||
+ newName' "instance" = newName "instance_ghcBug10599"
|
||||
+ newName' "type" = newName "type_ghcBug10599"
|
||||
+ newName' s = newName s
|
||||
-- toDict
|
||||
- fnames <- mapM (newName . fieldVariable) fields
|
||||
+ fnames <- mapM (newName' . fieldVariable) fields
|
||||
let pat = conP name (map varP fnames)
|
||||
tdexp = [| concat $(listE $ zipWith save_fn fnames fields) |]
|
||||
tdclause <- clause [pat] (normalB tdexp) []
|
||||
--- a/src/Ganeti/Query/Language.hs
|
||||
+++ b/src/Ganeti/Query/Language.hs
|
||||
@@ -94,7 +94,8 @@
|
||||
|
||||
-- | No-op 'NFData' instance for 'ResultStatus', since it's a single
|
||||
-- constructor data-type.
|
||||
-instance NFData ResultStatus
|
||||
+instance NFData ResultStatus where
|
||||
+ rnf x = seq x ()
|
||||
|
||||
-- | Check that ResultStatus is success or fail with descriptive
|
||||
-- message.
|
||||
--- a/src/Ganeti/OpParams.hs
|
||||
+++ b/src/Ganeti/OpParams.hs
|
||||
@@ -903,12 +903,12 @@
|
||||
pRequiredNodes :: Field
|
||||
pRequiredNodes =
|
||||
withDoc "Required list of node names" .
|
||||
- renameField "ReqNodes " $ simpleField "nodes" [t| [NonEmptyString] |]
|
||||
+ renameField "ReqNodes" $ simpleField "nodes" [t| [NonEmptyString] |]
|
||||
|
||||
pRequiredNodeUuids :: Field
|
||||
pRequiredNodeUuids =
|
||||
withDoc "Required list of node UUIDs" .
|
||||
- renameField "ReqNodeUuids " . optionalField $
|
||||
+ renameField "ReqNodeUuids" . optionalField $
|
||||
simpleField "node_uuids" [t| [NonEmptyString] |]
|
||||
|
||||
pRestrictedCommand :: Field
|
||||
@@ -1519,7 +1519,7 @@
|
||||
pDiskIndex :: Field
|
||||
pDiskIndex =
|
||||
withDoc "Disk index for e.g. grow disk" .
|
||||
- renameField "DiskIndex " $ simpleField "disk" [t| DiskIndex |]
|
||||
+ renameField "DiskIndex" $ simpleField "disk" [t| DiskIndex |]
|
||||
|
||||
pDiskChgAmount :: Field
|
||||
pDiskChgAmount =
|
||||
@@ -1740,7 +1740,7 @@
|
||||
pIAllocatorInstances :: Field
|
||||
pIAllocatorInstances =
|
||||
withDoc "IAllocator instances field" .
|
||||
- renameField "IAllocatorInstances " .
|
||||
+ renameField "IAllocatorInstances" .
|
||||
optionalField $
|
||||
simpleField "instances" [t| [NonEmptyString] |]
|
||||
|
||||
--- a/src/Ganeti/WConfd/ConfigModifications.hs
|
||||
+++ b/src/Ganeti/WConfd/ConfigModifications.hs
|
||||
@@ -1,4 +1,4 @@
|
||||
-{-# LANGUAGE TemplateHaskell #-}
|
||||
+{-# LANGUAGE TemplateHaskell, FlexibleContexts #-}
|
||||
|
||||
{-| The WConfd functions for direct configuration manipulation
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
Author: Apollon Oikonomopoulos <apoikos@debian.org>
|
||||
Description: Relax cabal build-dependencies
|
||||
Drop upper version limits for json and utf8-string. Upstream uses known-good
|
||||
version limits and sid currently has newer versions of json (0.9.1) and
|
||||
utf8-string (1). Since ganeti builds successfully with sid's versions, we
|
||||
remove the upper version limit.
|
||||
|
||||
Last-Update: 2015-07-21
|
||||
|
||||
--- a/cabal/ganeti.template.cabal
|
||||
+++ b/cabal/ganeti.template.cabal
|
||||
@@ -54,15 +54,15 @@
|
||||
, transformers >= 0.3.0.0
|
||||
, unix >= 2.5.1.0
|
||||
|
||||
- , attoparsec >= 0.10.1.1 && < 0.13
|
||||
+ , attoparsec >= 0.10.1.1 && < 0.14
|
||||
, base64-bytestring >= 1.0.0.1 && < 1.1
|
||||
, case-insensitive >= 0.4.0.1 && < 1.3
|
||||
, Crypto >= 4.2.4 && < 4.3
|
||||
, curl >= 1.3.7 && < 1.4
|
||||
, hinotify >= 0.3.2 && < 0.4
|
||||
, hslogger >= 1.1.4 && < 1.3
|
||||
- , json >= 0.5 && < 0.9
|
||||
- , lens >= 3.10 && < 4.8
|
||||
+ , json >= 0.5
|
||||
+ , lens >= 3.10
|
||||
, lifted-base >= 0.2.0.3 && < 0.3
|
||||
, monad-control >= 0.3.1.3 && < 1.1
|
||||
, MonadCatchIO-transformers >= 0.3.0.0 && < 0.4
|
||||
@@ -71,8 +71,8 @@
|
||||
, regex-pcre >= 0.94.2 && < 0.95
|
||||
, temporary >= 1.1.2.3 && < 1.3
|
||||
, transformers-base >= 0.4.1 && < 0.5
|
||||
- , utf8-string >= 0.3.7 && < 0.4
|
||||
- , zlib >= 0.5.3.3 && < 0.6
|
||||
+ , utf8-string >= 0.3.7
|
||||
+ , zlib >= 0.5.3.3 && < 0.7
|
||||
|
||||
-- Executables:
|
||||
-- , happy
|
|
@ -0,0 +1,34 @@
|
|||
Author: Apollon Oikonomopoulos <apoikos@debian.org>
|
||||
Description: haskell-zlib 0.6 compatibility
|
||||
Based on a patch by Klaus Aehlig submitted to ganeti-devel, Message-Id:
|
||||
<052c6c02393324a9403f4291c112c4689dc1c507.1453302634.git.aehlig@google.com>
|
||||
|
||||
Last-Update: 2016-01-21
|
||||
Forwarded: not-needed
|
||||
--- a/src/Ganeti/Codec.hs
|
||||
+++ b/src/Ganeti/Codec.hs
|
||||
@@ -1,3 +1,5 @@
|
||||
+{-# LANGUAGE CPP #-}
|
||||
+
|
||||
{-| Provides interface to the 'zlib' library.
|
||||
|
||||
-}
|
||||
@@ -51,6 +53,13 @@
|
||||
-- | Decompresses a lazy bytestring, throwing decoding errors using
|
||||
-- 'throwError'.
|
||||
decompressZlib :: (MonadError e m, Error e) => BL.ByteString -> m BL.ByteString
|
||||
+#if MIN_VERSION_zlib(0, 6, 0)
|
||||
+decompressZlib = I.foldDecompressStreamWithInput
|
||||
+ (liftM . BL.chunk)
|
||||
+ return
|
||||
+ (throwError . strMsg . (++)"Zlib: " . show)
|
||||
+ $ I.decompressST I.zlibFormat I.defaultDecompressParams
|
||||
+#else
|
||||
decompressZlib = I.foldDecompressStream
|
||||
(liftM . BL.chunk)
|
||||
(return mempty)
|
||||
@@ -58,3 +67,4 @@
|
||||
. I.decompressWithErrors
|
||||
I.zlibFormat
|
||||
I.defaultDecompressParams
|
||||
+#endif
|
|
@ -0,0 +1,39 @@
|
|||
# Template file for 'ganeti'
|
||||
pkgname=ganeti
|
||||
version=2.15.2
|
||||
revision=1
|
||||
build_style=gnu-configure
|
||||
nopie=yes
|
||||
nocross="The cabal installs don't realize they are cross compiling"
|
||||
patch_args="-Np1" # Thanks to the Debian project for the patches
|
||||
configure_args="--enable-symlinks"
|
||||
hostmakedepends="iproute2 pandoc graphviz pylint pep8 socat cabal-install curl
|
||||
python-openssl python-simplejson python-parsing python-inotify qemu
|
||||
python-bitarray python-ipaddr m4 fakeroot python-curl python-Sphinx"
|
||||
makedepends="libcurl-devel ncurses-libs python-gobject2-devel"
|
||||
depends="python-bitarray python-simplejson python-inotify qemu"
|
||||
short_desc="Cluster virtual server management tool"
|
||||
maintainer="Toyam Cox <Vaelatern@gmail.com>"
|
||||
license="BSD"
|
||||
homepage="http://www.ganeti.org/"
|
||||
distfiles="http://downloads.ganeti.org/releases/${version%.*}/${pkgname}-${version}.tar.gz
|
||||
https://www.stackage.org/lts-5.5/cabal.config"
|
||||
checksum="1e09d29cae5020142d20a96165b23f3b62b5511b875051b6374d09c4c13c0b83
|
||||
9974e9cff7825eb240d2251c95f59396c949dd5932c30cc244faf465cac66080"
|
||||
skip_extraction="cabal.config"
|
||||
|
||||
build_options="syslog monitoring"
|
||||
build_options_default="syslog monitoring"
|
||||
desc_option_monitoring="Enable the monitoring daemon"
|
||||
configure_args+=" $(vopt_enable monitoring) $(vopt_enable syslog)"
|
||||
|
||||
pre_configure() {
|
||||
cabal update
|
||||
cabal --config-file="${XBPS_SRCDISTDIR}/cabal.config" install \
|
||||
--only-dependencies cabal/ganeti.template.cabal
|
||||
ghc-pkg recache
|
||||
}
|
||||
|
||||
post_install() {
|
||||
vlicense COPYING
|
||||
}
|
Loading…
Reference in New Issue