Only update plugins.txt if there were uninstalled plugins CTR

Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/397158ad
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/397158ad
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/397158ad

Branch: refs/heads/TINKERPOP-1752
Commit: 397158ade1a7b8e334104e16fc6517c44c87ddff
Parents: 74f10b1
Author: Stephen Mallette <[email protected]>
Authored: Fri Sep 1 13:47:31 2017 -0400
Committer: Stephen Mallette <[email protected]>
Committed: Fri Sep 1 13:47:31 2017 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                            | 2 +-
 .../org/apache/tinkerpop/gremlin/console/Console.groovy       | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/397158ad/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index fc0b9ef..9165b31 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,12 +26,12 @@ 
image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.2.7 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* The Console's `plugin.txt` file is only updated if there were manually 
uninstalled plugins.
 * Ensured that plugins were applied in the order they were configured.
 * Fixed a bug in `Neo4jGremlinPlugin` that prevented it from loading properly 
in the `GremlinPythonScriptEngine`.
 * Fixed a bug in `ComputerVerificationStrategy` where child traversals were 
being analyzed prior to compilation.
 * Fixed a bug that prevented Gremlin from ordering lists and streams made of 
mixed number types.
 
-
 [[release-3-2-6]]
 TinkerPop 3.2.6 (Release Date: August 21, 2017)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/397158ad/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy
----------------------------------------------------------------------
diff --git 
a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy
 
b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy
index 3bdc8a1..59de0b3 100644
--- 
a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy
+++ 
b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy
@@ -152,8 +152,11 @@ class Console {
         }
 
         // remove any "uninstalled" plugins from plugin state as it means they 
were installed, activated, but not
-        // deactivated, and are thus hanging about
-        mediator.writePluginState()
+        // deactivated, and are thus hanging about (e.g. user deleted the 
plugin directories to uninstall). checking
+        // the number of expected active plugins from the plugins.txt file 
against the number activated on startup
+        // should be enough to tell if something changed which would justify 
that the file be re-written
+        if (activePlugins.size() != mediator.activePlugins().size())
+            mediator.writePluginState()
 
         try {
             // if the init script contains :x command it will throw an 
ExitNotification so init script execution

Reply via email to