From d8e980a9dda8a1eb4eec259104042a44c79ba872 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Thu, 17 Jan 2013 12:32:51 +0100 Subject: [PATCH 1/2] Upgrade to latest version of pake --- pake.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pake.py b/pake.py index cb3ac846b9..dec8b71a7a 100644 --- a/pake.py +++ b/pake.py @@ -152,9 +152,7 @@ class Target(object): content = urllib2.urlopen(url).read() if md5 and hashlib.md5(content).hexdigest() != md5: raise BuildError(self, 'corrupt download') - # FIXME Python on Windoze corrupts the content when writing it - # FIXME probably something to do with encodings - with open(self.name, 'w') as f: + with open(self.name, 'wb') as f: f.write(content) def error(self, message): @@ -178,6 +176,10 @@ class Target(object): self.info('mkdir -p %s', path) os.makedirs(path) + def newer(self, *args): + args = flatten_expand_list(args) + return [arg for arg in args if targets.get(arg).timestamp > self.timestamp] + def output(self, *args, **kwargs): args = flatten_expand_list(args) self.info(' '.join(args)) From 1ebea904abe2e0b1d9f406d861a90c3de0672695 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Thu, 17 Jan 2013 12:33:10 +0100 Subject: [PATCH 2/2] Only run gjslint on modified files --- build.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.py b/build.py index b19e28f9bd..6d2410ae59 100755 --- a/build.py +++ b/build.py @@ -192,13 +192,13 @@ def build_lint_src_timestamp(t): limited_doc_files = [path for path in ifind('externs', 'build/src/external/externs') if path.endswith('.js')] - t.run('%(GJSLINT)s', '--strict', '--limited_doc_files=%s' % (','.join(limited_doc_files),), SRC, INTERNAL_SRC, EXTERNAL_SRC, EXAMPLES_SRC) + t.run('%(GJSLINT)s', '--strict', '--limited_doc_files=%s' % (','.join(limited_doc_files),), t.newer(SRC, INTERNAL_SRC, EXTERNAL_SRC, EXAMPLES_SRC)) t.touch() @target('build/lint-spec-timestamp', SPEC) def build_lint_spec_timestamp(t): - t.run('%(GJSLINT)s', SPEC) + t.run('%(GJSLINT)s', t.newer(SPEC)) t.touch()