summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2009-10-03 20:42:02 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2009-10-03 20:42:02 +0000
commit2b05ef77d7586e56c25acb41c42d624680685c55 (patch)
tree67fdbba1f838bdec3c0ae222da6a9ff9a36186fa
parent21e349666d418c2f3cf41bedb592b8a60cec3aa2 (diff)
downloadrockbox-2b05ef77d7586e56c25acb41c42d624680685c55.zip
rockbox-2b05ef77d7586e56c25acb41c42d624680685c55.tar.gz
rockbox-2b05ef77d7586e56c25acb41c42d624680685c55.tar.bz2
rockbox-2b05ef77d7586e56c25acb41c42d624680685c55.tar.xz
Add command line option to specify project file for deploying out-of-tree.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22898 a1c6a512-1295-4272-9138-f99709370657
-rwxr-xr-xrbutil/rbutilqt/deploy-release.py23
1 files changed, 17 insertions, 6 deletions
diff --git a/rbutil/rbutilqt/deploy-release.py b/rbutil/rbutilqt/deploy-release.py
index aa1c574..a76ce8f 100755
--- a/rbutil/rbutilqt/deploy-release.py
+++ b/rbutil/rbutilqt/deploy-release.py
@@ -40,6 +40,7 @@ import time
# Windows nees some special treatment. Differentiate between program name
# and executable filename.
program = "rbutilqt"
+project = "rbutilqt.pro"
if sys.platform == "win32":
progexe = "Release/rbutilqt.exe"
else:
@@ -52,6 +53,7 @@ programfiles = [ progexe ]
def usage(myself):
print "Usage: %s [options]" % myself
print " -q, --qmake=<qmake> path to qmake"
+ print " -p, --project=<pro> path to .pro file for building out-of-tree"
print " -h, --help this help"
@@ -121,9 +123,9 @@ def removedir(folder):
os.rmdir(folder)
-def qmake(qmake="qmake"):
+def qmake(qmake="qmake", projfile=project):
print "Running qmake ..."
- output = subprocess.Popen([qmake, "-config", "static", "-config", "release"],
+ output = subprocess.Popen([qmake, "-config", "static", "-config", "release", projfile],
stdout=subprocess.PIPE)
output.communicate()
if not output.returncode == 0:
@@ -210,15 +212,18 @@ def tarball(versionstring):
def main():
startup = time.time()
try:
- opts, args = getopt.getopt(sys.argv[1:], "q:h", ["qmake=", "help"])
+ opts, args = getopt.getopt(sys.argv[1:], "q:p:h", ["qmake=", "project=", "help"])
except getopt.GetoptError, err:
print str(err)
usage(sys.argv[0])
sys.exit(1)
qt = ""
+ proj = project
for o, a in opts:
if o in ("-q", "--qmake"):
qt = a
+ if o in ("-p", "--project"):
+ proj = a
if o in ("-h", "--help"):
usage(sys.argv[0])
sys.exit(0)
@@ -231,15 +236,21 @@ def main():
if qm == "":
print "ERROR: No suitable Qt installation found."
sys.exit(1)
+ # check project file
+ if not os.path.exists(proj):
+ print "ERROR: path to project file wrong. You need to specify the path " \
+ "when building out-of-tree."
+ sys.exit(1)
- # figure version from sources
- ver = findversion("version.h")
+ # figure version from sources. Need to take path to project file into account.
+ versionfile = re.subn('[\w\.]+$', "version.h", proj)[0]
+ ver = findversion(versionfile)
header = "Building %s %s" % (program, ver)
print header
print len(header) * "="
# build it.
- if not qmake(qm) == 0:
+ if not qmake(qm, proj) == 0:
os.exit(1)
if not build() == 0:
sys.exit(1)