-- |Creates a text record for package in a format required by @package.use@ file.
toPackageUseRecord :: FlatPackage -> Maybe Text
toPackageUseRecord fp
  | null useflags = Nothing
  | otherwise = Just $ withAtom fp $ showText useflags
  where useflags = Set.toAscList $_fpUseflags fp

-- |Creates a list of records to be written to portage use file @/etc/portage/package.use/*@
-- See 'toPackageUseRecord'
toPackageUseRecord :: FlatPackage -> Maybe Text
toPackageUseRecord fp
  | null useflags = Nothing
  | otherwise = Just $ withAtom fp $ showText useflags
  where useflags = Set.toAscList $_fpUseflags fp

-- |Creates a list of records to be written to portage use file @/etc/portage/package.use/*@
-- See 'toPackageUseRecord'
toPackageUseRecord fp
  | null useflags = Nothing
  | otherwise = Just $ withAtom fp $ showText useflags
  where useflags = Set.toAscList $_fpUseflags fp

-- |Creates a list of records to be written to portage use file @/etc/portage/package.use/*@
-- See 'toPackageUseRecord'