CurryInfo: cpm-3.3.0 / CPM.Package.Helpers.cleanPackage

definition:
cleanPackage :: Config -> LogLevel -> ErrorLogger ()
cleanPackage cfg ll = do
  specDir <- getLocalPackageSpec cfg "."
  pkg     <- loadPackageSpec specDir
  let dotcpm   = specDir </> ".cpm"
      srcdirs  = map (specDir </>) (sourceDirsOf pkg)
      testdirs = map (specDir </>)
                     (maybe []
                            (map (\ (PackageTest m _ _ _) -> m))
                            (testSuite pkg))
      cldirs   = nub (dotcpm : map (</> compilerSubdir) (srcdirs ++ testdirs))
  rmdirs <- filterM (liftIOEL . doesDirectoryExist) cldirs
  unless (null rmdirs) $ do
    logAt ll $ "Removing directories: " ++ unwords rmdirs
    showExecCmd (unwords $ ["rm", "-rf"] ++ rmdirs)
    return ()
 where
  --- Name of the sub directory where auxiliary files (.fint, .fcy, etc)
  --- are stored, e.g., ".curry/pakcs-3.6.0".
  compilerSubdir =
    let (cname,cmaj,cmin,crev) = compilerVersion cfg
    in ".curry" </>
       cname ++ '-' : intercalate "." (map show [cmaj,  cmin, crev])
demand:
no demanded arguments
deterministic:
deterministic operation
documentation:
------------------------------------------------------------------------------
--- Cleans auxiliary files in the local package, i.e., the package
--- containing the current working directory.
failfree:
<FAILING>
indeterministic:
referentially transparent operation
infix:
no fixity defined
iotype:
{(_,_) |-> _}
name:
cleanPackage
precedence:
no precedence defined
result-values:
_
signature:
CPM.Config.Config -> CPM.ErrorLogger.LogLevel -> CPM.ErrorLogger.ErrorLogger ()
solution-complete:
operation might suspend on free variables
terminating:
possibly non-terminating
totally-defined:
possibly non-reducible on same data term