[openrtm-commit:00367] r2218 - branches/RELENG_1_1/OpenRTM-aist/build
openrtm @ openrtm.org
openrtm @ openrtm.org
2011年 8月 22日 (月) 17:05:53 JST
Author: fsi-katami
Date: 2011-08-22 17:05:53 +0900 (Mon, 22 Aug 2011)
New Revision: 2218
Modified:
branches/RELENG_1_1/OpenRTM-aist/build/slntool.py
Log:
Fixed the bug that the error occurs by rtc-template. refs #2209
Modified: branches/RELENG_1_1/OpenRTM-aist/build/slntool.py
===================================================================
--- branches/RELENG_1_1/OpenRTM-aist/build/slntool.py 2011-08-22 07:58:52 UTC (rev 2217)
+++ branches/RELENG_1_1/OpenRTM-aist/build/slntool.py 2011-08-22 08:05:53 UTC (rev 2218)
@@ -104,30 +104,9 @@
"""
-def get_projinfo(fname):
+def get_projinfo(fname,vcversion="VC8"):
name = None
guid = None
- re_guid = re.compile('^.*?ProjectGUID=\"{(.*)}\"')
- re_name = re.compile('^.*?Name=\"(.*)\"')
- fd = open(fname, "r")
- pj = fd.readlines()
- for t in pj:
- n = re_name.match(t)
- g = re_guid.match(t)
-
- if name == None and n:
- name = n.group(1)
- if guid == None and g:
- guid = g.group(1)
-
- if name and guid:
- break
- fd.close()
- return {"Name": name, "GUID": guid, "FileName": fname}
-
-def get_projinfo(fname,vcversion):
- name = None
- guid = None
regexs = {"VC8": {"guid":'^.*?ProjectGUID=\"{(.*)}\"',"name":'^.*?Name=\"(.*)\"'},
"VC9": {"guid":'^.*?ProjectGUID=\"{(.*)}\"',"name":'^.*?Name=\"(.*)\"'},
"VC10": {"guid":'^.*?<ProjectGuid>{(.*)}</ProjectGuid>',"name":'^.*<ProjectName>(.*)</ProjectName>'}
@@ -191,75 +170,12 @@
i += 1
return (vcversion, depfile, outfile, flist)
-def get_slnyaml(depfile, projfiles):
+def get_slnyaml(depfile, projfiles, vcversion="VC8"):
depdict = get_dependencies(depfile)
projs = []
projlist = """Projects:
"""
for f in projfiles:
- pj = get_projinfo(f)
- if depdict.has_key(pj["Name"]):
- pj["Depend"] = depdict[pj["Name"]]
- projs.append(pj)
- def depsort(d0, d1):
- """
- d0 < d1: return -1
- d0 == d1: return 0
- d0 > d1: return 1
- """
- d0_depends = d0.has_key("Depend")
- d1_depends = d1.has_key("Depend")
- if not d0_depends and not d1_depends:
- # both d0, d1 has no dependency
- return 0
-
- if not d0_depends and d1_depends:
- # only "d1" has dependency: d0 < d1
- return -1
-
- if d0_depends and not d1_depends:
- # only "d0" has dependency: d1 < d0
- return 1
-
- # d0 and d1 has dependency
- d0_in_dep = depdict.has_key(d0["Name"])
- d1_in_dep = depdict.has_key(d1["Name"])
- if not d0_in_dep and not d1_in_dep:
- return 0
- if not d0_in_dep and d1_in_dep:
- return -1
- if d0_in_dep and not d1_in_dep:
- return 1
-
- # both d0 and d1 have several dependency
- if depdict[d0["Name"]].count(d1["Name"]) > 0:
- return 1
- if depdict[d1["Name"]].count(d0["Name"]) > 0:
- return -1
- return 0
-
- projs.sort(depsort)
- for pj in projs:
- list = """ - Name: %s
- FileName: %s
- GUID: &%s %s
- Depend:
-""" % (pj["Name"], pj["FileName"], pj["Name"], pj["GUID"])
- if pj.has_key("Depend"):
- for dep in pj["Depend"]:
- dep = """ - *%s
-""" % (dep)
- list += dep
- projlist += list
- yaml_text = sln_yaml + projlist
- return yaml_text
-
-def get_slnyaml(depfile, projfiles, vcversion):
- depdict = get_dependencies(depfile)
- projs = []
- projlist = """Projects:
-"""
- for f in projfiles:
pj = get_projinfo(f, vcversion)
if depdict.has_key(pj["Name"]):
pj["Depend"] = depdict[pj["Name"]]
Property changes on: branches/RELENG_1_1/OpenRTM-aist/build/slntool.py
___________________________________________________________________
Added: svn:mergeinfo
+ /tags/RELEASE_1_1_0_RC2/OpenRTM-aist/build/slntool.py:2173
/trunk/OpenRTM-aist/build/slntool.py:2126-2172,2174-2217
openrtm-commit メーリングリストの案内