mirror of
https://github.com/Ylianst/MeshAgent
synced 2026-01-15 06:53:40 +00:00
GC reference update
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user