From ee630e34b826add34b3df4833799079958662c16 Mon Sep 17 00:00:00 2001 From: Markus Stefanko Date: Fri, 9 Feb 2018 09:21:05 +0700 Subject: [PATCH] conditional for checkRec to not return dependencies --- src/haxelib/client/Main.hx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/haxelib/client/Main.hx b/src/haxelib/client/Main.hx index 02bf118c0..2dda2abd4 100644 --- a/src/haxelib/client/Main.hx +++ b/src/haxelib/client/Main.hx @@ -1291,7 +1291,7 @@ class Main { print("Library "+prj+" current version is now "+version); } - function checkRec( rep : String, prj : String, version : String, l : List<{ project : String, version : String, dir : String, info : Infos }> ) { + function checkRec( rep : String, prj : String, version : String, l : List<{ project : String, version : String, dir : String, info : Infos }>, ?returnDependencies : Bool = true ) { var pdir = rep + Data.safe(prj); if( !FileSystem.exists(pdir) ) throw "Library "+prj+" is not installed : run 'haxelib install "+prj+"'"; @@ -1312,9 +1312,11 @@ class Main { var json = try File.getContent(vdir+"/"+Data.JSON) catch( e : Dynamic ) null; var inf = Data.readData(json,false); l.add({ project : prj, version : version, dir : Path.addTrailingSlash(vdir), info: inf }); - for( d in inf.dependencies ) - if( !Lambda.exists(l, function(e) return e.project == d.name) ) - checkRec(rep,d.name,if( d.version == "" ) null else d.version,l); + if( returnDependencies ) { + for( d in inf.dependencies ) + if( !Lambda.exists(l, function(e) return e.project == d.name) ) + checkRec(rep,d.name,if( d.version == "" ) null else d.version,l); + } } function path() { @@ -1322,7 +1324,7 @@ class Main { var list = new List(); while( argcur < args.length ) { var a = args[argcur++].split(":"); - checkRec(rep, a[0],a[1],list); + checkRec(rep, a[0], a[1], list); } for( d in list ) { var ndir = d.dir + "ndll"; @@ -1350,7 +1352,7 @@ class Main { while( argcur < args.length ) { var a = args[argcur++].split(":"); var results = new List(); - checkRec(rep, a[0],a[1],results); + checkRec(rep, a[0], a[1], results, false); if( !results.isEmpty() ) Sys.println(results.first().dir); } }