projects
/
litex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9d716de
)
Don't modify file if contents hasn't changed.
author
Tim 'mithro' Ansell
<mithro@mithis.com>
Thu, 15 Dec 2016 18:14:12 +0000
(19:14 +0100)
committer
Tim 'mithro' Ansell
<mithro@mithis.com>
Thu, 15 Dec 2016 18:14:12 +0000
(19:14 +0100)
litex/build/tools.py
patch
|
blob
|
history
diff --git
a/litex/build/tools.py
b/litex/build/tools.py
index 9e0880d594cb697b85864c2a683e345923fa57b4..34c054b16ec69a25122780bde7d9f0d56b0b5e02 100644
(file)
--- a/
litex/build/tools.py
+++ b/
litex/build/tools.py
@@
-23,6
+23,9
@@
def write_to_file(filename, contents, force_unix=False):
newline = None
if force_unix:
newline = "\n"
+ if os.path.exists(filename):
+ if open(filename, "r", newline=newline).read() == contents:
+ return
with open(filename, "w", newline=newline) as f:
f.write(contents)