writePortageSetConfig :: Int -> PortageSetConfig -> ReaderT Options IO ()
writePortageSetConfig index (PortageSetConfig pName pSet pUseflags pKeywords pLicenses) =
  do writePortageSetFile "sets" name pSet
     writePortageSetFile "package.use" (printf "%02d" index <> name) pUseflags
     writePortageSetFile "package.accept_keywords" name pKeywords
     writePortageSetFile "package.license" name pLicenses
  where name = Text.unpack pName

-- |Performs 'writePortageSetConfig' for WorldSets given as parameter
writePortageSetConfig :: Int -> PortageSetConfig -> ReaderT Options IO ()
writePortageSetConfig index (PortageSetConfig pName pSet pUseflags pKeywords pLicenses) =
  do writePortageSetFile "sets" name pSet
     writePortageSetFile "package.use" (printf "%02d" index <> name) pUseflags
     writePortageSetFile "package.accept_keywords" name pKeywords
     writePortageSetFile "package.license" name pLicenses
  where name = Text.unpack pName

-- |Performs 'writePortageSetConfig' for WorldSets given as parameter
writePortageSetConfig index (PortageSetConfig pName pSet pUseflags pKeywords pLicenses) =
  do writePortageSetFile "sets" name pSet
     writePortageSetFile "package.use" (printf "%02d" index <> name) pUseflags
     writePortageSetFile "package.accept_keywords" name pKeywords
     writePortageSetFile "package.license" name pLicenses
  where name = Text.unpack pName

-- |Performs 'writePortageSetConfig' for WorldSets given as parameter