116 self.status = self.unzip(self.filename, self.levels, self.deletelevels) |
116 self.status = self.unzip(self.filename, self.levels, self.deletelevels) |
117 |
117 |
118 threadlist = [] |
118 threadlist = [] |
119 def schedule_unzip(filename, unziplevel, deletelevel): |
119 def schedule_unzip(filename, unziplevel, deletelevel): |
120 global options |
120 global options |
|
121 if options.nounzip : |
|
122 return |
121 if options.dryrun : |
123 if options.dryrun : |
122 global unzip_list |
124 global unzip_list |
123 if unziplevel > 0: |
125 if unziplevel > 0: |
124 unzip_list.append("7z x -y %s" % filename) |
126 unzip_list.append("7z x -y %s" % filename) |
125 if unziplevel > 1: |
127 if unziplevel > 1: |
259 # wait for the unzipping threads to complete |
261 # wait for the unzipping threads to complete |
260 complete_outstanding_unzips() |
262 complete_outstanding_unzips() |
261 |
263 |
262 return 1 |
264 return 1 |
263 |
265 |
264 parser = OptionParser(usage="Usage: %prog [options] version", version="%prog 0.3") |
266 parser = OptionParser(usage="Usage: %prog [options] version", version="%prog 0.4") |
265 parser.add_option("-n", "--dryrun", action="store_true", dest="dryrun", |
267 parser.add_option("-n", "--dryrun", action="store_true", dest="dryrun", |
266 help="print the files to be downloaded, the 7z commands, and the recommended deletions") |
268 help="print the files to be downloaded, the 7z commands, and the recommended deletions") |
267 parser.add_option("--nosrc", action="store_true", dest="nosrc", |
269 parser.add_option("--nosrc", action="store_true", dest="nosrc", |
268 help="Don't download any of the source code available directly from Mercurial") |
270 help="Don't download any of the source code available directly from Mercurial") |
269 parser.set_defaults(dryrun=False, nosrc=False) |
271 parser.add_option("--nounzip", action="store_true", dest="nounzip", |
|
272 help="Just download, don't unzip or delete any files") |
|
273 parser.set_defaults(dryrun=False, nosrc=False, nounzip=False) |
270 |
274 |
271 (options, args) = parser.parse_args() |
275 (options, args) = parser.parse_args() |
272 if len(args) != 1: |
276 if len(args) != 1: |
273 parser.error("Must supply a PDK version, e.g. 3.0.e") |
277 parser.error("Must supply a PDK version, e.g. 3.0.e") |
274 |
278 |