Changeset 506

Show
Ignore:
Timestamp:
2007-07-09 16:56:36 (2 years ago)
Author:
MaierMan
Message:

add --output

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tools/make.py

    r504 r506  
    3535release_id = '{DDC359D1-844A-42a7-9AA1-88A850A938A8}' 
    3636 
    37 xpi_file = 'downthemall%s.xpi' 
     37xpi_file = 'downthemall.xpi' 
    3838 
    3939class XPI: 
     
    7171            self.jar()                 
    7272        yield "creating the xpi" 
    73         self.createXPI(xpi_file) 
     73        for x in self.createXPI(xpi_file): 
     74            yield x 
    7475        yield "cleaning up" 
    7576        self.cleanup() 
     
    235236        if self.opts.revision: 
    236237            additional += '-r%d' % self.getrevision() 
    237         xpi_file = ZipFile(xpi_file % additional, 'w', ZIP_DEFLATED) 
     238        output = xpi_file % additional 
     239        xpi_file = ZipFile(output, 'w', ZIP_DEFLATED) 
    238240        for x in self.getfilelist(self.opts.exportTo): 
    239241            xpi_file.write(x, x[len(self.opts.exportTo) + 1:].encode('cp437')) 
    240242        xpi_file.close() 
     243        yield "written to: " + output 
    241244 
    242245    def cleanup(self): 
     
    245248 
    246249def main(): 
     250    global xpi_file, svn_path 
     251     
    247252    parser = OptionParser(usage="%prog [options] [branch]", version="$Id$") 
    248253    parser.add_option( 
     
    303308        default=False 
    304309        ) 
     310    parser.add_option( 
     311        '--output', 
     312        dest='xpifile', 
     313        help='the resulting xpi file (might be changed by the modificators)', 
     314        type='string', 
     315        default=xpi_file 
     316        ) 
    305317    opts, args = parser.parse_args() 
    306318    if len(args) > 1: 
     
    311323    opts.branch, = args 
    312324 
    313     global xpi_file, svn_path 
     325    xpi_file = "%s%%s%s" % path.splitext(opts.xpifile) 
    314326 
    315327    xpi = XPI(opts, svn_path)