cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [19/50] git commit: updated refs/heads/saml2 to 09da909
Date Sat, 16 Aug 2014 10:55:50 GMT
marvin: Fix marvin.sync profile, fixes regression from e10f8e8

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/22792894
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/22792894
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/22792894

Branch: refs/heads/saml2
Commit: 2279289465441447790bc64f38624e03fc0ec78b
Parents: 701b7a2
Author: Leo Simons <lsimons@schubergphilis.com>
Authored: Wed Aug 13 11:15:41 2014 +0200
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Wed Aug 13 11:15:41 2014 +0200

----------------------------------------------------------------------
 tools/marvin/mvn-setup.py | 54 ++++++++++++++++++++++++++++++++++++++++++
 tools/marvin/pom.xml      |  9 ++++---
 tools/marvin/setup.py     |  8 +------
 3 files changed, 61 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/22792894/tools/marvin/mvn-setup.py
----------------------------------------------------------------------
diff --git a/tools/marvin/mvn-setup.py b/tools/marvin/mvn-setup.py
new file mode 100755
index 0000000..5aa251b
--- /dev/null
+++ b/tools/marvin/mvn-setup.py
@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# wrapper around setup.py which injects the version number provided as a
+# command line argument called from maven (see pom.xml)
+
+import sys
+import re
+import subprocess
+
+import os.path
+
+basedir = os.path.dirname(__file__)
+setupScript = os.path.join(basedir, 'setup.py')
+
+
+def replaceVersion(fname, version):
+    """replace VERSION in setup.py"""
+    with open(fname, 'r') as f:
+        content = f.read()
+    needle = '\nVERSION\s*=\s*[\'"][^\'"]*[\'"]'
+    replacement = '\nVERSION = "%s"' % version
+    content = re.sub(needle, replacement, content, 1)
+    with open(fname, 'w') as f:
+        f.write(content)
+
+
+def runSetupScript(args):
+    """Invoke setup.py with the provided arguments"""
+    cmd = ['python', setupScript] + args
+    exitCode = subprocess.call(cmd)
+    return exitCode
+
+
+if __name__ == "__main__":
+    version = sys.argv[1]
+    remainingArgs = sys.argv[2:]
+    replaceVersion(setupScript, version)
+    runSetupScript(remainingArgs)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/22792894/tools/marvin/pom.xml
----------------------------------------------------------------------
diff --git a/tools/marvin/pom.xml b/tools/marvin/pom.xml
index 3bf70e0..381a22c 100644
--- a/tools/marvin/pom.xml
+++ b/tools/marvin/pom.xml
@@ -72,7 +72,8 @@
               <workingDirectory>${exec.workingdir}</workingDirectory>
               <executable>python</executable>
               <arguments>
-                <argument>setup.py</argument>
+                <argument>mvn-setup.py</argument>
+                <argument>${project.version}</argument>
                 <argument>sdist</argument>
               </arguments>
             </configuration>
@@ -125,7 +126,8 @@
                   <workingDirectory>${exec.workingdir}</workingDirectory>
                   <executable>python</executable>
                   <arguments>
-                    <argument>setup.py</argument>
+                    <argument>mvn-setup.py</argument>
+                    <argument>${project.version}</argument>
                     <argument>sdist</argument>
                   </arguments>
                 </configuration>
@@ -141,8 +143,9 @@
                   <executable>pip</executable>
                   <arguments>
                     <argument>install</argument>
+                    <argument>--allow-external</argument>
                     <argument>--upgrade</argument>
-                    <argument>Marvin-0.1.0.tar.gz</argument>
+                    <argument>Marvin-${project.version}.tar.gz</argument>
                   </arguments>
                 </configuration>
               </execution>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/22792894/tools/marvin/setup.py
----------------------------------------------------------------------
diff --git a/tools/marvin/setup.py b/tools/marvin/setup.py
index 555d67d..03e53c9 100644
--- a/tools/marvin/setup.py
+++ b/tools/marvin/setup.py
@@ -27,13 +27,7 @@ except ImportError:
         raise RuntimeError("python setuptools is required to build Marvin")
 
 
-VERSION = '4.5.0'
-
-import os
-
-
-def read(fname):
-    return open(os.path.join(os.path.dirname(__file__), fname)).read().strip()
+VERSION = "4.5.0-SNAPSHOT"
 
 setup(name="Marvin",
       version=VERSION,


Mime
View raw message