mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge branch 'master' of ssh://git.cloud.com/var/lib/git/cloudstack-oss
This commit is contained in:
commit
9963ec0a46
2
.gitignore
vendored
2
.gitignore
vendored
@ -10,3 +10,5 @@ override
|
|||||||
premium
|
premium
|
||||||
.metadata
|
.metadata
|
||||||
dist
|
dist
|
||||||
|
*~
|
||||||
|
*.bak
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
<import file="${my.build.dir}/build-cloud.xml" optional="false"/>
|
<import file="${my.build.dir}/build-cloud.xml" optional="false"/>
|
||||||
<import file="${my.build.dir}/build-docs.xml" optional="true"/>
|
<import file="${my.build.dir}/build-docs.xml" optional="true"/>
|
||||||
<import file="${my.build.dir}/build-test.xml" optional="true"/>
|
<import file="${my.build.dir}/build-tests.xml" optional="true"/>
|
||||||
<import file="${my.build.dir}/package.xml" optional="true"/>
|
<import file="${my.build.dir}/package.xml" optional="true"/>
|
||||||
<import file="${my.build.dir}/developer.xml" optional="true"/>
|
<import file="${my.build.dir}/developer.xml" optional="true"/>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@ -44,6 +44,7 @@ intelligent cloud implementation.
|
|||||||
%package utils
|
%package utils
|
||||||
Summary: Cloud.com utility library
|
Summary: Cloud.com utility library
|
||||||
Requires: java >= 1.6.0
|
Requires: java >= 1.6.0
|
||||||
|
Requires: python
|
||||||
Group: System Environment/Libraries
|
Group: System Environment/Libraries
|
||||||
Obsoletes: vmops-utils < %{version}-%{release}
|
Obsoletes: vmops-utils < %{version}-%{release}
|
||||||
%description utils
|
%description utils
|
||||||
@ -447,6 +448,8 @@ fi
|
|||||||
%defattr(0644,root,root,0755)
|
%defattr(0644,root,root,0755)
|
||||||
%{_javadir}/%{name}-utils.jar
|
%{_javadir}/%{name}-utils.jar
|
||||||
%{_javadir}/%{name}-api.jar
|
%{_javadir}/%{name}-api.jar
|
||||||
|
%attr(755,root,root) %{_bindir}/cloud-sccs
|
||||||
|
%attr(755,root,root) %{_bindir}/cloud-gitrevs
|
||||||
%doc %{_docdir}/%{name}-%{version}/sccs-info
|
%doc %{_docdir}/%{name}-%{version}/sccs-info
|
||||||
%doc %{_docdir}/%{name}-%{version}/version-info
|
%doc %{_docdir}/%{name}-%{version}/version-info
|
||||||
%doc %{_docdir}/%{name}-%{version}/configure-info
|
%doc %{_docdir}/%{name}-%{version}/configure-info
|
||||||
|
|||||||
2
debian/cloud-utils.install
vendored
2
debian/cloud-utils.install
vendored
@ -3,3 +3,5 @@
|
|||||||
/usr/share/doc/cloud/sccs-info
|
/usr/share/doc/cloud/sccs-info
|
||||||
/usr/share/doc/cloud/version-info
|
/usr/share/doc/cloud/version-info
|
||||||
/usr/share/doc/cloud/configure-info
|
/usr/share/doc/cloud/configure-info
|
||||||
|
/usr/bin/cloud-sccs
|
||||||
|
/usr/bin/cloud-gitrevs
|
||||||
|
|||||||
2
debian/control
vendored
2
debian/control
vendored
@ -22,7 +22,7 @@ Provides: vmops-utils
|
|||||||
Conflicts: vmops-utils
|
Conflicts: vmops-utils
|
||||||
Replaces: vmops-utils
|
Replaces: vmops-utils
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: openjdk-6-jre
|
Depends: openjdk-6-jre, python
|
||||||
Description: Cloud.com utility library
|
Description: Cloud.com utility library
|
||||||
The Cloud.com utility libraries provide a set of Java classes used
|
The Cloud.com utility libraries provide a set of Java classes used
|
||||||
in the Cloud.com Cloud Stack.
|
in the Cloud.com Cloud Stack.
|
||||||
|
|||||||
13
utils/bindir/cloud-gitrevs.in
Normal file
13
utils/bindir/cloud-gitrevs.in
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import os, sys
|
||||||
|
|
||||||
|
path = os.path.join("@DOCDIR@","sccs-info")
|
||||||
|
try: text = file(path).read(-1)
|
||||||
|
except IOError,e:
|
||||||
|
if e.errno == 2:
|
||||||
|
sys.stderr.write("error: SCCS info file %r cannot be found\n"%path)
|
||||||
|
sys.exit(1)
|
||||||
|
else: raise
|
||||||
|
lines = [ s.strip() for s in text.split("\n") if s.startswith('Git Revision: ') ]
|
||||||
|
print " ".join( [ s[14:] for s in lines ] )
|
||||||
12
utils/bindir/cloud-sccs.in
Executable file
12
utils/bindir/cloud-sccs.in
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import os, sys
|
||||||
|
|
||||||
|
path = os.path.join("@DOCDIR@","sccs-info")
|
||||||
|
try: text = file(path).read(-1)
|
||||||
|
except IOError,e:
|
||||||
|
if e.errno == 2:
|
||||||
|
sys.stderr.write("error: SCCS info file %r cannot be found\n"%path)
|
||||||
|
sys.exit(1)
|
||||||
|
else: raise
|
||||||
|
print text
|
||||||
19
wscript
19
wscript
@ -144,8 +144,9 @@ def svninfo(*args):
|
|||||||
else: url = "SVN " + url[0].strip()
|
else: url = "SVN " + url[0].strip()
|
||||||
return rev + "\n" + url
|
return rev + "\n" + url
|
||||||
|
|
||||||
def gitinfo(*args):
|
def gitinfo(dir=None):
|
||||||
try: p = _Popen(['git','remote','show','-n','origin']+list(args),stdin=PIPE,stdout=PIPE,stderr=PIPE)
|
if dir and not _isdir(dir): return ''
|
||||||
|
try: p = _Popen(['git','remote','show','-n','origin'],stdin=PIPE,stdout=PIPE,stderr=PIPE,cwd=dir)
|
||||||
except OSError,e:
|
except OSError,e:
|
||||||
if e.errno == 2: return '' # svn command is not installed
|
if e.errno == 2: return '' # svn command is not installed
|
||||||
raise
|
raise
|
||||||
@ -158,7 +159,7 @@ def gitinfo(*args):
|
|||||||
except IndexError: url = [ s[5:] for s in stdout if s.startswith("URL") ][0]
|
except IndexError: url = [ s[5:] for s in stdout if s.startswith("URL") ][0]
|
||||||
assert url
|
assert url
|
||||||
|
|
||||||
p = _Popen(['git','log','-1']+list(args),stdin=PIPE,stdout=PIPE,stderr=PIPE)
|
p = _Popen(['git','log','-1'],stdin=PIPE,stdout=PIPE,stderr=PIPE,cwd=dir)
|
||||||
stdout,stderr = p.communicate('')
|
stdout,stderr = p.communicate('')
|
||||||
retcode = p.wait()
|
retcode = p.wait()
|
||||||
if retcode: return
|
if retcode: return
|
||||||
@ -169,6 +170,15 @@ def gitinfo(*args):
|
|||||||
|
|
||||||
return "Git Revision: %s"%commitid + "\n" + "Git URL: %s"%url
|
return "Git Revision: %s"%commitid + "\n" + "Git URL: %s"%url
|
||||||
|
|
||||||
|
def allgitinfo():
|
||||||
|
t = gitinfo()
|
||||||
|
if not t: return t
|
||||||
|
|
||||||
|
u = gitinfo(_join(pardir,"cloudstack-proprietary"))
|
||||||
|
if not u: return t
|
||||||
|
|
||||||
|
return t + "\n\ncloustack-proprietary:\n" + u
|
||||||
|
|
||||||
def _getbuildnumber(): # FIXME implement for git
|
def _getbuildnumber(): # FIXME implement for git
|
||||||
n = Options.options.BUILDNUMBER
|
n = Options.options.BUILDNUMBER
|
||||||
if n:
|
if n:
|
||||||
@ -230,6 +240,7 @@ def discover_ant_targets_and_properties(files):
|
|||||||
propsinpropfiles = [ l.strip().split("=",1) for f in files if f.endswith(".properties") for l in file(f).readlines() if "=" in l and not l.startswith("#") ]
|
propsinpropfiles = [ l.strip().split("=",1) for f in files if f.endswith(".properties") for l in file(f).readlines() if "=" in l and not l.startswith("#") ]
|
||||||
props = dict( propsinxml + propsinpropfiles )
|
props = dict( propsinxml + propsinpropfiles )
|
||||||
props["base.dir"] = '.'
|
props["base.dir"] = '.'
|
||||||
|
props["p.base.dir"] = '.'
|
||||||
|
|
||||||
result = []
|
result = []
|
||||||
for name,target in targets.items():
|
for name,target in targets.items():
|
||||||
@ -528,7 +539,7 @@ def dist_hook():
|
|||||||
if Options.options.OSS:
|
if Options.options.OSS:
|
||||||
[ shutil.rmtree(f) for f in "cloudstack-proprietary".split() if _exists(f) ]
|
[ shutil.rmtree(f) for f in "cloudstack-proprietary".split() if _exists(f) ]
|
||||||
|
|
||||||
stdout = svninfo("..") or gitinfo()
|
stdout = svninfo("..") or allgitinfo()
|
||||||
if stdout:
|
if stdout:
|
||||||
f = file("sccs-info","w")
|
f = file("sccs-info","w")
|
||||||
f.write(stdout)
|
f.write(stdout)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user