From c83f852ad053546001b34df5a9d976b0a404c678 Mon Sep 17 00:00:00 2001 From: joe Date: Sat, 4 Jan 2014 20:05:44 -0500 Subject: Removed obsolete dependencies. --- kiki.cabal | 4 ++-- kiki.hs | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/kiki.cabal b/kiki.cabal index de75d14..cf0e518 100644 --- a/kiki.cabal +++ b/kiki.cabal @@ -13,14 +13,14 @@ build-type: Simple Executable kiki Main-is: kiki.hs - Build-Depends: base -any, cmdargs -any, directory -any, + Build-Depends: base -any, directory -any, openpgp-util -any, crypto-pubkey (>=0.2.3), cryptohash -any, crypto-pubkey-types -any, asn1-types -any, asn1-encoding -any, dataenc -any, text -any, pretty -any, pretty-show -any, bytestring -any, openpgp (==0.6.1), binary -any, - unix, time, crypto-api, cryptocipher (>=0.3.7), + unix, time, containers -any, process -any, filepath -any, network ghc-options: -O2 diff --git a/kiki.hs b/kiki.hs index 2433d4e..ef8986d 100644 --- a/kiki.hs +++ b/kiki.hs @@ -65,7 +65,7 @@ import Data.Char import Control.Arrow (first,second) import Data.Traversable hiding (mapM,forM,sequence) import qualified Data.Traversable as Traversable (mapM,forM,sequence) -import System.Console.CmdArgs +-- import System.Console.CmdArgs -- import System.Posix.Time import Data.Time.Clock.POSIX import Data.Monoid ((<>)) @@ -263,12 +263,14 @@ rsaPrivateKeyFromPacket pkt@(SecretKeyPacket {}) = do rsaPrivateKeyFromPacket _ = Nothing +{- getPackets :: IO [Packet] getPackets = do input <- L.getContents case decodeOrFail input of Right (_,_,Message pkts) -> return pkts Left (_,_,_) -> return [] +-} secretToPublic pkt@(SecretKeyPacket {}) = @@ -638,10 +640,11 @@ modifyUID other = other todo = error "unimplemented" --- TODO: switch to System.Environment.lookupEnv --- when linking against newer base libraries. +#if MIN_VERSION_base(4,6,0) +#else lookupEnv var = handleIO_ (return Nothing) $ fmap Just (getEnv var) +#endif unmaybe def = fmap (maybe def id) @@ -690,10 +693,14 @@ readPacketsFromFile :: FilePath -> IO Message readPacketsFromFile fname = do -- warn $ fname ++ ": reading..." input <- L.readFile fname +#if MIN_VERSION_binary(0,6,4) return $ case decodeOrFail input of Right (_,_,msg ) -> msg Left (_,_,_) -> trace (fname++": read fail") $ Message [] +#else + return $ decode input +#endif lockFiles fs = do let dolock f = do @@ -949,11 +956,13 @@ readKeyFromFile False "PEM" fname = do } readKeyFromFile is_public fmt filename = error ("unimplemented key type: "++fmt) +{- getPassphrase cmd = case passphrase_fd cmd of Just fd -> do pwh <- fdToHandle (toEnum fd) fmap trimCR $ S.hGetContents pwh Nothing -> return "" +-} #define HOMEOPTION (def &= explicit &= name "homedir" &= typDir ) @@ -1355,12 +1364,14 @@ cross_merge doDecrypt grip0 keyrings wallets f = do return () +{- data Arguments = Cross_Merge { homedir :: Maybe FilePath , passphrase_fd :: Maybe Int , files :: [FilePath] } deriving (Show, Data, Typeable) +-} toLast f [] = [] toLast f [x] = [f x] @@ -2479,6 +2490,7 @@ main = do where topair (x:xs) = (x,xs) return $ lookup "default-key" config >>= listToMaybe + {- getPGPEnviron cmd = do (homedir,secring,pubring,grip) <- getHomeDir (homedir cmd) (Message sec) <- readPacketsFromFile secring @@ -2487,6 +2499,7 @@ main = do ; _ -> False }) sec return (homedir,sec, grip `mplus` fmap fingerprint (listToMaybe keys)) + -} getTorKeys pub = do xs <- groupBindings pub -- cgit v1.2.3