-- |Creates a text record for a package in a format required by @package.license@ files.
toPackageLicenseRecord :: FlatPackage -> Maybe Text
toPackageLicenseRecord fp
  | null licenses = Nothing
  | otherwise = Just $ withAtom fp $ showText licenses
  where licenses = Set.toAscList $_fpLicenses fp

-- |Creates a list of lines to be written to a portage license file @/etc/portage/package.license@
-- See 'toPackageLicenseRecord'
toPackageLicenseRecord :: FlatPackage -> Maybe Text
toPackageLicenseRecord fp
  | null licenses = Nothing
  | otherwise = Just $ withAtom fp $ showText licenses
  where licenses = Set.toAscList $_fpLicenses fp

-- |Creates a list of lines to be written to a portage license file @/etc/portage/package.license@
-- See 'toPackageLicenseRecord'
toPackageLicenseRecord fp
  | null licenses = Nothing
  | otherwise = Just $ withAtom fp $ showText licenses
  where licenses = Set.toAscList $_fpLicenses fp

-- |Creates a list of lines to be written to a portage license file @/etc/portage/package.license@
-- See 'toPackageLicenseRecord'