@@ -144,8 +144,9 @@ def svninfo(*args):
144144 else : url = "SVN " + url [0 ].strip ()
145145 return rev + "\n " + url
146146
147- def gitinfo (* args ):
148- try : p = _Popen (['git' ,'remote' ,'show' ,'-n' ,'origin' ]+ list (args ),stdin = PIPE ,stdout = PIPE ,stderr = PIPE )
147+ def gitinfo (dir = None ):
148+ if dir and not _isdir (dir ): return ''
149+ try : p = _Popen (['git' ,'remote' ,'show' ,'-n' ,'origin' ],stdin = PIPE ,stdout = PIPE ,stderr = PIPE ,cwd = dir )
149150 except OSError ,e :
150151 if e .errno == 2 : return '' # svn command is not installed
151152 raise
@@ -158,7 +159,7 @@ def gitinfo(*args):
158159 except IndexError : url = [ s [5 :] for s in stdout if s .startswith ("URL" ) ][0 ]
159160 assert url
160161
161- p = _Popen (['git' ,'log' ,'-1' ]+ list ( args ) ,stdin = PIPE ,stdout = PIPE ,stderr = PIPE )
162+ p = _Popen (['git' ,'log' ,'-1' ],stdin = PIPE ,stdout = PIPE ,stderr = PIPE , cwd = dir )
162163 stdout ,stderr = p .communicate ('' )
163164 retcode = p .wait ()
164165 if retcode : return
@@ -169,6 +170,15 @@ def gitinfo(*args):
169170
170171 return "Git Revision: %s" % commitid + "\n " + "Git URL: %s" % url
171172
173+ def allgitinfo ():
174+ t = gitinfo ()
175+ if not t : return t
176+
177+ u = gitinfo (_join (pardir ,"cloudstack-proprietary" ))
178+ if not u : return t
179+
180+ return t + "\n \n cloustack-proprietary:\n " + u
181+
172182def _getbuildnumber (): # FIXME implement for git
173183 n = Options .options .BUILDNUMBER
174184 if n :
@@ -230,6 +240,7 @@ def discover_ant_targets_and_properties(files):
230240 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 ("#" ) ]
231241 props = dict ( propsinxml + propsinpropfiles )
232242 props ["base.dir" ] = '.'
243+ props ["p.base.dir" ] = '.'
233244
234245 result = []
235246 for name ,target in targets .items ():
@@ -528,7 +539,7 @@ def dist_hook():
528539 if Options .options .OSS :
529540 [ shutil .rmtree (f ) for f in "cloudstack-proprietary" .split () if _exists (f ) ]
530541
531- stdout = svninfo (".." ) or gitinfo ()
542+ stdout = svninfo (".." ) or allgitinfo ()
532543 if stdout :
533544 f = file ("sccs-info" ,"w" )
534545 f .write (stdout )
0 commit comments