CurryInfo: cpm-3.3.0 / CPM.Repository.CacheDB.addPackagesToRepositoryDB

definition:
addPackagesToRepositoryDB :: Config -> Bool
                          -> [Either Package [String]] -> ErrorLogger ()
addPackagesToRepositoryDB cfg quiet pkgs =
  mapM (runDBAction . newEntry) pkgs >> return ()
 where
  runDBAction act = do
    result <- liftIOEL $ runWithDB (repositoryCacheDB cfg) act
    case result of
      Left (DBError kind str) -> logCritical $ "Repository DB failure: " ++
                                                   show kind ++ " " ++ str
      Right _ -> liftIOEL $ do
        unless quiet $ putChar '.'
        hFlush stdout
        return ()
  
  newEntry (Left p) =
    newIndexEntry (name p)
                  (showTerm (version p))
                  (showTerm (dependencies p))
                  (showTerm (compilerCompatibility p))
                  (synopsis p)
                  (showTerm (category p))
                  (showTerm (sourceDirs p))
                  (showTerm (exportedModules p))
                  (showTerm (listToMaybe (executableSpec  p)))
  newEntry (Right row) = case row of
    [pn,pv,deps,cc,syn,cat,dirs,mods,exe] ->
      newIndexEntry pn pv deps cc syn cat dirs mods exe
    _ -> error $ "CPM.Repository.CacheDB: internal format error"  
demand:
no demanded arguments
deterministic:
deterministic operation
documentation:
--- Add a list of package descriptions to the database.
--- Here, a package description is either a (reduced) package specification
--- or a list of string (a row from a CSV file) containing the required infos.
failfree:
<FAILING>
indeterministic:
referentially transparent operation
infix:
no fixity defined
iotype:
{(_,_,_) |-> _}
name:
addPackagesToRepositoryDB
precedence:
no precedence defined
result-values:
_
signature:
CPM.Config.Config -> Prelude.Bool
-> [Prelude.Either CPM.Package.Package [String]]
-> CPM.ErrorLogger.ErrorLogger ()
solution-complete:
operation might suspend on free variables
terminating:
possibly non-terminating
totally-defined:
possibly non-reducible on same data term