Commit 18acb60c authored by John van Groningen's avatar John van Groningen

use OlderOrSame_Date instead of Older_Date to compare date/time, to recompile...

use OlderOrSame_Date instead of Older_Date to compare date/time, to recompile files if the date/time is the same (using more accurate times would be useful)
parent d14267bf
Pipeline #43685 passed with stage
in 44 seconds
......@@ -1589,7 +1589,7 @@ check_object_file_out_of_date mdn sys abccache fileinfo project ps
= FI_GetFileInfo tp mdn abccache fileinfo ps
# abcexists = modinfo.abcdate.exists
# objexists = modinfo.objdate.exists
# olderdate = Older_Date modinfo.objdate modinfo.abcdate
# olderdate = OlderOrSame_Date modinfo.objdate modinfo.abcdate
# abc = abcexists && (olderdate || not objexists)
# mn = mdn.mdn_name
# cg_opt = if sys
......@@ -1653,7 +1653,7 @@ where
check date Nil files = (False,files)
check date (hd :! tl) files
# (objDate, files) = FModified hd files
| Older_Date date objDate = (True,files)
| OlderOrSame_Date date objDate = (True,files)
= check date tl files
CheckExecOutOfDate :: !Bool !Pathname !FileInfoCache !Project !*GeneralSt -> *(Bool,*GeneralSt)
......@@ -1669,7 +1669,7 @@ CheckExecOutOfDate gen execpath fileinfo project ps
= (True, verboseInfo be_verbose lines ps)
# (date, ps) = accFiles (FModified execpath) ps
# youngest = YoungestObj NoDate fileinfo
# link = youngest.exists && (not date.exists || Older_Date date youngest)
# link = youngest.exists && (not date.exists || OlderOrSame_Date date youngest)
| link
# lines = if be_verbose
(if date.exists
......@@ -1763,7 +1763,7 @@ OptimiseABC mdn abc_path abc_date ps
# abcopt_path = abc_path % (0,size abc_path-4) +++ "opt.abc"
# (abcopt_date,ps) = accFiles (FModified abcopt_path) ps
| abcopt_date.exists && Older_Date abc_date abcopt_date
| abcopt_date.exists && OlderOrSame_Date abc_date abcopt_date
= (True, ps)
# ps = showInfo (Level2 ("Optimising ABC for '" +++ mdn.mdn_name +++ "'.")) ps
......@@ -1798,7 +1798,7 @@ ByteCodeGen bcgen_version use_optimised_abc mdn abc_path ps
where
requires_codegen bc_path abc_date bc_date ps
| not bc_date.exists = (True,ps)
| not (Older_Date abc_date bc_date) = (True,ps)
| not (OlderOrSame_Date abc_date bc_date) = (True,ps)
# ((ok,bytecode),ps) = accFiles (\fs -> let (ok,f,fs`) = fopen bc_path FReadData fs in ((ok,f),fs`)) ps
| not ok = (True,ps)
# (ok,bytecode) = fseek bytecode 8 FSeekSet
......
......@@ -2,7 +2,7 @@ implementation module PmFileInfo
import StdBool
from UtilIO import FModified
from UtilDate import Older_Date
from UtilDate import OlderOrSame_Date
import UtilStrictLists
import PmPath, PmCompilerOptions, PmTypes
import PmAbcMagic
......@@ -112,7 +112,7 @@ YoungestObj youngest ({objdate}:!rest)
= YoungestObj objdate rest
| not objdate.exists
= YoungestObj youngest rest
| Older_Date youngest objdate
| OlderOrSame_Date youngest objdate
= YoungestObj objdate rest
// otherwise
= YoungestObj youngest rest
......@@ -15,6 +15,5 @@ NoDate :== {exists=False,yy=0,mm=0,dd=0,h=0,m=0,s=0}
instance fromString DATE
instance toString DATE
// Checks whether the first date is older than the second one.
Older_Date :: !DATE !DATE -> Bool
// Checks whether the first date is older than or the same as the second one.
OlderOrSame_Date :: !DATE !DATE -> Bool;
......@@ -73,17 +73,20 @@ where
BoolToAnswer False = "No"
BoolToAnswer true = "Yes"
/* Checks whether the first date is older than the second one.
*/
Older_Date :: !DATE !DATE -> Bool;
Older_Date {exists=b1,yy=yy1,mm=mm1,dd=dd1,h=h1,m=m1,s=s1}
{exists=b2,yy=yy2,mm=mm2,dd=dd2,h=h2,m=m2,s=s2}
| b1 && not b2 = True;
| not b1 || not b2 = False;
= Older_IntList [yy1,mm1,dd1,h1,m1,s1] [yy2,mm2,dd2,h2,m2,s2];
where
Older_IntList :: ![Int] ![Int] -> Bool;
Older_IntList [] [] = False;
Older_IntList [h1:t1] [h2:t2] | h1 < h2 = True;
| h1 > h2 = False;
= Older_IntList t1 t2;
// Checks whether the first date is older than or the same as the second one.
OlderOrSame_Date :: !DATE !DATE -> Bool;
OlderOrSame_Date {exists=b1,yy=yy1,mm=mm1,dd=dd1,h=h1,m=m1,s=s1}
{exists=b2,yy=yy2,mm=mm2,dd=dd2,h=h2,m=m2,s=s2}
| not b1 || not b2
= b1;
| yy1<>yy2
= yy1<yy2;
| mm1<>mm2
= mm1<mm2;
| dd1<>dd2
= dd1<dd2;
| h1<>h2
= h1<h2;
| m1<>m2
= m1<m2;
= s1<=s2;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment