debian-3.23: Modules for working with the Debian package systemSource codeContentsIndex
Debian.Apt.Methods
Description
an interface for using the methods in varlibaptmethods
Synopsis
withMethodPath :: FilePath -> (MethodHandle -> IO a) -> IO a
withMethodURI :: URI -> (MethodHandle -> IO a) -> IO a
whichMethodPath :: URI -> IO (Maybe FilePath)
openMethod :: FilePath -> IO MethodHandle
closeMethod :: MethodHandle -> IO ExitCode
recvStatus :: MethodHandle -> IO Status
sendCommand :: MethodHandle -> Command -> IO ()
getLastModified :: FilePath -> IO (Maybe UTCTime)
simpleFetch :: [ConfigItem] -> URI -> FilePath -> Maybe UTCTime -> IO Bool
fetch :: FetchCallbacks -> [ConfigItem] -> URI -> FilePath -> Maybe UTCTime -> IO Bool
data FetchCallbacks = FetchCallbacks {
logCB :: Message -> IO ()
statusCB :: URI -> Message -> IO ()
uriStartCB :: URI -> Maybe Integer -> Maybe UTCTime -> Maybe Integer -> IO ()
uriDoneCB :: URI -> Maybe Integer -> Maybe UTCTime -> Maybe Integer -> Maybe FilePath -> Hashes -> Bool -> IO ()
uriFailureCB :: URI -> Message -> IO ()
generalFailureCB :: Message -> IO ()
authorizationRequiredCB :: Site -> IO (Maybe (User, Password))
mediaFailureCB :: Media -> Drive -> IO ()
debugCB :: String -> IO ()
}
emptyFetchCallbacks
cliFetchCallbacks
data Command
= URIAcquire URI FilePath (Maybe UTCTime)
| Configuration [ConfigItem]
| AuthorizationCredentials Site User Password
| MediaChanged Media (Maybe Bool)
data Status
= Capabilities {
version :: String
singleInstance :: Bool
preScan :: Bool
pipeline :: Bool
sendConfig :: Bool
needsCleanup :: Bool
localOnly :: Bool
}
| LogMsg Message
| Status URI Message
| URIStart {
uri :: URI
size :: Maybe Integer
lastModified :: Maybe UTCTime
resumePoint :: Maybe Integer
}
| URIDone {
uri :: URI
size :: Maybe Integer
lastModified :: Maybe UTCTime
resumePoint :: Maybe Integer
filename :: Maybe FilePath
hashes :: Hashes
imsHit :: Bool
}
| URIFailure {
uri :: URI
message :: Message
}
| GeneralFailure Message
| AuthorizationRequired Site
| MediaFailure Media Drive
type Message = String
type Site = String
type User = String
type Password = String
type Media = String
type Drive = String
type Header = (String, String)
type ConfigItem = (String, String)
Documentation
withMethodPath :: FilePath -> (MethodHandle -> IO a) -> IO aSource
withMethod - run |methodPath| bracketed with openMethod/closeMethod. |f| gets the open handle.
withMethodURI :: URI -> (MethodHandle -> IO a) -> IO aSource
whichMethodPath :: URI -> IO (Maybe FilePath)Source
whichMethodBinary - find the method executable associated with a URI throws an exception on failure
openMethod :: FilePath -> IO MethodHandleSource
closeMethod :: MethodHandle -> IO ExitCodeSource
recvStatus :: MethodHandle -> IO StatusSource
sendCommand :: MethodHandle -> Command -> IO ()Source
getLastModified :: FilePath -> IO (Maybe UTCTime)Source
simpleFetch :: [ConfigItem] -> URI -> FilePath -> Maybe UTCTime -> IO BoolSource
fetch :: FetchCallbacks -> [ConfigItem] -> URI -> FilePath -> Maybe UTCTime -> IO BoolSource
fetch a single item, show console output see also: getLastModified
data FetchCallbacks Source
Constructors
FetchCallbacks
logCB :: Message -> IO ()
statusCB :: URI -> Message -> IO ()
uriStartCB :: URI -> Maybe Integer -> Maybe UTCTime -> Maybe Integer -> IO ()
uriDoneCB :: URI -> Maybe Integer -> Maybe UTCTime -> Maybe Integer -> Maybe FilePath -> Hashes -> Bool -> IO ()
uriFailureCB :: URI -> Message -> IO ()
generalFailureCB :: Message -> IO ()
authorizationRequiredCB :: Site -> IO (Maybe (User, Password))
mediaFailureCB :: Media -> Drive -> IO ()
debugCB :: String -> IO ()
emptyFetchCallbacks
cliFetchCallbacks
data Command Source
Constructors
URIAcquire URI FilePath (Maybe UTCTime)
Configuration [ConfigItem]
AuthorizationCredentials Site User Password
MediaChanged Media (Maybe Bool)
show/hide Instances
data Status Source
Constructors
Capabilities
version :: String
singleInstance :: Bool
preScan :: Bool
pipeline :: Bool
sendConfig :: Bool
needsCleanup :: Bool
localOnly :: Bool
LogMsg Message
Status URI Message
URIStart
uri :: URI
size :: Maybe Integer
lastModified :: Maybe UTCTime
resumePoint :: Maybe Integer
URIDone
uri :: URI
size :: Maybe Integer
lastModified :: Maybe UTCTime
resumePoint :: Maybe Integer
filename :: Maybe FilePath
hashes :: Hashes
imsHit :: Bool
URIFailure
uri :: URI
message :: Message
GeneralFailure Message
AuthorizationRequired Site
MediaFailure Media Drive
show/hide Instances
type Message = StringSource
type Site = StringSource
type User = StringSource
type Password = StringSource
type Media = StringSource
type Drive = StringSource
type Header = (String, String)Source
type ConfigItem = (String, String)Source
Produced by Haddock version 2.4.2