summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2014-01-09 15:14:35 +0000
committerhallgren <hallgren@chalmers.se>2014-01-09 15:14:35 +0000
commit768d9de6681b5ac69b42128fbde18c8421cb5f1e (patch)
treefac169a39eb8492ef0f82f30d3ed9f7294359177 /src
parented1e662dea036e72f48e5362af6183c8f1cbcb08 (diff)
Check file datestamps before unioning PGF files (fix)
Also check that no additional output formats have been selected.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/GFC.hs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/compiler/GFC.hs b/src/compiler/GFC.hs
index ef63104f9..65650d922 100644
--- a/src/compiler/GFC.hs
+++ b/src/compiler/GFC.hs
@@ -16,7 +16,6 @@ import GF.Infra.UseIO
import GF.Infra.Option
import GF.Data.ErrM
import GF.System.Directory
-import GF.System.Catch
import Data.Maybe
import Data.Binary
@@ -65,7 +64,10 @@ compileCFFiles opts fs =
writeOutputs opts pgf
unionPGFFiles :: Options -> [FilePath] -> IOE ()
-unionPGFFiles opts fs = maybe doIt checkFirst (flag optName opts)
+unionPGFFiles opts fs =
+ if null (outputFormats opts)
+ then maybe doIt checkFirst (flag optName opts)
+ else doIt
where
checkFirst name =
do let pgfFile = name <.> "pgf"
@@ -91,10 +93,11 @@ unionPGFFiles opts fs = maybe doIt checkFirst (flag optName opts)
writeOutputs :: Options -> PGF -> IOE ()
writeOutputs opts pgf = do
sequence_ [writeOutput opts name str
- | fmt <- flag optOutputFormats opts,
- fmt /= FmtByteCode,
+ | fmt <- outputFormats opts,
(name,str) <- exportPGF opts fmt pgf]
+outputFormats opts = [fmt | fmt <- flag optOutputFormats opts, fmt/=FmtByteCode]
+
writeByteCode :: Options -> PGF -> IOE ()
writeByteCode opts pgf
| elem FmtByteCode (flag optOutputFormats opts) =