definition:
|
searchExecutable :: Config -> String -> ErrorLogger [Package]
searchExecutable cfg pat =
(queryDBorCache cfg True $
fmap (pkgsToRepository . map toPackage)
(Database.CDBI.ER.getColumnFiveTuple [] [Database.CDBI.ER.FiveCS Database.CDBI.ER.All (Database.CDBI.ER.fiveCol (Database.CDBI.ER.singleCol CPM.Repository.RepositoryDB.indexEntryNameColDesc 0 Database.CDBI.ER.none) (Database.CDBI.ER.singleCol CPM.Repository.RepositoryDB.indexEntryVersionColDesc 0 Database.CDBI.ER.none) (Database.CDBI.ER.singleCol CPM.Repository.RepositoryDB.indexEntrySynopsisColDesc 0 Database.CDBI.ER.none) (Database.CDBI.ER.singleCol CPM.Repository.RepositoryDB.indexEntryCompilerCompatibilityColDesc 0 Database.CDBI.ER.none) (Database.CDBI.ER.singleCol CPM.Repository.RepositoryDB.indexEntryExecutableSpecColDesc 0 Database.CDBI.ER.none)) (Database.CDBI.ER.TC CPM.Repository.RepositoryDB.indexEntryTable 0 Nothing) (Database.CDBI.ER.Criteria (Database.CDBI.ER.like (Database.CDBI.ER.colNum CPM.Repository.RepositoryDB.indexEntryColumnExecutableSpec 0) (Database.CDBI.ER.string (pattern))) Nothing)] [] Nothing)
) >>= return . filterExec . allPackages
where
pattern = "%" ++ pat ++ "%"
lpat = map toLower pat
filterExec = filter (\p -> lpat `isInfixOf` (map toLower $ execOfPackage p))
toPackage (nm,vs,syn,cmp,exec) =
emptyPackage { name = nm
, version = pkgRead vs
, synopsis = syn
, compilerCompatibility = pkgRead cmp
, executableSpec = maybeToList (pkgRead exec)
}
|
documentation:
|
--- Returns the packages of the repository containing a given string
--- in the name of the executable.
--- In each package, the name, version, synopsis, compilerCompatibility,
--- and executableSpec is set.
|