cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject git commit: CB-6307 minor bugs
Date Wed, 19 Mar 2014 03:24:14 GMT
Repository: cordova-coho
Updated Branches:
  refs/heads/master 1e71a54d0 -> 32ab0c9a6


CB-6307 minor bugs

- re-execing with the modified ulimit would hide all the output and mask
  non-zero rc when there was an error. It should show the output and let the
  non-zero rc cascade out.
- the "--sign" argv for create-archive was not properly typed to boolean. So
  doing "--sign false" did not have the intended result.
- if not signing the archive, it still failed if 'gpg' was not present.
- when unzipping the zip archive of the source, there is no leading prefix.
  Thus when unzipping multiple repo archives, they will step on each other
  unless you first manually create separate subdirectories for each repo zip.
  Although this isn't technically an error, I think it would more friendly if
  the zips were already separated into different subdirectories when you unzip
  them.


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

Branch: refs/heads/master
Commit: 32ab0c9a634070fb74246b9caab3d7f4f0c9f163
Parents: 1e71a54
Author: Marcel Kinard <cmarcelk@gmail.com>
Authored: Tue Mar 18 23:21:57 2014 -0400
Committer: Marcel Kinard <cmarcelk@gmail.com>
Committed: Tue Mar 18 23:21:57 2014 -0400

----------------------------------------------------------------------
 coho | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/32ab0c9a/coho
----------------------------------------------------------------------
diff --git a/coho b/coho
index 330d6f5..89eb2f8 100755
--- a/coho
+++ b/coho
@@ -481,8 +481,11 @@ function registerHelpFlag(opt) {
 }
 
 function execHelper(cmd, silent, allowError) {
-    // Don't allow failure if being silent.
-    allowError = allowError || silent;
+    // there are times where we want silent but not allowError.
+    if (null == allowError) {
+        // default to allow failure if being silent.
+        allowError = allowError || silent;
+    }
     if (/^git commit/.exec(cmd)) {
         gitCommitCount++;
     }
@@ -491,10 +494,12 @@ function execHelper(cmd, silent, allowError) {
     }
     // silent==2 is used only when modifying ulimit and re-exec'ing,
     // so don't be silent but allow whatever to happen.
-    var result = shjs.exec(cmd, {silent: (silent && silent !== 2)});
+    var result = shjs.exec(cmd, {silent: (silent && (silent !== 2))});
     if (result.code) {
         if (allowError) {
             return null;
+        } else if (!(silent === true)) {
+            print(result.output.trim());
         }
         process.exit(2);
     }
@@ -559,7 +564,8 @@ function createArchiveCommand(argv) {
             desc: 'The pre-existing tag to archive (defaults to newest tag on branch)'
          })
         .options('sign', {
-            desc: 'Whether to create .asc, .md5, .sha files',
+            desc: 'Whether to create .asc, .md5, .sha files (defaults to true)',
+            type: 'boolean',
             default: true
          })
         .options('dest', {
@@ -580,7 +586,7 @@ function createArchiveCommand(argv) {
     }
     var repos = computeReposFromFlag(argv.r);
 
-    if (!shjs.which('gpg')) {
+    if (argv.sign && !shjs.which('gpg')) {
         fatal('gpg command not found on your PATH. Refer to https://wiki.apache.org/cordova/SetUpGpg');
     }
 
@@ -592,7 +598,7 @@ function createArchiveCommand(argv) {
         var tag = argv.tag || findMostRecentTag();
         print('Creating archive of ' + repo.repoName + '@' + tag);
         var outPath = path.join(absOutDir, repo.repoName + '-' + tag + '.zip');
-        execHelper('git archive --format zip -o "' + outPath + '" ' + tag);
+        execHelper('git archive --format zip --prefix ' + repo.repoName + '/ -o "' + outPath
+ '" ' + tag);
         if (argv.sign) {
             execHelper('gpg --armor --detach-sig --output "' + outPath + '.asc" "' + outPath
+ '"');
             fs.writeFileSync(outPath + '.md5', computeHash(outPath, 'MD5'));
@@ -2103,8 +2109,8 @@ function main() {
     // ShellJS opens a lot of file handles, and the default on OS X is too small.
     var ulimit = execHelper('ulimit -S -n', true, true);
     if (ulimit && ulimit < 2000) {
-        // re-run with the new ulimit
-        execHelper('/bin/bash -c \'ulimit -S -n 4096; exec "' + process.argv[0] + '" "' +
process.argv.slice(1).join('" "') + '" --ulimit\'', 2);
+        // re-run with the new ulimit, hide the ulimit command but don't hide the output,
don't allow failure
+        execHelper('/bin/bash -c \'ulimit -S -n 4096; exec "' + process.argv[0] + '" "' +
process.argv.slice(1).join('" "') + '"\'', 2, false);
         return;
     }
 


Mime
View raw message