1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-14 22:43:27 +00:00

GC reference update

This commit is contained in:
Bryan Roe
2021-03-17 16:56:44 -07:00
parent f64640f4ea
commit 4f4085d542
2 changed files with 9 additions and 3 deletions

View File

@@ -14,6 +14,12 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
function stdparser(c)
{
if (this.str == null) { this.str = ''; }
this.str += c.toString();
}
function find(name)
{
switch(process.platform)
@@ -22,7 +28,7 @@ function find(name)
var ret = [];
var child = require('child_process').execFile('/bin/sh', ['sh']);
child.stdout.str = '';
child.stdout.on('data', function (c) { this.str += c.toString(); });
child.stdout.on('data', stdparser);
child.stdin.write("pkg info " + name + " | tr '\\n' '\\|' | awk ' { a=split($0, t, \"Shared Libs provided:\"); if(a==2) { split(t[2], lib, \":\"); print lib[1]; } }' | tr '\\|' '\\n' | awk '{ if(split($1, res, \".so\")>1) { print $1; } }'\nexit\n");
child.waitExit();
var res = child.stdout.str.trim().split('\n');
@@ -32,7 +38,7 @@ function find(name)
var v = {name: res[i]};
child = require('child_process').execFile('/bin/sh', ['sh']);
child.stdout.str = '';
child.stdout.on('data', function (c) { this.str += c.toString(); });
child.stdout.on('data', stdparser);
child.stdin.write('pkg info -l ' + name + ' | grep ' + v.name + ' | awk \'{ a=split($1, tok, "/"); if(tok[a]=="' + v.name + '") { print $1; } }\'\nexit\n');
child.waitExit();
v.location = child.stdout.str.trim();