| Copyright | (C) 2017 Jiri Marsicek |
|---|---|
| License | BSD-style (see the file LICENSE) |
| Maintainer | Jiri Marsicek <jiri.marsicek@gmail.com> |
| Safe Haskell | None |
| Language | Haskell2010 |
Portager.Writes
Description
This module provides functionality for serialization of portage configuration to configuration files.
- withAtom :: FlatPackage -> Text -> Text
- toPackageUseRecord :: FlatPackage -> Maybe Text
- toPackageUse :: [FlatPackage] -> [Text]
- toPackageAcceptKeywordRecord :: FlatPackage -> Maybe Text
- toPackageAcceptKeywords :: [FlatPackage] -> [Text]
- toPackageLicenseRecord :: FlatPackage -> Maybe Text
- toPackageLicense :: [FlatPackage] -> [Text]
- toPortageSet :: SetConfiguration -> [Text]
- data PortageSetConfig = PortageSetConfig {}
- createPortageSetConfig :: PackageSet -> PortageSetConfig
- writeLines :: FilePath -> [Text] -> IO ()
- writePortageSetFile :: FilePath -> FilePath -> [Text] -> ReaderT Options IO ()
- writePortageSetConfig :: Int -> PortageSetConfig -> ReaderT Options IO ()
- writePortageSetConfigs :: [WorldSet] -> [PortageSetConfig] -> ReaderT Options IO ()
Documentation
withAtom :: FlatPackage -> Text -> Text Source #
Adds Atom name as a prefix to text given as parameter.
toPackageUseRecord :: FlatPackage -> Maybe Text Source #
Creates a text record for package in a format required by package.use file.
toPackageUse :: [FlatPackage] -> [Text] Source #
Creates a list of records to be written to portage use file etcportagepackage.use*
See toPackageUseRecord
toPackageAcceptKeywordRecord :: FlatPackage -> Maybe Text Source #
Creates a text record for a package in a format required by package.accept_keywords file.
toPackageAcceptKeywords :: [FlatPackage] -> [Text] Source #
Creates a list of lines to be written to portage accept_keywords file etcportagepackage.accept_keywords*
See toPackageAcceptKeywordRecord
toPackageLicenseRecord :: FlatPackage -> Maybe Text Source #
Creates a text record for a package in a format required by package.license files.
toPackageLicense :: [FlatPackage] -> [Text] Source #
Creates a list of lines to be written to a portage license file etcportage/package.license
See toPackageLicenseRecord
toPortageSet :: SetConfiguration -> [Text] Source #
Creates a collection of lines to be written to a portage set file etcportagesets*
data PortageSetConfig Source #
Constructors
| PortageSetConfig | |
Fields
| |
Instances
createPortageSetConfig :: PackageSet -> PortageSetConfig Source #
Converts a PackageSet to PortageSetConfig that can
writePortageSetFile :: FilePath -> FilePath -> [Text] -> ReaderT Options IO () Source #
Writes text lines to a file enclosed in directory, creating the directory if it does not exist.
If there are no lines to be written, no action is performed.
Parent of a directory is read from Options.
writePortageSetConfig :: Int -> PortageSetConfig -> ReaderT Options IO () Source #
Writes a PortageSetConfig with specified index to respective files.
package.use file is prefixed with an index, since it is sensitive to order.
writePortageSetConfigs :: [WorldSet] -> [PortageSetConfig] -> ReaderT Options IO () Source #
Performs writePortageSetConfig for WorldSets given as parameter