From a89b26a74c78ef1326a7b97ebd66b80aa5fab205 Mon Sep 17 00:00:00 2001 From: Nunzio Andrea Galante Date: Tue, 10 Oct 2017 14:25:11 +0000 Subject: [PATCH] git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/dataminer-pool-manager@155087 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../poolmanager/util/CheckMethod.java | 42 ++++++++++++++----- .../poolmanager/util/SVNUpdater.java | 15 +++++-- 2 files changed, 42 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/CheckMethod.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/CheckMethod.java index ad5f1a9..d983d05 100644 --- a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/CheckMethod.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/CheckMethod.java @@ -7,6 +7,10 @@ import java.io.FileWriter; import java.io.InputStream; import java.io.InputStreamReader; ***REMOVED*** +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedList; +***REMOVED*** import java.util.Vector; @@ -263,7 +267,20 @@ public class CheckMethod ***REMOVED*** - + + public List getFiles(String a)***REMOVED*** + + String[] array = a.split(","); + ArrayList list = new ArrayList<>(Arrays.asList(array)); + List ls = new LinkedList(); + + for (String s: list)***REMOVED*** + ls.add(s.trim()); + ***REMOVED*** + + return ls; +***REMOVED*** + @@ -277,6 +294,9 @@ public class CheckMethod ***REMOVED*** ***REMOVED*** System.out.println(a.getStagingHost()); CheckMethod a = new CheckMethod(); + + a.getFiles("/trunk/data-analysis/RConfiguration/RPackagesManagement/r_deb_pkgs.txt, /trunk/data-analysis/RConfiguration/RPackagesManagement/r_cran_pkgs.txt, /trunk/data-analysis/RConfiguration/RPackagesManagement/r_github_pkgs.txt"); + ***REMOVED*** File aa = new File("OCTAVEBLACKBOX.jar"); ***REMOVED*** System.out.println(aa.getName()); ***REMOVED*** System.out.println(aa.getPath()); @@ -287,16 +307,16 @@ public class CheckMethod ***REMOVED*** ***REMOVED***a.copyFromDmToSVN(aa); - if (a.checkMethod("dataminer-ghost-d.dev.d4science.org", "***REMOVED***"))***REMOVED*** - System.out.println("AAA");***REMOVED*** - - if (a.doesExist("/home/gcube/wps_algorithms/algorithms/WINDOWS_BLACK_BOX_EXAMPLE.jar"))***REMOVED*** - System.out.println("BBBB"); - -***REMOVED*** - if (a.doesExist("/home/gcube/wps_algorithms/algorithms/WINDOWS_BLACK_BOX_EXAMPLE_interface.jar"))***REMOVED*** - System.out.println("CCCC");***REMOVED*** - +***REMOVED*** if (a.checkMethod("dataminer-ghost-d.dev.d4science.org", "***REMOVED***"))***REMOVED*** +***REMOVED*** System.out.println("AAA");***REMOVED*** +***REMOVED*** +***REMOVED*** if (a.doesExist("/home/gcube/wps_algorithms/algorithms/WINDOWS_BLACK_BOX_EXAMPLE.jar"))***REMOVED*** +***REMOVED*** System.out.println("BBBB"); +***REMOVED*** +***REMOVED******REMOVED*** +***REMOVED*** if (a.doesExist("/home/gcube/wps_algorithms/algorithms/WINDOWS_BLACK_BOX_EXAMPLE_interface.jar"))***REMOVED*** +***REMOVED*** System.out.println("CCCC");***REMOVED*** +***REMOVED*** ***REMOVED*** File aa = new File("/home/gcube/wps_algorithms/algorithms/RBLACKBOX_interface.jar"); ***REMOVED*** a.copyFromDmToSVN(aa, "Dev"); diff --git a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/SVNUpdater.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/SVNUpdater.java index 1ea77d9..bf52806 100644 --- a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/SVNUpdater.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/SVNUpdater.java @@ -566,14 +566,20 @@ public class SVNUpdater ***REMOVED*** System.out.println("Checking dependencies list: " + file); - final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - svnRepository.getFile(file, SVNRepository.INVALID_REVISION, null, byteArrayOutputStream); + CheckMethod cm = new CheckMethod(); List validDependencies = new LinkedList(); + + for (String singlefile: cm.getFiles(file))***REMOVED*** + + final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + svnRepository.getFile(singlefile, SVNRepository.INVALID_REVISION, null, byteArrayOutputStream); + for(String l: byteArrayOutputStream.toString().split("\\r?\\n"))***REMOVED*** validDependencies.add(l.trim()); - ***REMOVED*** - + ***REMOVED******REMOVED*** + + System.out.println("Valid dependencies are: "+validDependencies); for(Dependency d: deps)***REMOVED*** String depName = d.getName(); if(!validDependencies.contains(depName))***REMOVED*** @@ -581,6 +587,7 @@ public class SVNUpdater ***REMOVED*** ***REMOVED*** ***REMOVED*** + return undefined; ***REMOVED*** ***REMOVED***