-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Library for Fedora distribution versions
--   
--   This library provides the Dist and Branch datatypes and various
--   associated metadata functions for Red Hat distributions (Fedora, EPEL,
--   RHEL) needed for packaging development and building. It uses current
--   release data from Fedora PDC.
@package fedora-dists
@version 2.1.1


module Distribution.Fedora

-- | The <a>Dist</a> datatype specifies the target OS and version. (roughly
--   corresponds to a git branch)
data Dist

-- | RHEL version
RHEL :: Version -> Dist

-- | EPEL release
EPEL :: Int -> Dist

-- | EPEL Next release
EPELNext :: Int -> Dist

-- | Fedora release
Fedora :: Int -> Dist

-- | gets list of current releases (Fedora and EPEL)
--   
--   The data is stored in ~<i>.fedora</i>product-versions.json and
--   refreshed from Fedora PDC if older than 5.5 hours
getReleaseIds :: IO [Text]

-- | gets current Fedora releases
getFedoraReleaseIds :: IO [Text]

-- | get list of current Fedora Dist's
getFedoraDists :: IO [Dist]

-- | gets current EPEL releases
getEPELReleaseIds :: IO [Text]

-- | get current Dist for Fedora Rawhide
getRawhideDist :: IO Dist

-- | get newest Fedora branch
getLatestFedoraDist :: IO Dist

-- | get newest EPEL release
getLatestEPELDist :: IO Dist

-- | Rawhide version id
rawhideVersionId :: Text

-- | Maps <a>Dist</a> to package dist-git branch name, relative to latest
--   branch
--   
--   <pre>
--   distBranch (Fedora 35) (Fedora 36) == "rawhide"
--   distBranch (Fedora 35) (Fedora 34) == "f34"
--   </pre>
distBranch :: Dist -> Dist -> String

-- | Map <a>Dist</a> to DNF/YUM repo name, relative to latest branch
distRepo :: Dist -> Dist -> String

-- | Map <a>Dist</a> to Maybe the DNF/YUM updates repo name, relative to
--   latest branch
distUpdates :: Dist -> Dist -> Maybe String

-- | Whether dist has overrides in Bodhi, relative to latest branch
distOverride :: Dist -> Dist -> Bool

-- | Mock configuration for <a>Dist</a> and arch, relative to latest branch
mockConfig :: Dist -> Dist -> String -> String

-- | OS release major version for <a>Dist</a>, relative to latest branch
distVersion :: Dist -> Dist -> String

-- | Command line tool for <a>Dist</a> (eg "koji")
kojicmd :: Dist -> String

-- | rpkg command for <a>Dist</a> (eg "fedpkg")
rpkg :: Dist -> String

-- | <a>Dist</a> tag (appended to rpm package release field)
rpmDistTag :: Dist -> String
instance GHC.Classes.Ord Distribution.Fedora.Dist
instance GHC.Classes.Eq Distribution.Fedora.Dist
instance GHC.Show.Show Distribution.Fedora.Dist
instance GHC.Read.Read Distribution.Fedora.Dist


module Distribution.Fedora.Branch

-- | Branch datatype
--   
--   Branch can be rawhide, or a fedora or epel branch
data Branch
EPEL :: Int -> Branch
EPELNext :: Int -> Branch
Fedora :: Int -> Branch
Rawhide :: Branch

-- | Read a Fedora Branch name
readBranch :: String -> Maybe Branch

-- | Unsafely read a Fedora Branch name: errors for unknown branches
readBranch' :: String -> Branch

-- | Read a Fedora Branch name, otherwise return branch string
eitherBranch :: String -> Either String Branch

-- | Read a Fedora Branch name, otherwise return an error message
eitherBranch' :: String -> Either String Branch

-- | Read a Branch name (one of the list of active branches)
--   
--   Similar to eitherActiveBranch but ignores any error string
readActiveBranch :: [Branch] -> String -> Maybe Branch

-- | Read a Branch name (one of the list of active branches)
--   
--   Like readActiveBranch, but errors for inactive or unknown branches.
readActiveBranch' :: [Branch] -> String -> Branch

-- | Read a Branch name (one of the list of active branches)
--   
--   Provides error strings for inactive or unknown branches.
eitherActiveBranch :: [Branch] -> String -> Either String Branch

-- | Returns newer branch than given one from supplied active branches.
--   
--   Branches should be in descending order, eg from getFedoraBranches
newerBranch :: Branch -> [Branch] -> Branch

-- | Maps release-id to Branch
releaseBranch :: Text -> Branch

-- | Returns list of active Fedora branches, including rawhide and EPEL
getFedoraBranches :: IO [Branch]

-- | Returns list of active Fedora branches, excluding rawhide
getFedoraBranched :: IO [Branch]

-- | Map Branch to Koji destination tag
branchDestTag :: Branch -> String

-- | Convert a Branch to a Dist
branchDist :: Branch -> IO Dist

-- | Default build target associated with a branch
branchTarget :: Branch -> String
instance GHC.Classes.Ord Distribution.Fedora.Branch.Branch
instance GHC.Classes.Eq Distribution.Fedora.Branch.Branch
instance GHC.Show.Show Distribution.Fedora.Branch.Branch
