diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2009-10-05 18:35:28 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2009-10-05 18:35:28 +0000 |
commit | 6b51e5b089e6ced46ab57292449356d02284ac84 (patch) | |
tree | d3eb822b3afb1e5f1e85ac2de5650e6c8bb47ee3 | |
parent | 1acacc2dcbb10e7cfc90eef7a4a1c4189268d92d (diff) | |
download | rockbox-6b51e5b089e6ced46ab57292449356d02284ac84.tar.gz rockbox-6b51e5b089e6ced46ab57292449356d02284ac84.zip |
Add some more options to rbutil deploy script.
- Allow building the source tarball only
- Allow building the binary only
- Allow building the binary dynamically linked.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22964 a1c6a512-1295-4272-9138-f99709370657
-rwxr-xr-x | rbutil/rbutilqt/deploy-release.py | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/rbutil/rbutilqt/deploy-release.py b/rbutil/rbutilqt/deploy-release.py index f8aaf0dc45..48cd41467e 100755 --- a/rbutil/rbutilqt/deploy-release.py +++ b/rbutil/rbutilqt/deploy-release.py | |||
@@ -86,6 +86,9 @@ def usage(myself): | |||
86 | print " -p, --project=<pro> path to .pro file for building with local tree" | 86 | print " -p, --project=<pro> path to .pro file for building with local tree" |
87 | print " -t, --tag=<tag> use specified tag from svn" | 87 | print " -t, --tag=<tag> use specified tag from svn" |
88 | print " -a, --add=<file> add file to build folder before building" | 88 | print " -a, --add=<file> add file to build folder before building" |
89 | print " -s, --source-only only create source archive" | ||
90 | print " -b, --binary-only only create binary archive" | ||
91 | print " -d, --dynamic link dynamically instead of static" | ||
89 | print " -h, --help this help" | 92 | print " -h, --help this help" |
90 | print " If neither a project file nor tag is specified trunk will get downloaded" | 93 | print " If neither a project file nor tag is specified trunk will get downloaded" |
91 | print " from svn." | 94 | print " from svn." |
@@ -170,11 +173,14 @@ def checkqt(qmakebin): | |||
170 | return result | 173 | return result |
171 | 174 | ||
172 | 175 | ||
173 | def qmake(qmake="qmake", projfile=project, wd="."): | 176 | def qmake(qmake="qmake", projfile=project, wd=".", static=True): |
174 | print "Running qmake in %s..." % wd | 177 | print "Running qmake in %s..." % wd |
175 | output = subprocess.Popen([qmake, "-config", "static", | 178 | command = [qmake, "-config", "release", "-config", "noccache"] |
176 | "-config", "release", "-config", "noccache", projfile], | 179 | if static == True: |
177 | stdout=subprocess.PIPE, cwd=wd) | 180 | command.append("-config") |
181 | command.append("static") | ||
182 | command.append(projfile) | ||
183 | output = subprocess.Popen(command, stdout=subprocess.PIPE, cwd=wd) | ||
178 | output.communicate() | 184 | output.communicate() |
179 | if not output.returncode == 0: | 185 | if not output.returncode == 0: |
180 | print "qmake returned an error!" | 186 | print "qmake returned an error!" |
@@ -290,8 +296,8 @@ def filestats(filename): | |||
290 | def main(): | 296 | def main(): |
291 | startup = time.time() | 297 | startup = time.time() |
292 | try: | 298 | try: |
293 | opts, args = getopt.getopt(sys.argv[1:], "q:p:t:a:h", | 299 | opts, args = getopt.getopt(sys.argv[1:], "q:p:t:a:sbdh", |
294 | ["qmake=", "project=", "tag=", "add=", "help"]) | 300 | ["qmake=", "project=", "tag=", "add=", "source-only", "binary-only", "dynamic", "help"]) |
295 | except getopt.GetoptError, err: | 301 | except getopt.GetoptError, err: |
296 | print str(err) | 302 | print str(err) |
297 | usage(sys.argv[0]) | 303 | usage(sys.argv[0]) |
@@ -302,6 +308,9 @@ def main(): | |||
302 | tag = "" | 308 | tag = "" |
303 | addfiles = [] | 309 | addfiles = [] |
304 | cleanup = True | 310 | cleanup = True |
311 | binary = True | ||
312 | source = True | ||
313 | static = True | ||
305 | for o, a in opts: | 314 | for o, a in opts: |
306 | if o in ("-q", "--qmake"): | 315 | if o in ("-q", "--qmake"): |
307 | qt = a | 316 | qt = a |
@@ -313,10 +322,20 @@ def main(): | |||
313 | svnbase = svnserver + "tags/" + tag + "/" | 322 | svnbase = svnserver + "tags/" + tag + "/" |
314 | if o in ("-a", "--add"): | 323 | if o in ("-a", "--add"): |
315 | addfiles.append(a) | 324 | addfiles.append(a) |
325 | if o in ("-s", "--source-only"): | ||
326 | binary = False | ||
327 | if o in ("-b", "--binary-only"): | ||
328 | source = False | ||
329 | if o in ("-d", "--dynamic"): | ||
330 | static = False | ||
316 | if o in ("-h", "--help"): | 331 | if o in ("-h", "--help"): |
317 | usage(sys.argv[0]) | 332 | usage(sys.argv[0]) |
318 | sys.exit(0) | 333 | sys.exit(0) |
319 | 334 | ||
335 | if source == False and binary == False: | ||
336 | print "Building build neither source nor binary means nothing to do. Exiting." | ||
337 | sys.exit(1) | ||
338 | |||
320 | # search for qmake | 339 | # search for qmake |
321 | if qt == "": | 340 | if qt == "": |
322 | qm = findqt() | 341 | qm = findqt() |
@@ -354,9 +373,13 @@ def main(): | |||
354 | if not getsources(svnbase, svnpaths, sourcefolder) == 0: | 373 | if not getsources(svnbase, svnpaths, sourcefolder) == 0: |
355 | sys.exit(1) | 374 | sys.exit(1) |
356 | 375 | ||
357 | tf = tarfile.open(archivename, mode='w:bz2') | 376 | if source == True: |
358 | tf.add(sourcefolder, os.path.basename(re.subn('/$', '', sourcefolder)[0])) | 377 | tf = tarfile.open(archivename, mode='w:bz2') |
359 | tf.close() | 378 | tf.add(sourcefolder, os.path.basename(re.subn('/$', '', sourcefolder)[0])) |
379 | tf.close() | ||
380 | if binary == False: | ||
381 | shutil.rmtree(workfolder) | ||
382 | sys.exit(0) | ||
360 | else: | 383 | else: |
361 | # figure version from sources. Need to take path to project file into account. | 384 | # figure version from sources. Need to take path to project file into account. |
362 | versionfile = re.subn('[\w\.]+$', "version.h", proj)[0] | 385 | versionfile = re.subn('[\w\.]+$', "version.h", proj)[0] |
@@ -376,7 +399,7 @@ def main(): | |||
376 | print len(header) * "=" | 399 | print len(header) * "=" |
377 | 400 | ||
378 | # build it. | 401 | # build it. |
379 | if not qmake(qm, proj, sourcefolder) == 0: | 402 | if not qmake(qm, proj, sourcefolder, static) == 0: |
380 | sys.exit(1) | 403 | sys.exit(1) |
381 | if not build(sourcefolder) == 0: | 404 | if not build(sourcefolder) == 0: |
382 | sys.exit(1) | 405 | sys.exit(1) |