Changeset 661
- Timestamp:
- 2007-12-04 16:02:37 (1 year ago)
- Files:
-
- tools/make.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tools/make.py
r506 r661 32 32 locales_file = 'locales.tar.gz' 33 33 update_url = 'http://code.downthemall.net/nightly/update.rdf' 34 35 release_id = '{DDC359D1-844A-42a7-9AA1-88A850A938A8}'36 34 37 35 xpi_file = 'downthemall.xpi' … … 61 59 yield "nightlifying" 62 60 self.nightlify(update_url) 63 if self.opts. release:64 yield " releasifying"65 self. releasify()61 if self.opts.extid: 62 yield "setting the extension id" 63 self.setId() 66 64 if self.opts.nocomments: 67 65 yield "stripping comments" … … 149 147 f.close() 150 148 151 def releasify(self): 152 global release_id 149 def setId(self): 153 150 rdf = xml_open('%s/install.rdf' % self.opts.exportTo) 154 151 155 'update the version'152 'update the id' 156 153 node = rdf.getElementsByTagName('id')[0].childNodes[0] 157 node.data = release_id154 node.data = self.opts.extid 158 155 159 156 'save' … … 165 162 f.close() 166 163 167 f = open('%s/chrome/content/common/verinfo.js' % self.opts.exportTo) 168 lines = f.readlines() 169 f.close() 170 f = open('%s/chrome/content/common/verinfo.js' % self.opts.exportTo, 'wb') 171 for l in lines: 172 if re.search('const DTA_ID', l): 173 l = "const DTA_ID = '%s';\n" % release_id 174 f.write(l) 175 f.close() 164 vi = '%s/chrome/content/common/verinfo.js' % self.opts.exportTo; 165 166 if os.path.exists(vi): 167 f = open(vi) 168 lines = f.readlines() 169 f.close() 170 f = open(vi, 'wb') 171 for l in lines: 172 if re.search('const DTA_ID', l): 173 l = "const DTA_ID = '%s';\n" % self.opts.extid 174 f.write(l) 175 f.close() 176 176 177 def jar(self): 177 178 f = open('%s/chrome.manifest' % self.opts.exportTo) … … 180 181 f = open('%s/chrome.manifest' % self.opts.exportTo, 'wb') 181 182 for l in lines: 182 l = re.sub(r'(\s)chrome/', r'\1jar:chrome/ dta.jar!/', l);183 l = re.sub(r'(\s)chrome/', r'\1jar:chrome/chrome.jar!/', l); 183 184 f.write(l) 184 185 f.close() … … 193 194 if path.isdir(f): 194 195 dirs += f, 195 jar_file = ZipFile(p + "/ dta.jar", 'w', ZIP_STORED)196 jar_file = ZipFile(p + "/chrome.jar", 'w', ZIP_STORED) 196 197 for d in dirs: 197 198 for x in self.getfilelist(d): … … 290 291 '--release', 291 292 dest='release', 292 help='is a release', 293 action='store_true', 294 default=False 295 ) 293 help='Is a release', 294 action='store_true', 295 default=False 296 ) 297 parser.add_option( 298 '--extid', 299 dest='extid', 300 help='Set the extension id', 301 type='string' 302 ) 296 303 parser.add_option( 297 304 '--nocomment',
