diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2013-08-13 13:06:34 +0000 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2013-08-13 13:06:34 +0000 |
commit | 00a3d505840a85463965fba492c6517f740deb50 (patch) | |
tree | c3168442a1d49a2bb1960bb7d6d3531065e98176 /dev-haskell | |
parent | Add ~arm keyword (diff) | |
download | historical-00a3d505840a85463965fba492c6517f740deb50.tar.gz historical-00a3d505840a85463965fba492c6517f740deb50.tar.bz2 historical-00a3d505840a85463965fba492c6517f740deb50.zip |
Fix /dev/log to be Stream or Datagram at runtime (fixes ganeti logger for certain users).
Package-Manager: portage-2.2.0_alpha191/cvs/Linux x86_64
Manifest-Sign-Key: 0x611FF3AA
Diffstat (limited to 'dev-haskell')
-rw-r--r-- | dev-haskell/hslogger/ChangeLog | 9 | ||||
-rw-r--r-- | dev-haskell/hslogger/Manifest | 16 | ||||
-rw-r--r-- | dev-haskell/hslogger/files/hslogger-1.2.1-dev-log-rdetect.patch | 119 | ||||
-rw-r--r-- | dev-haskell/hslogger/hslogger-1.2.1-r2.ebuild | 30 |
4 files changed, 164 insertions, 10 deletions
diff --git a/dev-haskell/hslogger/ChangeLog b/dev-haskell/hslogger/ChangeLog index 9bcaf724b4a3..2e5a3e587895 100644 --- a/dev-haskell/hslogger/ChangeLog +++ b/dev-haskell/hslogger/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for dev-haskell/hslogger # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-haskell/hslogger/ChangeLog,v 1.19 2013/07/21 17:41:48 ottxor Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-haskell/hslogger/ChangeLog,v 1.20 2013/08/13 13:06:24 slyfox Exp $ + +*hslogger-1.2.1-r2 (13 Aug 2013) + + 13 Aug 2013; Sergei Trofimovich <slyfox@gentoo.org> + +files/hslogger-1.2.1-dev-log-rdetect.patch, +hslogger-1.2.1-r2.ebuild: + Fix /dev/log to be Stream or Datagram at runtime (fixes ganeti logger for + certain users). 21 Jul 2013; Christoph Junghans <ottxor@gentoo.org> hslogger-1.2.1.ebuild: added ~amd64-linux (tested by me) diff --git a/dev-haskell/hslogger/Manifest b/dev-haskell/hslogger/Manifest index ea259e130852..60eb5b0ab41e 100644 --- a/dev-haskell/hslogger/Manifest +++ b/dev-haskell/hslogger/Manifest @@ -1,20 +1,18 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 +AUX hslogger-1.2.1-dev-log-rdetect.patch 5068 SHA256 13e8f0f5497c6e42b18b0021c5618987e097ed2c72215646f2022ad242939ecc SHA512 4073b119ff66893a36997b30a2f8c160c87c527eb569a2a2dbadeaf1a6c49bb9fca1735d1e75019e54ad6caefe6f160a4e4fe6fa0986b66bedd8449801c909db WHIRLPOOL 05a83f316438d0c435474e30e4552517c2e4c863f5fbf2e3e58971dffcd7fab173e175f2552ef239f4cc3419ea78f380a44db2b9e906ae09cce21a0dfc3aeeb2 DIST hslogger-1.1.5.tar.gz 35632 SHA256 676ea4d926eeac1a930d76a3a32b921f8550e8ff973c595e93d2f7ae99316952 SHA512 e3b609b7e1cc20fb123b6c7d663178680ba1bb655120882c5431e2e1579d509675ebb211afcb99e3351c7310405fc55c93594f40e562a3f5bf56630b571e1776 WHIRLPOOL 267acb5395d11b250cce6d1af64bc3ebe4a2e4b9671a4da6193ece744da3f04fcec487852bf15016becf8d60cdb5de028166c996126d94ffc8fdc3ebc1402866 DIST hslogger-1.2.1.tar.gz 35813 SHA256 c5538c3f79b9e8aac97a6f1377c82b9f70b88ee5e39f62f358953467e271cded SHA512 dfb2ab31913c2ba06575165f9d447cdd32d13772d971a283afb9914cdcf45e006e5bff45eb9f953a1dec6ffd2b7e585f18656dd43345af4728f24d9a1f8454b6 WHIRLPOOL 5f26778514a10242f4649d7f67049f2b1bc1136c3e87e21f47d4fe6375db1fa0287defdaf5284b1156fd560b976c4aa05316acb7d2d8982bbf15d7a15f96bd70 EBUILD hslogger-1.1.5.ebuild 697 SHA256 0d7d6443e435c0b1afee634ce594f6fff99a4e59836263753f6e79545d5fe336 SHA512 0dec99788225bbe7e1649ff58ac3e93c59d31bc9aab5d07679c9c3e472387724961895e7c1fbff226e28abf995cb7819a0175e5edc43ffb03f551a1083c68b7f WHIRLPOOL c0113e6d4dbe119141a28a42c83515b61d45762d2a028cfee28f86fc089813dc27543010ae744da079ffbc21f1b6986ab70dcd6361f8467d50b0a6fcaeee2aa6 +EBUILD hslogger-1.2.1-r2.ebuild 822 SHA256 71d646ba85e23e78e4f6f5ad09cf7aa5df9d079ce12b026d1dbcb0e02a288497 SHA512 31c94a265a2f53d38a11b42cb4d2a38d366b308480a26a6bfc649cf10ea7ec6e3540502256b656858faa09cbb896fc8b52778426621c312601c21ed463c8064d WHIRLPOOL 2aaaf29b385da02b80efada5b4c3c4d42f8aa13f78051e42b85a03af118f2332481286b0c276124ffda52fba0c8d5746358f87c9b0f1ce2fffb1faa8b9a51faa EBUILD hslogger-1.2.1.ebuild 742 SHA256 42c6cda53bf940a907d5115c389dc761d487e5401a231e7bd269da7f28f6914a SHA512 6c9fccafc96faf2b5c8779133b62aca599bbd4611b556213be9134106b053787c67cfcd218cfc01f76ebaa8b055952c9c611e590143dc151a9e317b9694b5f3e WHIRLPOOL 233148b5d7b6fa02c399f8b26706549437322ec32358645055b0f9b23e1bf54fc74f2b0ea5f005d1e8317421de19282881ce0108b0733edb7583d37f228400eb -MISC ChangeLog 2559 SHA256 357db33bc274be63a80712b7f523c0bba6347a2a9f94a789dc9fb1a3ad89babc SHA512 10e0eb50520e82dab6a93c785623ce2d0ce0963ad61eae1bcf7b3c8e13d5ec2e244eae1a51f1d25b895ca9c2b42bc9466a2014d9f05c31947704f8eb5d6d8d0f WHIRLPOOL 9d2462c2416a2014fe08c1099043d4e082fbb1d0050034fe30b1a8b3801f2f9bce4117f252d556ff6a334d2a0c747cdfed6ed887342842d3062bffaf1a24c249 +MISC ChangeLog 2816 SHA256 0dd71ab5824ababaaa8a116070b0dfff66e6afc2bed7e8a8949c618b81e5bbb4 SHA512 65432b158710792a353c1bd3166efb3210493ef1c75a7e9b65098264c30e3de520c770a5a11ecea5f97de7136cbd8adeabf11e077ff3d413f860c44bb072d279 WHIRLPOOL 6ffa805b5ee6a51fc7c5a44cc7fdcb10552e4ca3f06e7808e6c1a0d0c1df3062e8fa61428edbb7000567e6273fe2834aaa9e85d4f8865fe49e445bbf216340ac MISC metadata.xml 223 SHA256 1d00c8be162a6cb87b3de440b3e63e10b39c12d56e8fbfe592e75aed872b2508 SHA512 24765bbf1cb187cd262aa7fb3824c1cec65e2bf3f2198099de688916d96401a26458265b15408f22b1fbd6d6a2842df814a57ceda80dfa00d130b24423b7544f WHIRLPOOL 8fd6700f6198db6540eb51edf11372faeb6eb8a542a692e515badf236f62444f2c180f7d08e0f98e9fdfa23de14631b31af50543469aaa27084d6b637e2644c7 -----BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.20 (GNU/Linux) +Version: GnuPG v2.0.19 (GNU/Linux) -iQEcBAEBCAAGBQJR7B1fAAoJEOeBhlrCAAWGEQQH/RuJWLGIEtClL4GYpJCCpind -ofvmUjukTHQN6TPWNkIxW3IBqSU7lY1vh+E3hC+8NedtnZV7BttwuUKn80imw1zq -8NDrIu/YzTN1JBcxJGj3E3VdoJ+eo/n/AhAZ15THN0LvRvCZ/mp598nQZyP1sS86 -Z5ZfMktoMu0FaFn3PCgdttbfbgjk2OIAhFBOFtnF2rBCap45f10kk+SicRSneM8B -bvZjqwpHhDc93jsoFyQQOi3dFKuDu9MV5hi9FbqB9J8F6SnJhaevYLFcY5chY37L -1vPwsd4HIp5VO9EqYXhuoaGAuO5GlGfdupVql1yvvZ+/gVWccfFusALTpMxxXZw= -=oilc +iEYEAREIAAYFAlIKL08ACgkQcaHudmEf86r3ZQCghxI/0CXd4MRVegpky6VKtpWz +ysoAnRj57rnCd0swkaE1p3zpn4Rrho0w +=1b9H -----END PGP SIGNATURE----- diff --git a/dev-haskell/hslogger/files/hslogger-1.2.1-dev-log-rdetect.patch b/dev-haskell/hslogger/files/hslogger-1.2.1-dev-log-rdetect.patch new file mode 100644 index 000000000000..0da97310da1a --- /dev/null +++ b/dev-haskell/hslogger/files/hslogger-1.2.1-dev-log-rdetect.patch @@ -0,0 +1,119 @@ +Detect "/dev/log" socket type (Stream / Dgram) at runtime +as it does openlog from glibc. + +Patch based on report by George Diamantopoulos: + +https://groups.google.com/forum/#!topic/ganeti/xnj-WctN7HY/discussion + +Original bug report + +https://github.com/jgoerzen/hslogger/issues/1 + +Reported-by: George Diamantopoulos +Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> +diff --git a/src/System/Log/Handler/Syslog.hs b/src/System/Log/Handler/Syslog.hs +index 52cbdc3..62337f8 100644 +--- a/src/System/Log/Handler/Syslog.hs ++++ b/src/System/Log/Handler/Syslog.hs +@@ -42,11 +42,12 @@ module System.Log.Handler.Syslog( + Option(..) + ) where + ++import qualified Control.Exception as E + import System.Log + import System.Log.Formatter + import System.Log.Handler + import Data.Bits +-import Network.Socket ++import Network.Socket as S + import Network.BSD + import Data.List + #ifndef mingw32_HOST_OS +@@ -131,6 +132,7 @@ data SyslogHandler = SyslogHandler {options :: [Option], + identity :: String, + logsocket :: Socket, + address :: SockAddr, ++ sock_type :: SocketType, + priority :: Priority, + formatter :: LogFormatter SyslogHandler + } +@@ -171,9 +173,29 @@ openlog_local :: String -- ^ Path to FIFO + -> Priority -- ^ Priority limit + -> IO SyslogHandler + openlog_local fifopath ident options fac pri = +- do +- s <- socket AF_UNIX Datagram 0 +- openlog_generic s (SockAddrUnix fifopath) ident options fac pri ++ do (s, t) <- do -- "/dev/log" is usually Datagram, ++ -- but most of syslog loggers allow it to be ++ -- of Stream type. glibc's" openlog()" ++ -- does roughly the similar thing: ++ -- http://www.gnu.org/software/libc/manual/html_node/openlog.html ++ ++ s <- socket AF_UNIX Stream 0 ++ tryStream s `E.catch` (onIOException (fallbackToDgram s)) ++ openlog_generic s (SockAddrUnix fifopath) t ident options fac pri ++ ++ where onIOException :: IO a -> E.IOException -> IO a ++ onIOException a _ = a ++ ++ tryStream :: Socket -> IO (Socket, SocketType) ++ tryStream s = ++ do connect s (SockAddrUnix fifopath) ++ return (s, Stream) ++ ++ fallbackToDgram :: Socket -> IO (Socket, SocketType) ++ fallbackToDgram s = ++ do S.close s -- close Stream variant ++ d <- socket AF_UNIX Datagram 0 ++ return (d, Datagram) + #endif + + {- | Log to a remote server via UDP. -} +@@ -190,23 +212,25 @@ openlog_remote fam hostname port ident options fac pri = + he <- getHostByName hostname + s <- socket fam Datagram 0 + let addr = SockAddrInet port (head (hostAddresses he)) +- openlog_generic s addr ident options fac pri +- ++ openlog_generic s addr Datagram ident options fac pri ++ + {- | The most powerful initialization mechanism. Takes an open datagram + socket. -} + openlog_generic :: Socket -- ^ A datagram socket + -> SockAddr -- ^ Address for transmissions ++ -> SocketType -- ^ socket connection mode (stream / datagram) + -> String -- ^ Program name + -> [Option] -- ^ 'Option's + -> Facility -- ^ Facility value + -> Priority -- ^ Priority limit + -> IO SyslogHandler +-openlog_generic sock addr ident opt fac pri = ++openlog_generic sock addr sock_t ident opt fac pri = + return (SyslogHandler {options = opt, + facility = fac, + identity = ident, + logsocket = sock, + address = addr, ++ sock_type = sock_t, + priority = pri, + formatter = syslogFormatter + }) +@@ -234,12 +258,14 @@ instance LogHandler SyslogHandler where + getLevel sh = priority sh + setFormatter sh f = sh{formatter = f} + getFormatter sh = formatter sh +- emit sh (_, msg) _ = +- let ++ emit sh (_, msg) _ = ++ let + sendstr :: String -> IO String + sendstr [] = return [] + sendstr omsg = do +- sent <- sendTo (logsocket sh) omsg (address sh) ++ sent <- case sock_type sh of ++ Datagram -> sendTo (logsocket sh) omsg (address sh) ++ Stream -> send (logsocket sh) omsg + sendstr (genericDrop sent omsg) + in do + if (elem PERROR (options sh)) diff --git a/dev-haskell/hslogger/hslogger-1.2.1-r2.ebuild b/dev-haskell/hslogger/hslogger-1.2.1-r2.ebuild new file mode 100644 index 000000000000..31138a07d7a7 --- /dev/null +++ b/dev-haskell/hslogger/hslogger-1.2.1-r2.ebuild @@ -0,0 +1,30 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-haskell/hslogger/hslogger-1.2.1-r2.ebuild,v 1.1 2013/08/13 13:06:24 slyfox Exp $ + +EAPI=5 + +# ebuild generated by hackport 0.3.9999 + +CABAL_FEATURES="bin lib profile haddock hoogle hscolour" +inherit eutils haskell-cabal + +DESCRIPTION="Versatile logging framework" +HOMEPAGE="http://software.complete.org/hslogger" +SRC_URI="mirror://hackage/packages/archive/${PN}/${PV}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0/${PV}" +KEYWORDS="~amd64 ~sparc ~x86" +IUSE="" + +RDEPEND="dev-haskell/mtl:=[profile?] + <dev-haskell/network-2.5:=[profile?] + >=dev-lang/ghc-6.10.4:=" +DEPEND="${RDEPEND} + >=dev-haskell/cabal-1.2" + +src_prepare() { + epatch "${FILESDIR}"/${P}-dev-log-rdetect.patch + epatch_user +} |