[Pkg-owncloud-commits] [python-owncloud] 60/96: Makes pyOwnCloud installable and detect the correct version number.

Sandro Knauß hefee-guest at moszumanska.debian.org
Fri Nov 22 01:28:28 UTC 2013


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository python-owncloud.

commit 54b1afcef0b9a003aab3794fcf797a3ddeec68c9
Author: hefee <hefee at netzguerilla.net>
Date:   Thu Mar 28 12:44:01 2013 +0100

    Makes pyOwnCloud installable and detect the correct version number.
    
    pyOwnCloud uses csync/devel to detect if it is installed or not.
    
    Fix: #13
---
 csync/version.py |   11 +++++++++--
 version.dat      |    1 -
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/csync/devel b/csync/devel
new file mode 100644
index 0000000..e69de29
diff --git a/csync/version.py b/csync/version.py
index 1cc0d82..d241a9e 100644
--- a/csync/version.py
+++ b/csync/version.py
@@ -1,6 +1,6 @@
 import subprocess
 import json
-
+import os
 class ver(object):
 	def __init__(self, verfile='version.dat'):
 		self.verfile = verfile
@@ -15,6 +15,9 @@ class ver(object):
 	@property
 	def asString(self):
 		return self.version['string']
+	@property
+	def asHead(self):
+		return self.version['head']
 	def makeString(self):
 		s = str(self.asFloat)
 		#s = s.replace('.','_')
@@ -107,7 +110,11 @@ class gitVersion(ver):
 	def asHead(self):
 		return self.getHeadVersion()
 
-version = gitVersion()
+BASE_DIR = os.path.abspath(os.path.dirname(__file__))
+if os.path.exists(os.path.join(BASE_DIR, 'devel')):
+    version = gitVersion(os.path.join(BASE_DIR, 'version.dat'))
+else:
+    version = ver(os.path.join(BASE_DIR, 'version.dat'))
 
 
 if __name__ == '__main__':
diff --git a/version.dat b/version.dat
deleted file mode 100644
index c647105..0000000
--- a/version.dat
+++ /dev/null
@@ -1 +0,0 @@
-{"head": "5c32717e4b3770da29c4ba61004be2e0239c2616", "float": 0.0, "string": "0.0"}
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/python-owncloud.git



More information about the Pkg-owncloud-commits mailing list