Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7760C18F6B for ; Thu, 7 Jan 2016 07:42:46 +0000 (UTC) Received: (qmail 31354 invoked by uid 500); 7 Jan 2016 07:42:46 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 31311 invoked by uid 500); 7 Jan 2016 07:42:46 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 31302 invoked by uid 99); 7 Jan 2016 07:42:46 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jan 2016 07:42:46 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3359DE0BBA; Thu, 7 Jan 2016 07:42:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: purplecabbage@apache.org To: commits@cordova.apache.org Date: Thu, 07 Jan 2016 07:42:46 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/5] cordova-lib git commit: Add recursive install check and tests to prove it. Repository: cordova-lib Updated Branches: refs/heads/master 5eb351e08 -> 0d2c2ec17 Add recursive install check and tests to prove it. Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/9b767b5b Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/9b767b5b Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/9b767b5b Branch: refs/heads/master Commit: 9b767b5b1b94823114f1bcb6b2e943b1aeb56a5b Parents: 0b0dee5 Author: Jesse MacFadyen Authored: Wed Jul 22 17:08:48 2015 -0700 Committer: Jesse MacFadyen Committed: Wed Jul 22 17:08:48 2015 -0700 ---------------------------------------------------------------------- cordova-lib/spec-plugman/fetch.spec.js | 16 +++++++++++ .../plugins/recursivePlug/asset.txt | 1 + .../plugins/recursivePlug/plugin.xml | 30 ++++++++++++++++++++ cordova-lib/src/plugman/fetch.js | 5 ++++ 4 files changed, 52 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/9b767b5b/cordova-lib/spec-plugman/fetch.spec.js ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/fetch.spec.js b/cordova-lib/spec-plugman/fetch.spec.js index cfc3104..97c6189 100644 --- a/cordova-lib/spec-plugman/fetch.spec.js +++ b/cordova-lib/spec-plugman/fetch.spec.js @@ -239,6 +239,22 @@ describe('fetch', function() { }); }); + describe('fetch recursive error CB-8809', function(){ + + var srcDir = path.join(__dirname, 'plugins/recursivePlug'); + var appDir = path.join(__dirname, 'plugins/recursivePlug/demo'); + + it('should skip copy to avoid recursive error', function(done) { + + var cp = spyOn(shell, 'cp').andCallFake(function(){}); + + wrapper(fetch(srcDir, appDir),done, function() { + expect(cp).not.toHaveBeenCalled(); + }); + }); + + }); + describe('registry plugins', function() { var pluginId = 'dummyplugin', sFetch; var rm, sym, save_metadata; http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/9b767b5b/cordova-lib/spec-plugman/plugins/recursivePlug/asset.txt ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/recursivePlug/asset.txt b/cordova-lib/spec-plugman/plugins/recursivePlug/asset.txt new file mode 100644 index 0000000..3ba44e4 --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/recursivePlug/asset.txt @@ -0,0 +1 @@ +//asset file \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/9b767b5b/cordova-lib/spec-plugman/plugins/recursivePlug/plugin.xml ---------------------------------------------------------------------- diff --git a/cordova-lib/spec-plugman/plugins/recursivePlug/plugin.xml b/cordova-lib/spec-plugman/plugins/recursivePlug/plugin.xml new file mode 100644 index 0000000..ea130e5 --- /dev/null +++ b/cordova-lib/spec-plugman/plugins/recursivePlug/plugin.xml @@ -0,0 +1,30 @@ + + + + + + test recursive + + + + http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/9b767b5b/cordova-lib/src/plugman/fetch.js ---------------------------------------------------------------------- diff --git a/cordova-lib/src/plugman/fetch.js b/cordova-lib/src/plugman/fetch.js index 5003611..f1c734b 100644 --- a/cordova-lib/src/plugman/fetch.js +++ b/cordova-lib/src/plugman/fetch.js @@ -272,6 +272,11 @@ function copyPlugin(pinfo, plugins_dir, link) { return altDest; } + if(!link && dest.indexOf(path.resolve(plugin_dir)) == 0) { + events.emit('verbose', 'Copy plugin destination is child of src. Forcing --link mode.'); + link = true; + } + shell.rm('-rf', dest); if (link) { var isRelativePath = plugin_dir.charAt(1) != ':' && plugin_dir.charAt(0) != path.sep; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org For additional commands, e-mail: commits-help@cordova.apache.org