[remove old references to the haskell object directory, made everything cache based. added --purge-cache
John Meacham <john@repetae.net>**20120206122444
 Ignore-this: cf29653dddfaaf3db701cf518d7d8315
] hunk ./Makefile.am 362
-    pretty-1.0.1.1.hl QuickCheck-1.2.0.0.hl safe-0.2.hl smallcheck-0.4.hl utility-ht-0.0.5.1.hl \
+    pretty-1.0.1.1.hl QuickCheck-1.2.0.0.hl safe-0.2.hl smallcheck-0.4.hl \
hunk ./regress/regress.prl 61
-@opts = (@opts, '--no-ho', '--stop', 'typecheck') if $opt_tc;
+@opts = (@opts, '--no-cache', '--stop', 'typecheck') if $opt_tc;
hunk ./regress/regress.prl 373
-   --clean       build .ho files for tests from scratch
+   --clean       start with fresh cache for test
hunk ./src/Ho/Build.hs 78
--- LINK - redirect to another file for systems without symlinks
+-- LINK - redirect to another file for file systems without symlinks
hunk ./src/Ho/Build.hs 84
+-- FILE - Extra file, such as embedded c code.
hunk ./src/Ho/Build.hs 87
- - We separate the data into various chunks for logical layout as well as the important property that
- - each chunk is individually compressed and accessable. What this means is
- - that we can skip chunks we don't need. for instance, during the final link
- - we have no need of the haskell type checking information, we are only
- - interested in the compiled code, so we can jump directly to it. If we relied on straight
- - serialization, we would have to parse all preceding information just to discard it right away.
- - We also lay them out so that we can generate error messages quickly. for instance, we can determine
- - if a symbol is undefined quickly, before it has to load the typechecking data.
+ - We separate the data into various chunks for logical layout as well as the
+ - important property that each chunk is individually compressed and accessable.
+ - What this means is that we can skip chunks we don't need. for instance,
+ - during the final link we have no need of the haskell type checking
+ - information, we are only interested in the compiled code, so we can jump
+ - directly to it. If we relied on straight serialization, we would have to
+ - parse all preceding information just to discard it right away.  We also lay
+ - them out so that we can generate error messages quickly. for instance, we can
+ - determine if a symbol is undefined quickly, before it has to load the
+ - typechecking data.
hunk ./src/Main.hs 5
+import Data.Char
hunk ./src/Main.hs 7
+import System.Directory
+import System.FilePath as FP
hunk ./src/Main.hs 48
+        PurgeCache    -> purgeCache
hunk ./src/Main.hs 55
+-- we are very careful to only delete cache files.
+purgeCache = do
+    Just hc <- findHoCache
+    ds <- getDirectoryContents hc
+    let cacheFile fn = case map toLower (reverse fn) of
+            'o':'h':'.':fs -> length fs == 26 && all isAlphaNum fs
+            _ -> False
+    forM_ ds $ \fn -> when (cacheFile fn) (removeFile (hc </> fn))
+
hunk ./src/Options.hs 150
+          | PurgeCache               -- ^ Purge the cache
hunk ./src/Options.hs 245
+    , Option []    ["purge-cache"]     (NoArg  (optMode_s PurgeCache))       "clean out jhc compilation cache"
hunk ./src/Options.hs 248
-    , Option ['d'] []                  (ReqArg (optDump_u . (:))        "[no-]flag")  "dump specified data during compilation"
-    , Option ['f'] []                  (ReqArg (optFOpts_u . (:))       "[no-]flag") "set or clear compilation options"
+    , Option ['d'] []                  (ReqArg (optDump_u . (:))  "[no-]flag") "dump specified data during compilation"
+    , Option ['f'] []                  (ReqArg (optFOpts_u . (:)) "[no-]flag") "set or clear compilation options"
hunk ./src/Options.hs 261
-    , Option []    ["stop"]            (ReqArg (optStop_s . stop) "parse/typecheck/c")  "stop after the given pass, parse/typecheck/c"
+    , Option []    ["stop"]            (ReqArg (optStop_s . stop) "parse/typecheck/c") "stop after the given pass, parse/typecheck/c"
hunk ./src/Options.hs 275
-    , Option []    ["ignore-ho"]       (NoArg  (optIgnoreHo_s True))         "Ignore existing haskell object files"
-    , Option []    ["nowrite-ho"]      (NoArg  (optNoWriteHo_s True))        "Do not write new haskell object files"
-    , Option []    ["no-ho"]           (NoArg  (optNoWriteHo_s True . optIgnoreHo_s True)) "same as --ignore-ho and --nowrite-ho"
-    , Option []    ["ho-cache"]        (ReqArg (optHoCache_s . Just ) "JHC_CACHE")  "Use a global cache located in the directory passed as an argument."
-    , Option []    ["ho-dir"]          (ReqArg (optHoDir_s . Just ) "<dir>")    "Where to place and look for ho files"
-    , Option []    ["stale"]           (ReqArg (optStale_u . idu) "Module")     "Treat these modules as stale, even if a ho file is present"
+    , Option []    ["ignore-cache"]    (NoArg  (optIgnoreHo_s True))         "Ignore existing compilation cache entries."
+    , Option []    ["readonly-cache"]  (NoArg  (optNoWriteHo_s True))        "Do not write new information to the compilation cache."
+    , Option []    ["no-cache"]        (NoArg  (optNoWriteHo_s True . optIgnoreHo_s True)) "Do not use or update the cache."
+    , Option []    ["cache-dir"]       (ReqArg (optHoCache_s . Just ) "JHC_CACHE")  "Use a global cache located in the directory passed as an argument."
+--    , Option []    ["ho-dir"]          (ReqArg (optHoDir_s . Just ) "<dir>")    "Where to place and look for ho files"
+    , Option []    ["stale"]           (ReqArg (optStale_u . idu) "Module")  "Treat these modules as stale, even if they exist in the cache"