forked from GitHub/gf-core
Check file datestamps before unioning PGF files (fix)
Also check that no additional output formats have been selected.
This commit is contained in:
@@ -16,7 +16,6 @@ import GF.Infra.UseIO
|
|||||||
import GF.Infra.Option
|
import GF.Infra.Option
|
||||||
import GF.Data.ErrM
|
import GF.Data.ErrM
|
||||||
import GF.System.Directory
|
import GF.System.Directory
|
||||||
import GF.System.Catch
|
|
||||||
|
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import Data.Binary
|
import Data.Binary
|
||||||
@@ -65,7 +64,10 @@ compileCFFiles opts fs =
|
|||||||
writeOutputs opts pgf
|
writeOutputs opts pgf
|
||||||
|
|
||||||
unionPGFFiles :: Options -> [FilePath] -> IOE ()
|
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
|
where
|
||||||
checkFirst name =
|
checkFirst name =
|
||||||
do let pgfFile = name <.> "pgf"
|
do let pgfFile = name <.> "pgf"
|
||||||
@@ -91,10 +93,11 @@ unionPGFFiles opts fs = maybe doIt checkFirst (flag optName opts)
|
|||||||
writeOutputs :: Options -> PGF -> IOE ()
|
writeOutputs :: Options -> PGF -> IOE ()
|
||||||
writeOutputs opts pgf = do
|
writeOutputs opts pgf = do
|
||||||
sequence_ [writeOutput opts name str
|
sequence_ [writeOutput opts name str
|
||||||
| fmt <- flag optOutputFormats opts,
|
| fmt <- outputFormats opts,
|
||||||
fmt /= FmtByteCode,
|
|
||||||
(name,str) <- exportPGF opts fmt pgf]
|
(name,str) <- exportPGF opts fmt pgf]
|
||||||
|
|
||||||
|
outputFormats opts = [fmt | fmt <- flag optOutputFormats opts, fmt/=FmtByteCode]
|
||||||
|
|
||||||
writeByteCode :: Options -> PGF -> IOE ()
|
writeByteCode :: Options -> PGF -> IOE ()
|
||||||
writeByteCode opts pgf
|
writeByteCode opts pgf
|
||||||
| elem FmtByteCode (flag optOutputFormats opts) =
|
| elem FmtByteCode (flag optOutputFormats opts) =
|
||||||
|
|||||||
Reference in New Issue
Block a user