]> gitweb.michael.orlitzky.com - hath.git/commitdiff
Bump version to 0.2.1.
authorMichael Orlitzky <michael@orlitzky.com>
Sat, 24 May 2014 16:57:55 +0000 (12:57 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sat, 24 May 2014 16:57:55 +0000 (12:57 -0400)
Update dependencies for ghc-7.8.
Require a newer tasty-quickcheck that re-exports Gen.
Use lookupRDNS from newer versions of dns instead of a custom implementation.
Fix deprecation warnings in shelltests.

hath.cabal
src/Cidr.hs
src/DNS.hs
src/IPv4Address.hs
src/Octet.hs
test/ShellTests.hs
test/ShellTestsNet.hs

index dfa55a28f510df6ffb8b18c5227d6ef7948b7ea2..ccaef8a78f704342e4f139e80afa895c5aeac20a 100644 (file)
@@ -1,5 +1,5 @@
 name:           hath
-version:        0.2.0
+version:        0.2.1
 cabal-version:  >= 1.8
 author:         Michael Orlitzky
 maintainer:    Michael Orlitzky <michael@orlitzky.com>
@@ -135,17 +135,16 @@ executable hath
     Octet
 
   build-depends:
-    base                        >= 4.6 && < 4.7,
+    base                        >= 4.6 && < 4.8,
     bytestring                  == 0.10.*,
     cmdargs                     == 0.10.*,
     dns                         >= 1.2,
     MissingH                    == 1.2.*,
     parallel-io                 == 0.3.*,
-    QuickCheck                  == 2.7.*,
     split                       == 0.2.*,
     tasty                       == 0.8.*,
     tasty-hunit                 == 0.8.*,
-    tasty-quickcheck            == 0.8.*
+    tasty-quickcheck            >= 0.8.1
 
   ghc-options:
     -Wall
@@ -176,17 +175,16 @@ test-suite testsuite
   main-is: TestSuite.hs
 
   build-depends:
-    base                        >= 4.6 && < 4.7,
+    base                        >= 4.6 && < 4.8,
     bytestring                  == 0.10.*,
     cmdargs                     == 0.10.*,
     dns                         >= 1.2,
     MissingH                    == 1.2.*,
     parallel-io                 == 0.3.*,
-    QuickCheck                  == 2.7.*,
     split                       == 0.2.*,
     tasty                       == 0.8.*,
     tasty-hunit                 == 0.8.*,
-    tasty-quickcheck            == 0.8.*
+    tasty-quickcheck            >= 0.8.1
 
 
   -- It's not entirely clear to me why I have to reproduce all of this.
@@ -216,18 +214,17 @@ test-suite shelltests
   main-is: ShellTests.hs
 
   build-depends:
-    base                        >= 4.6 && < 4.7,
+    base                        >= 4.6 && < 4.8,
     bytestring                  == 0.10.*,
     cmdargs                     == 0.10.*,
     dns                         >= 1.2,
     MissingH                    == 1.2.*,
     parallel-io                 == 0.3.*,
-    process                     == 1.1.*,
-    QuickCheck                  == 2.7.*,
+    process                     <  1.3,
     split                       == 0.2.*,
     tasty                       == 0.8.*,
     tasty-hunit                 == 0.8.*,
-    tasty-quickcheck            == 0.8.*
+    tasty-quickcheck            >= 0.8.1
 
   -- It's not entirely clear to me why I have to reproduce all of this.
   ghc-options:
@@ -254,18 +251,17 @@ test-suite shelltests-net
   main-is: ShellTestsNet.hs
 
   build-depends:
-    base                        >= 4.6 && < 4.7,
+    base                        >= 4.6 && < 4.8,
     bytestring                  == 0.10.*,
     cmdargs                     == 0.10.*,
     dns                         >= 1.2,
     MissingH                    == 1.2.*,
     parallel-io                 == 0.3.*,
-    process                     == 1.1.*,
-    QuickCheck                  == 2.7.*,
+    process                     <  1.3,
     split                       == 0.2.*,
     tasty                       == 0.8.*,
     tasty-hunit                 == 0.8.*,
-    tasty-quickcheck            == 0.8.*
+    tasty-quickcheck            >= 0.8.1
 
   -- It's not entirely clear to me why I have to reproduce all of this.
   ghc-options:
index 6e759660486a1dffc5e1967c147ac7ff1b4d464d..9cbf845365b574ba4302308557f88babf7659d5e 100644 (file)
@@ -22,11 +22,11 @@ import Data.List (nubBy)
 import Data.List.Split (splitOneOf)
 import Data.Maybe (catMaybes, mapMaybe)
 
-import Test.QuickCheck ( Gen ) -- Not re-exported by tasty
 import Test.Tasty ( TestTree, testGroup )
 import Test.Tasty.HUnit ( (@?=), testCase )
 import Test.Tasty.QuickCheck (
   Arbitrary(..),
+  Gen,
   Property,
   (==>),
   testProperty )
index 041eeeb52e2404b1d6951f3942cee600b8b28cc4..a535de59adeb17a75b3c52333504bc65303e4bee 100644 (file)
@@ -6,36 +6,20 @@ module DNS (
 where
 
 import Control.Concurrent.ParallelIO.Global ( parallel )
-import qualified  Data.ByteString.Char8 as BS (
-  append,
-  intercalate,
-  pack,
-  split )
 import Network.DNS (
   Domain,
   DNSError,
   ResolvConf(..),
   defaultResolvConf,
-  lookupPTR,
+  lookupRDNS,
   makeResolvSeed,
   withResolver )
 
 
--- The return type of lookupPTR.
+-- The return type of lookupRDNS.
 type PTRResult = Either DNSError [Domain]
 
 
--- | Convert the given IP address (as a ByteString) to the format
---   required for a PTR lookup. For example, "192.168.0.0" should be
---   converted to "0.0.168.192.in-addr.arpa".
-ip_to_in_addr_arpa :: Domain -> Domain
-ip_to_in_addr_arpa ip =
-  rev_ip `BS.append` suffix
-  where
-    dot = BS.pack "."
-    suffix = BS.pack ".in-addr.arpa"
-    rev_ip = BS.intercalate dot (reverse (BS.split '.' ip))
-
 -- | Take the default ResolvConf and increase the timeout to 15
 --   seconds.
 our_resolv_conf :: ResolvConf
@@ -49,9 +33,6 @@ lookup_ptrs :: [Domain] -> IO [PTRResult]
 lookup_ptrs ips = do
   rs <- makeResolvSeed our_resolv_conf
   let lookup' addr = withResolver rs $ \resolver ->
-                       lookupPTR resolver addr
-
-  parallel $ map lookup' in_addrs
+                       lookupRDNS resolver addr
 
-  where
-    in_addrs = map ip_to_in_addr_arpa ips
+  parallel $ map lookup' ips
index d262a5c0537ea47092d0255ab417b6516d1cdab8..78bceabc703b39202823d6f9882d3c3fb5d523d1 100644 (file)
@@ -6,11 +6,11 @@ module IPv4Address(
 where
 
 
-import Test.QuickCheck ( Gen ) -- Not re-exported by tasty
 import Test.Tasty ( TestTree, testGroup )
 import Test.Tasty.HUnit ( (@?=), testCase )
 import Test.Tasty.QuickCheck (
   Arbitrary(..),
+  Gen,
   Property,
   (==>),
   testProperty )
index 55f075e8a5810247dc9d7df2342b741ea6f82d30..4664d1964c21eefcc9aaf0fb32452ab42fd9fd0e 100644 (file)
@@ -4,11 +4,11 @@ module Octet (
   octet_tests )
 where
 
-import Test.QuickCheck ( Gen ) -- Not re-exported by tasty
 import Test.Tasty ( TestTree, testGroup )
 import Test.Tasty.HUnit ( (@?=), testCase )
 import Test.Tasty.QuickCheck (
   Arbitrary(..),
+  Gen,
   Property,
   (==>),
   testProperty )
index 65a10ccca97daf27dd80e55e15e8a75e3d55a735..1e884d5ef435eb5d7631e76046515a6d19d59724 100644 (file)
@@ -1,7 +1,7 @@
 module Main
 where
 
-import System.Cmd ( system )
+import System.Process ( system )
 import System.Exit ( exitWith )
 
 main :: IO ()
index b3306d00f5742d84f2952993b2438775ed4e6dcf..7e3a95efee4c42c9864f0f0639566478a5a48f90 100644 (file)
@@ -1,7 +1,7 @@
 module Main
 where
 
-import System.Cmd ( system )
+import System.Process ( system )
 import System.Exit ( exitWith )
 
 main :: IO ()