From 15e44245824ddd91353e17d174dea65b2014e2b5 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 28 Mar 2022 12:13:03 +0100 Subject: [PATCH] Mark all components below a released parent component as released --- meta/folder.groovy | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/meta/folder.groovy b/meta/folder.groovy index 34448dd..fd61f81 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -959,6 +959,7 @@ class MetaInfo extends GISJsonSerialised { private String gatheredmetapath private boolean limiteddepth private int maxdepth + private boolean markasreleased IterationInfo(ArrayList metacollection, Map metamap, @@ -967,7 +968,8 @@ class MetaInfo extends GISJsonSerialised { String gatheredpath = '', String gatheredmetapath = '', boolean limiteddepth = false, - int maxdepth = 0) { + int maxdepth = 0, + boolean markasreleased = false) { this.metacollection = metacollection this.metamap = metamap this.comment = comment @@ -976,10 +978,11 @@ class MetaInfo extends GISJsonSerialised { this.gatheredmetapath = gatheredmetapath this.limiteddepth = limiteddepth this.maxdepth = maxdepth + this.markasreleased = markasreleased } String show() { - return "Iteration:\nLevel: ${level}\nGathered path: ${gatheredpath}\nGathered meta path: ${gatheredmetapath}\nLimited depth: ${limiteddepth}\nMax depth: ${maxdepth}" + return "Iteration:\nLevel: ${level}\nGathered path: ${gatheredpath}\nGathered meta path: ${gatheredmetapath}\nLimited depth: ${limiteddepth}\nMax depth: ${maxdepth}\nMark as released: ${markasreleased}" } void add(CollectedMeta item) { @@ -1008,6 +1011,10 @@ class MetaInfo extends GISJsonSerialised { imported = false } + if (ii.markasreleased) { + mi.markreleased + } + def childmetainfo = [ 'imported': imported, 'nextgatheredpath': nextgatheredpath, @@ -1025,6 +1032,9 @@ class MetaInfo extends GISJsonSerialised { for (relatedmetainfo in associatedmeta) { if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') { def MetaInfo othermeta = relatedmetainfo.meta + if (this.releaseinfo.released) { + othermeta.markreleased() + } def String nextgatheredpath = (ii.gatheredpath == '' ? relatedmetainfo.offsetpath : "${ii.gatheredpath}/${relatedmetainfo.offsetpath}") def String nextgatheredmetapath = (ii.gatheredmetapath == '' ? relatedmetainfo.offsetpath : "${ii.gatheredmetapath}/${relatedmetainfo.offsetpath}") def nextii = new IterationInfo(ii.metacollection, @@ -1034,7 +1044,8 @@ class MetaInfo extends GISJsonSerialised { nextgatheredpath, nextgatheredmetapath, ii.limiteddepth, - ii.maxdepth - 1) + ii.maxdepth - 1, + this.releaseinfo.released) def results = othermeta.walkrelated_v0_1(nextii) ii.metacollection = results.metacollection ii.metamap = results.metamap @@ -1064,7 +1075,8 @@ class MetaInfo extends GISJsonSerialised { childmetainfo.nextgatheredpath, childmetainfo.nextgatheredmetapath, ii.limiteddepth, - ii.maxdepth - 1) + ii.maxdepth - 1, + this.releaseinfo.released) def results = childmetainfo.childmeta.walkrelated(nextii) ii.metacollection = results.metacollection ii.metamap = results.metamap @@ -1072,6 +1084,9 @@ class MetaInfo extends GISJsonSerialised { } } else if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') { def MetaInfo othermeta = relatedmetainfo.meta + if (this.releaseinfo.released) { + othermeta.markreleased() + } def String nextgatheredpath = (ii.gatheredpath == '' ? relatedmetainfo.offsetpath : "${ii.gatheredpath}/${relatedmetainfo.offsetpath}") def String nextgatheredmetapath = (ii.gatheredmetapath == '' ? relatedmetainfo.offsetpath : "${ii.gatheredmetapath}/${relatedmetainfo.offsetpath}") def nextii = new IterationInfo(ii.metacollection, @@ -1081,7 +1096,8 @@ class MetaInfo extends GISJsonSerialised { nextgatheredpath, nextgatheredmetapath, ii.limiteddepth, - ii.maxdepth - 1) + ii.maxdepth - 1, + this.releaseinfo.released) def results = othermeta.walkrelated_v0_1(nextii) ii.metacollection = results.metacollection ii.metamap = results.metamap