From 54195d81358b48ea54408fbc8dc0336537aafdbb Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Fri, 14 Dec 2012 23:10:10 +0000 Subject: [PATCH] kextract: Propagate the GRP file's modification time to all extracted files. git-svn-id: https://svn.eduke32.com/eduke32@3293 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/compat.h | 1 + polymer/eduke32/build/src/util/kextract.c | 16 ++++++++++++++++ .../eduke32/package/samples/dump_used_assets.m32 | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/build/include/compat.h b/polymer/eduke32/build/include/compat.h index bc8779552..66b66faa3 100644 --- a/polymer/eduke32/build/include/compat.h +++ b/polymer/eduke32/build/include/compat.h @@ -587,6 +587,7 @@ static inline uint16_t system_15bit_rand(void) { return ((uint16_t)rand())&0x7ff # define Bgetcwd getcwd # define Bgetenv getenv # define Btime() time(NULL) +# define Butime utime #else diff --git a/polymer/eduke32/build/src/util/kextract.c b/polymer/eduke32/build/src/util/kextract.c index f0fd951ac..386dec5e7 100644 --- a/polymer/eduke32/build/src/util/kextract.c +++ b/polymer/eduke32/build/src/util/kextract.c @@ -7,6 +7,8 @@ #include "compat.h" +#include + #define MAXFILES 4096 static char buf[65536]; @@ -36,6 +38,7 @@ void findfiles(const char *dafilespec) int main(int argc, char **argv) { int i, j, k, l, fil, fil2; + struct Bstat stbuf; int onlylist = (argc==2); @@ -126,6 +129,9 @@ int main(int argc, char **argv) return(0); } + if (Bfstat(fil, &stbuf) == -1) + stbuf.st_mtime = 0; + for(i=0;i