Little enhancement of the install script. 6_0_x

Sat, 04 Jul 2015 14:46:40 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 04 Jul 2015 14:46:40 +0200
branch
6_0_x
changeset 4308
3f9ea1a38560
parent 4306
283afcf306eb
child 4310
493dda042b16

Little enhancement of the install script.
(grafted from 6a8ec996a49cabcfea51a03dfc4475bf8ec5318d)

install.py file | annotate | diff | comparison | revisions
--- a/install.py	Sat Jul 04 11:52:05 2015 +0200
+++ b/install.py	Sat Jul 04 14:46:40 2015 +0200
@@ -1323,7 +1323,10 @@
     if not fileName:
         return
     
-    os.rename(fileName, fileName + ".orig")
+    try:
+        os.rename(fileName, fileName + ".orig")
+    except EnvironmentError:
+        pass
     try:
         hgOut = subprocess.check_output(["hg", "identify", "-i"])
         if sys.version_info[0] == 3:
@@ -1340,7 +1343,8 @@
             f = open(fileName + ".orig", "r", encoding="utf-8")
         text = f.read()
         f.close()
-        text = text.replace("@@REVISION@@", hgOut)
+        text = text.replace("@@REVISION@@", hgOut)\
+            .replace("@@VERSION@@", "rev_" + hgOut)
         copyToFile(fileName, text)
     else:
         shutil.copy(fileName + ".orig", fileName)

eric ide

mercurial