You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2014/08/26 22:46:39 UTC
[06/15] git commit: bin/build/build: check chroot env before build
bin/build/build: check chroot env before build
Project: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/commit/a815d583
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/tree/a815d583
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/diff/a815d583
Branch: refs/heads/master
Commit: a815d5834d4699bed76002b6b7eb83f741de2bc9
Parents: bb6b1b4
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Tue Jun 3 02:21:32 2014 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Tue Aug 19 14:19:31 2014 +0400
----------------------------------------------------------------------
bin/build/lib/ubuntu.js | 18 ++++++++++++++++++
bin/check_reqs | 16 +---------------
2 files changed, 19 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/a815d583/bin/build/lib/ubuntu.js
----------------------------------------------------------------------
diff --git a/bin/build/lib/ubuntu.js b/bin/build/lib/ubuntu.js
index 7ef54ba..a096c83 100644
--- a/bin/build/lib/ubuntu.js
+++ b/bin/build/lib/ubuntu.js
@@ -81,6 +81,22 @@ function cpuCount() {
return os.cpus().length;
}
+function checkChrootEnv(architecture, framework) {
+ var deps = "cmake libicu-dev:ARCH pkg-config qtbase5-dev:ARCH qtchooser qtdeclarative5-dev:ARCH qtfeedback5-dev:ARCH qtlocation5-dev:ARCH qtmultimedia5-dev:ARCH qtpim5-dev:ARCH qtsensors5-dev:ARCH qtsystems5-dev:ARCH";
+ deps = deps.replace(/ARCH/g, architecture);
+
+ var cmd = "click chroot -a" + architecture + " -f " + framework + " run dpkg-query -Wf'${db:Status-abbrev}' " + deps;
+ console.log(cmd.green);
+ res = shell.exec(cmd);
+
+ if (res.code !== 0 || res.output.indexOf('un') !== -1) {
+ console.error(("Error: missing " + architecture + " chroot").red);
+ console.error(("run:\nsudo click chroot -a" + architecture + " -f " + framework + " create").red);
+ console.error(("sudo click chroot -a" + architecture + " -f " + framework + " install " + deps).red);
+ process.exit(2);
+ }
+}
+
function buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework) {
assert.ok(architecture && architecture.match(/^[a-z0-9_]+$/));
@@ -94,6 +110,8 @@ function buildClickPackage(campoDir, ubuntuDir, nobuild, architecture, framework
return Q();
}
+ checkChrootEnv(architecture, framework);
+
shell.rm('-rf', path.join(archDir, 'build'));
shell.rm('-rf', prefixDir);
http://git-wip-us.apache.org/repos/asf/cordova-ubuntu/blob/a815d583/bin/check_reqs
----------------------------------------------------------------------
diff --git a/bin/check_reqs b/bin/check_reqs
index 08166fb..3b84541 100755
--- a/bin/check_reqs
+++ b/bin/check_reqs
@@ -21,26 +21,12 @@
var exec = require('child_process').exec;
-// FIXME: check for armhf
var deps = "cmake libicu-dev pkg-config qtbase5-dev qtchooser qtdeclarative5-dev qtfeedback5-dev qtlocation5-dev qtmultimedia5-dev qtpim5-dev qtsensors5-dev qtsystems5-dev";
-var depsArm = "cmake libicu-dev:armhf pkg-config qtbase5-dev:armhf qtchooser qtdeclarative5-dev:armhf qtfeedback5-dev:armhf qtlocation5-dev:armhf qtmultimedia5-dev:armhf qtpim5-dev:armhf qtsensors5-dev:armhf qtsystems5-dev:armhf";
-var framework = "ubuntu-sdk-13.10";
-exec("dpkg-query -Wf'${db:Status-abbrev}\n' click " + deps, function(error, stdout, stderr) {
+exec("dpkg-query -Wf'${db:Status-abbrev}\\n' click " + deps, function(error, stdout, stderr) {
if (error || stdout.indexOf('un') !== -1) {
console.error("Error: missing dependency " + deps);
process.exit(2);
}
-
- exec("click chroot -aarmhf -f " + framework + " run dpkg-query -Wf'${db:Status-abbrev}\n' " + deps, function(error, stdout, stderr) {
- if (error || stdout.indexOf('un') !== -1) {
- console.error("Error: missing armhf chroot");
-// to fix problem click chroot -aarmhf -f ubuntu-sdk-13.10 maint
-// dpkg --force-overwrite --force-conflicts -i /var/cache/apt/archives/qtbase5-dev_5.0.2+dfsg1-7ubuntu13_amd64.deb
-// apt-get install -f
- console.error("run:\nsudo click chroot -aarmhf -f " + framework + " create\nsudo click chroot -aarmhf -f " + framework + " install " + depsArm);
- process.exit(2);
- }
- })
});