You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by br...@apache.org on 2014/01/28 17:45:38 UTC

[1/2] git commit: Always use package.crx always as the download target for CRX mode.

Updated Branches:
  refs/heads/master 5156ee43a -> dfb369ef5


Always use package.crx always as the download target for CRX mode.

The zip plugin insists on filenames ending in .crx to do its special
handling for CRX files. Since the filename is otherwise irrelevant and
this is really a temporary file, we always use package.crx.


Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/5dc827a0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/5dc827a0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/5dc827a0

Branch: refs/heads/master
Commit: 5dc827a0d52f0c1d143d469c98af98985e022a11
Parents: 5156ee4
Author: Braden Shepherdson <br...@gmail.com>
Authored: Tue Jan 28 11:20:48 2014 -0500
Committer: Braden Shepherdson <br...@gmail.com>
Committed: Tue Jan 28 11:20:48 2014 -0500

----------------------------------------------------------------------
 www/cdvah/js/CrxInstaller.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/5dc827a0/www/cdvah/js/CrxInstaller.js
----------------------------------------------------------------------
diff --git a/www/cdvah/js/CrxInstaller.js b/www/cdvah/js/CrxInstaller.js
index f83a3cb..4888699 100644
--- a/www/cdvah/js/CrxInstaller.js
+++ b/www/cdvah/js/CrxInstaller.js
@@ -19,8 +19,9 @@
             var xhr;
             var self = this;
 
-            var baseName = self.url.match(/\/([^\/]*)$/)[1];
-            var crxFile = installPath.replace(/\/$/, '') + '/' + baseName;
+            // The filename doesn't matter, but it needs to end with .crx for the zip plugin to unpack
+            // it properly. So we always set the filename to package.crx.
+            var crxFile = installPath.replace(/\/$/, '') + '/package.crx';
 
             return ResourcesLoader.downloadFromUrl(this.url, crxFile).then(function(destination) {
                 return ResourcesLoader.extractZipFile(crxFile, installPath);


[2/2] git commit: Cleaning up error messages for bad zip files

Posted by br...@apache.org.
Cleaning up error messages for bad zip files


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

Branch: refs/heads/master
Commit: dfb369ef5ebb3b5cc6b58d32e843d66d69da8c0a
Parents: 5dc827a
Author: Braden Shepherdson <br...@gmail.com>
Authored: Tue Jan 28 11:45:18 2014 -0500
Committer: Braden Shepherdson <br...@gmail.com>
Committed: Tue Jan 28 11:45:18 2014 -0500

----------------------------------------------------------------------
 www/cdvah/js/CrxInstaller.js    | 3 +--
 www/cdvah/js/ResourcesLoader.js | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/dfb369ef/www/cdvah/js/CrxInstaller.js
----------------------------------------------------------------------
diff --git a/www/cdvah/js/CrxInstaller.js b/www/cdvah/js/CrxInstaller.js
index 4888699..d0f2777 100644
--- a/www/cdvah/js/CrxInstaller.js
+++ b/www/cdvah/js/CrxInstaller.js
@@ -17,13 +17,12 @@
             var platformConfig = location.pathname.replace(/\/[^\/]*$/, '/crx_files/config.' + platformId + '.xml');
             var targetConfig = installPath + '/config.xml';
             var xhr;
-            var self = this;
 
             // The filename doesn't matter, but it needs to end with .crx for the zip plugin to unpack
             // it properly. So we always set the filename to package.crx.
             var crxFile = installPath.replace(/\/$/, '') + '/package.crx';
 
-            return ResourcesLoader.downloadFromUrl(this.url, crxFile).then(function(destination) {
+            return ResourcesLoader.downloadFromUrl(this.url, crxFile).then(function() {
                 return ResourcesLoader.extractZipFile(crxFile, installPath);
             }).then(function() {
                 // Copy in the config.<platform>.xml file from the harness.

http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/dfb369ef/www/cdvah/js/ResourcesLoader.js
----------------------------------------------------------------------
diff --git a/www/cdvah/js/ResourcesLoader.js b/www/cdvah/js/ResourcesLoader.js
index 8d634f3..d7d3efb 100644
--- a/www/cdvah/js/ResourcesLoader.js
+++ b/www/cdvah/js/ResourcesLoader.js
@@ -306,7 +306,7 @@
 
                     var onZipDone = function(returnCode) {
                         if(returnCode !== 0) {
-                            deferred.reject(new Error('Something went wrong during the unzipping of: ' + fileName));
+                            deferred.reject(new Error('Failed to unzip! Bad URL?'));
                         } else {
                             deferred.resolve();
                         }