mirror of
https://github.com/UltraCoderRU/libwebrtc.git
synced 2026-01-28 03:15:11 +00:00
Jake: Remove checksum handling
This commit is contained in:
parent
559fb5e0f4
commit
452450fd20
2 changed files with 6 additions and 29 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var crypto = require('crypto');
|
|
||||||
var download = require('download');
|
var download = require('download');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var getPackageName = require('./common').getPackageName;
|
var getPackageName = require('./common').getPackageName;
|
||||||
|
|
@ -11,29 +10,8 @@ var WebRTCUrl = pkg.config.webrtc.url;
|
||||||
var WebRTCRev = pkg.config.webrtc.revision;
|
var WebRTCRev = pkg.config.webrtc.revision;
|
||||||
var ChromiumUrl = pkg.config.chromium.url;
|
var ChromiumUrl = pkg.config.chromium.url;
|
||||||
|
|
||||||
function checksum(bytes) {
|
|
||||||
return crypto
|
|
||||||
.createHash('md5')
|
|
||||||
.update(bytes, 'utf8')
|
|
||||||
.digest('hex')
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace('fetch', function () {
|
namespace('fetch', function () {
|
||||||
task('precompiled', ['check-file'], function () {
|
task('precompiled', ['download'], function () {
|
||||||
});
|
|
||||||
|
|
||||||
task('check-file', function () {
|
|
||||||
try {
|
|
||||||
var data = fs.readFileSync(getPackageName());
|
|
||||||
|
|
||||||
if (checksum(data) !== pkg.config.webrtc.checksum) {
|
|
||||||
throw new Error('Invalid checksum');
|
|
||||||
}
|
|
||||||
|
|
||||||
jake.Task['fetch:extract'].invoke();
|
|
||||||
} catch (e) {
|
|
||||||
jake.Task['fetch:download'].invoke();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
task('download', {async: true}, function () {
|
task('download', {async: true}, function () {
|
||||||
|
|
@ -45,6 +23,7 @@ namespace('fetch', function () {
|
||||||
var task = jake.Task['fetch:extract'];
|
var task = jake.Task['fetch:extract'];
|
||||||
|
|
||||||
task.addListener('complete', function () {
|
task.addListener('complete', function () {
|
||||||
|
console.log('Done');
|
||||||
complete();
|
complete();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -67,20 +46,19 @@ namespace('fetch', function () {
|
||||||
|
|
||||||
console.log('Extracting', packageName);
|
console.log('Extracting', packageName);
|
||||||
jake.exec('tar xf ' + packageName, function () {
|
jake.exec('tar xf ' + packageName, function () {
|
||||||
console.log('Deleting', packageName);
|
|
||||||
fs.unlinkSync(packageName);
|
fs.unlinkSync(packageName);
|
||||||
complete();
|
complete();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
task('gclient', {async: true}, function () {
|
task('submodules', {async: true}, function () {
|
||||||
console.log('Updating submodules...');
|
console.log('Updating submodules...');
|
||||||
jake.exec(['git submodule init', 'git submodule update'], {printStdout: true}, function () {
|
jake.exec(['git submodule init', 'git submodule update'], {printStdout: true}, function () {
|
||||||
complete();
|
complete();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
task('configure', ['fetch:gclient'], {async: true}, function () {
|
task('configure', ['fetch:submodules'], {async: true}, function () {
|
||||||
console.log('Configuring gclient to fetch WebRTC code');
|
console.log('Configuring gclient to fetch WebRTC code');
|
||||||
process.env.PATH = process.cwd() + '/Dependencies/depot_tools:' + process.env.PATH;
|
process.env.PATH = process.cwd() + '/Dependencies/depot_tools:' + process.env.PATH;
|
||||||
jake.exec('gclient config --name src ' + WebRTCUrl, {printStdout: true}, function () {
|
jake.exec('gclient config --name src ' + WebRTCUrl, {printStdout: true}, function () {
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,7 @@
|
||||||
"url": "https://github.com/aisouard/libwebrtc/releases/download",
|
"url": "https://github.com/aisouard/libwebrtc/releases/download",
|
||||||
"webrtc": {
|
"webrtc": {
|
||||||
"url": "https://chromium.googlesource.com/external/webrtc.git",
|
"url": "https://chromium.googlesource.com/external/webrtc.git",
|
||||||
"revision": "7502401788fcba5c9f81a9e4701e2f0831e78698",
|
"revision": "7502401788fcba5c9f81a9e4701e2f0831e78698"
|
||||||
"checksum": "298b2c8d977478252cdf4f44d24a53e8"
|
|
||||||
},
|
},
|
||||||
"chromium": {
|
"chromium": {
|
||||||
"url": "https://github.com/aisouard/libwebrtc-chromium-deps.git"
|
"url": "https://github.com/aisouard/libwebrtc-chromium-deps.git"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue