32 def validate(grace, service, product, release): |
32 def validate(grace, service, product, release): |
33 """ Validate s60 grace server, s60 grace service, s60 grace product and |
33 """ Validate s60 grace server, s60 grace service, s60 grace product and |
34 s60 grace release are set. |
34 s60 grace release are set. |
35 """ |
35 """ |
36 if not grace: |
36 if not grace: |
37 raise Exception("Property 's60.grace.server' is not defined.") |
37 raise EnvironmentError("Property 's60.grace.server' is not defined.") |
38 if not service: |
38 if not service: |
39 raise Exception("Property 's60.grace.service' is not defined.") |
39 raise EnvironmentError("Property 's60.grace.service' is not defined.") |
40 if not product: |
40 if not product: |
41 raise Exception("Property 's60.grace.product' is not defined.") |
41 raise EnvironmentError("Property 's60.grace.product' is not defined.") |
42 if not release: |
42 if not release: |
43 raise Exception("Property 's60.grace.release' is not defined.") |
43 raise EnvironmentError("Property 's60.grace.release' is not defined.") |
44 |
44 |
45 def get_s60_env_details(grace, service, product, release, rev, cachefilename, s60gracecheckmd5, s60graceusetickler): |
45 def get_s60_env_details(grace, service, product, release, rev, cachefilename, s60gracecheckmd5, s60graceusetickler): |
46 """ Return s60 environ details """ |
46 """ Return s60 environ details """ |
47 validate(grace, service, product, release) |
47 validate(grace, service, product, release) |
48 revision = r'(_\d{3})?' |
48 revision = r'(_\d{3})?' |
57 checkmd5 = str(s60gracecheckmd5).lower() |
57 checkmd5 = str(s60gracecheckmd5).lower() |
58 checkmd5 = ((checkmd5 == "true") or (checkmd5 == "1") or (checkmd5 == "on")) |
58 checkmd5 = ((checkmd5 == "true") or (checkmd5 == "1") or (checkmd5 == "on")) |
59 |
59 |
60 branch = os.path.join(grace, service, product) |
60 branch = os.path.join(grace, service, product) |
61 if not os.path.exists(branch): |
61 if not os.path.exists(branch): |
62 raise Exception("Error occurred: Could not find directory %s" % branch) |
62 raise IOError("Error occurred: Could not find directory %s" % branch) |
63 |
63 |
64 result = [] |
64 result = [] |
65 for rel in os.listdir(branch): |
65 for rel in os.listdir(branch): |
66 relpath = os.path.join(branch, rel) |
66 relpath = os.path.join(branch, rel) |
67 _logger.info("Checking: %s" % str(relpath)) |
67 _logger.info("Checking: %s" % str(relpath)) |
90 break |
90 break |
91 else: |
91 else: |
92 _logger.info(str("%s is not a valid release." % rel)) |
92 _logger.info(str("%s is not a valid release." % rel)) |
93 elif metadata_filename is None: |
93 elif metadata_filename is None: |
94 _logger.info(str("Could not find the release metadata file under %s" % rel)) |
94 _logger.info(str("Could not find the release metadata file under %s" % rel)) |
95 except Exception, exc: |
95 except IOError, exc: |
96 _logger.warning(str("WARNING: %s: %s" % (rel , exc))) |
96 _logger.warning(str("WARNING: %s: %s" % (rel , exc))) |
97 _logger.warning(("%s is not a valid release." % rel)) |
97 _logger.warning(("%s is not a valid release." % rel)) |
98 traceback.print_exc() |
98 traceback.print_exc() |
99 |
99 |
100 result = validresults |
100 result = validresults |
101 if len(result) == 0: |
101 if len(result) == 0: |
102 raise Exception("Error finding GRACE release.") |
102 raise EnvironmentError("Error finding GRACE release.") |
103 print result[0] |
103 print result[0] |
104 return result |
104 return result |
105 |
105 |
106 def get_version(buiddrive, resultname): |
106 def get_version(buiddrive, resultname): |
107 """ Return s60 version """ |
107 """ Return s60 version """ |
117 _logger.info("Version file not found getting new environment...") |
117 _logger.info("Version file not found getting new environment...") |
118 return version |
118 return version |
119 |
119 |
120 def create_ado_mapping(sysdefconfig, adomappingfile, adoqualitymappingfile, builddrive, adoqualitydirs): |
120 def create_ado_mapping(sysdefconfig, adomappingfile, adoqualitymappingfile, builddrive, adoqualitydirs): |
121 """ Creates ado mapping and ado quality mapping files """ |
121 """ Creates ado mapping and ado quality mapping files """ |
122 input = open(sysdefconfig, 'r') |
122 input_ = open(sysdefconfig, 'r') |
123 output = open(adomappingfile, 'w') |
123 output = open(adomappingfile, 'w') |
124 outputquality = open(adoqualitymappingfile, 'w') |
124 outputquality = open(adoqualitymappingfile, 'w') |
125 for sysdef in input.readlines(): |
125 for sysdef in input_.readlines(): |
126 sysdef = sysdef.strip() |
126 sysdef = sysdef.strip() |
127 if len(sysdef) > 0: |
127 if len(sysdef) > 0: |
128 print "Checking %s" % sysdef |
128 print "Checking %s" % sysdef |
129 os.path.dirname(sysdef) |
129 os.path.dirname(sysdef) |
130 location = ido.get_sysdef_location(sysdef) |
130 location = ido.get_sysdef_location(sysdef) |
141 print "%s=%s\n" % (sysdef, component) |
141 print "%s=%s\n" % (sysdef, component) |
142 output.write("%s=%s\n" % (sysdef, component)) |
142 output.write("%s=%s\n" % (sysdef, component)) |
143 if adoqualitydirs == None: |
143 if adoqualitydirs == None: |
144 outputquality.write("%s=%s\n" % (sysdef, component)) |
144 outputquality.write("%s=%s\n" % (sysdef, component)) |
145 else: |
145 else: |
146 for dir in adoqualitydirs.split(','): |
146 for dir_ in adoqualitydirs.split(','): |
147 if os.path.normpath(dir) == os.path.normpath(os.path.join(builddrive, os.environ['EPOCROOT'], location)): |
147 if os.path.normpath(dir_) == os.path.normpath(os.path.join(builddrive, os.environ['EPOCROOT'], location)): |
148 outputquality.write("%s=%s\n" % (sysdef, component)) |
148 outputquality.write("%s=%s\n" % (sysdef, component)) |
149 |
149 |
150 |
150 |
151 outputquality.close() |
151 outputquality.close() |
152 output.close() |
152 output.close() |
153 input.close() |
153 input_.close() |
154 |
154 |
155 |
155 |
156 |
156 |