You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ka...@apache.org on 2014/06/20 18:41:13 UTC

git commit: CB-6140 Don't allow deletion of platform dependencies

Repository: cordova-lib
Updated Branches:
  refs/heads/master d23aee39b -> c7f4f7fc1


CB-6140 Don't allow deletion of platform dependencies

plugman dependency check will ignore platform/dependency when removing an
installed plugin, which will result in platform level dependencies is
uninstalled improperly.

github: close #38


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/c7f4f7fc
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/c7f4f7fc
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/c7f4f7fc

Branch: refs/heads/master
Commit: c7f4f7fc1f60357900ecf98a30c0f0969bc07e68
Parents: d23aee3
Author: Danyi Lin <da...@blackberry.com>
Authored: Thu Jun 19 18:45:19 2014 -0400
Committer: Mark Koudritsky <ka...@gmail.com>
Committed: Fri Jun 20 12:24:40 2014 -0400

----------------------------------------------------------------------
 cordova-lib/src/plugman/uninstall.js         | 2 +-
 cordova-lib/src/plugman/util/dependencies.js | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/c7f4f7fc/cordova-lib/src/plugman/uninstall.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/uninstall.js b/cordova-lib/src/plugman/uninstall.js
index 69c70fc..ac4c787 100644
--- a/cordova-lib/src/plugman/uninstall.js
+++ b/cordova-lib/src/plugman/uninstall.js
@@ -116,7 +116,7 @@ module.exports.uninstallPlugin = function(id, plugins_dir, options) {
     // Recursively remove plugins which were installed as dependents (that are not top-level)
     // optional?
     var recursive = true;
-    var toDelete = recursive ? plugin_et.findall('dependency') : [];
+    var toDelete = recursive ? plugin_et.findall('.//dependency') : [];
     toDelete = toDelete && toDelete.length ? toDelete.map(function(p) { return p.attrib.id; }) : [];
     toDelete.push(top_plugin_id);
 

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/c7f4f7fc/cordova-lib/src/plugman/util/dependencies.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/util/dependencies.js b/cordova-lib/src/plugman/util/dependencies.js
index ce9128b..511dfb6 100644
--- a/cordova-lib/src/plugman/util/dependencies.js
+++ b/cordova-lib/src/plugman/util/dependencies.js
@@ -52,7 +52,7 @@ module.exports = package = {
             tlps.push(plugin_id);
 
             var xml = xml_helpers.parseElementtreeSync( package.resolveConfig(plugin_id, plugins_dir) );
-            var deps = xml.findall('dependency');
+            var deps = xml.findall('.//dependency');
 
             deps && deps.forEach(function(dep) {
                 graph.add(plugin_id, dep.attrib.id);
@@ -60,7 +60,7 @@ module.exports = package = {
         });
         Object.keys(json.dependent_plugins).forEach(function(plugin_id) {
             var xml = xml_helpers.parseElementtreeSync( package.resolveConfig(plugin_id, plugins_dir) );
-            var deps = xml.findall('dependency');
+            var deps = xml.findall('.//dependency');
             deps && deps.forEach(function(dep) {
                 graph.add(plugin_id, dep.attrib.id);
             });