Permalink
Browse files

Merge remote-tracking branch 'apache/1.1.x'

  • Loading branch information...
2 parents 6e6523d + da22c19 commit cf630a2e87ac1b6eace26601dc5b7ffdb39273b2 Robert Newson committed Oct 10, 2011
View
@@ -6,8 +6,29 @@ Version 1.1.1
This version has not been released yet.
+* Add configurable maximum to the number of bytes returned by _log.
+* Allow CommonJS modules to be an empty string.
+* Bump minimum Erlang version to R13B02.
+* Do not run deleted validate_doc_update functions.
* ETags for views include current sequence if include_docs=true.
+* Fix bug where duplicates can appear in _changes feed.
+* Fix bug where update handlers break after conflict resolution.
+* Fix bug with _replicator where include "filter" could crash couch.
+* Fix crashes when compacting large views.
+* Fix file descriptor leak in _log
+* Fix missing revisions in _changes?style=all_docs.
+* Improve handling of compaction at max_dbs_open limit.
* JSONP responses now send "text/javascript" for Content-Type.
+* Link to ICU 4.2 on Windows.
+* Permit forward slashes in path to update functions.
+* Reap couchjs processes that hit reduce_overflow error.
+* Status code can be specified in update handlers.
+* Support provides() in show functions.
+* _view_cleanup when ddoc has no views now removes all index files.
+* max_replication_retry_count now supports "infinity".
+* Fix replication crash when source database has a document with empty ID.
+* Fix deadlock when assigning couchjs processes to serve requests.
+* Fixes to the document multipart PUT API.
Version 1.1.0
-------------
View
@@ -12,8 +12,29 @@ Version 1.1.1
This version has not been released yet.
+* Add configurable maximum to the number of bytes returned by _log.
+* Allow CommonJS modules to be an empty string.
+* Bump minimum Erlang version to R13B02.
+* Do not run deleted validate_doc_update functions.
* ETags for views include current sequence if include_docs=true.
+* Fix bug where duplicates can appear in _changes feed.
+* Fix bug where update handlers break after conflict resolution.
+* Fix bug with _replicator where include "filter" could crash couch.
+* Fix crashes when compacting large views.
+* Fix file descriptor leak in _log
+* Fix missing revisions in _changes?style=all_docs.
+* Improve handling of compaction at max_dbs_open limit.
* JSONP responses now send "text/javascript" for Content-Type.
+* Link to ICU 4.2 on Windows.
+* Permit forward slashes in path to update functions.
+* Reap couchjs processes that hit reduce_overflow error.
+* Status code can be specified in update handlers.
+* Support provides() in show functions.
+* _view_cleanup when ddoc has no views now removes all index files.
+* max_replication_retry_count now supports "infinity".
+* Fix replication crash when source database has a document with empty ID.
+* Fix deadlock when assigning couchjs processes to serve requests.
+* Fixes to the document multipart PUT API.
Version 1.1.0
-------------
@@ -27,4 +27,4 @@ cat $SCRIPT_DIR/json2.js \
$SCRIPT_DIR/test/*.js \
$JS_TEST_DIR/couch_http.js \
$JS_TEST_DIR/cli_runner.js \
- | $COUCHJS --http -
+ | $COUCHJS -H -
View
@@ -13,6 +13,7 @@
# the License.
import os
import commands
+import subprocess
def require_lib(name):
if not conf.CheckLib(name):
@@ -86,6 +87,13 @@ if not env.GetOption('clean'):
conf.Define(vsn)
break
+ ## Define properties for -h / -V
+
+ vsn = subprocess.check_output(["git","describe","--match","1.*"])
+ conf.Define("PACKAGE_STRING", '"%s"' % vsn.rstrip())
+ conf.Define("PACKAGE_NAME", '"Cloudant BigCouch"')
+ conf.Define("PACKAGE_BUGREPORT", '"https://github.com/cloudant/bigcouch/issues"')
+
env = conf.Finish()
env.Program('couchjs', ['main.c', 'http.c', 'utf8.c', 'util.c'])
View
@@ -0,0 +1,82 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+#ifndef COUCHJS_HELP_H
+#define COUCHJS_HELP_H
+
+#include <libgen.h>
+
+#include "config.h"
+
+static const char VERSION_TEMPLATE[] =
+ "%s - %s\n"
+ "\n"
+ "Licensed under the Apache License, Version 2.0 (the \"License\"); you may "
+ "not use\n"
+ "this file except in compliance with the License. You may obtain a copy of"
+ "the\n"
+ "License at\n"
+ "\n"
+ " http://www.apache.org/licenses/LICENSE-2.0\n"
+ "\n"
+ "Unless required by applicable law or agreed to in writing, software "
+ "distributed\n"
+ "under the License is distributed on an \"AS IS\" BASIS, WITHOUT "
+ "WARRANTIES OR\n"
+ "CONDITIONS OF ANY KIND, either express or implied. See the License "
+ "for the\n"
+ "specific language governing permissions and limitations under the "
+ "License.\n";
+
+static const char USAGE_TEMPLATE[] =
+ "Usage: %s [FILE]\n"
+ "\n"
+ "The %s command runs the %s JavaScript interpreter.\n"
+ "\n"
+ "The exit status is 0 for success or 1 for failure.\n"
+ "\n"
+ "Options:\n"
+ "\n"
+ " -h display a short help message and exit\n"
+ " -V display version information and exit\n"
+ " -H enable %s cURL bindings (only avaiable\n"
+ " if package was built with cURL available)\n"
+ " -S SIZE specify that the interpreter should set the\n"
+ " the stack quota for JS contexts to SIZE bytes\n"
+ "\n"
+ "Report bugs at <%s>.\n";
+
+#define BASENAME basename((char*)argv[0])
+
+#define couch_version(basename) \
+ fprintf( \
+ stdout, \
+ VERSION_TEMPLATE, \
+ basename, \
+ PACKAGE_STRING)
+
+#define DISPLAY_VERSION couch_version(BASENAME)
+
+
+#define couch_usage(basename) \
+ fprintf( \
+ stdout, \
+ USAGE_TEMPLATE, \
+ basename, \
+ basename, \
+ PACKAGE_NAME, \
+ basename, \
+ PACKAGE_BUGREPORT)
+
+#define DISPLAY_USAGE couch_usage(BASENAME)
+
+#endif // Included help.h
View
@@ -13,6 +13,7 @@
#include <stdlib.h>
#include <string.h>
+#include "help.h"
#include "util.h"
#include "utf8.h"
@@ -77,15 +78,30 @@ couch_parse_args(int argc, const char* argv[])
args->stack_size = 8L * 1024L;
while(i < argc) {
- if(strcmp("--http", argv[i]) == 0) {
+ if(strcmp("-h", argv[i]) == 0) {
+ DISPLAY_USAGE;
+ exit(0);
+ } else if(strcmp("-V", argv[i]) == 0) {
+ DISPLAY_VERSION;
+ exit(0);
+ } else if(strcmp("-H", argv[i]) == 0) {
args->use_http = 1;
- } else if(strcmp("--stack-size", argv[i]) == 0) {
- args->stack_size = atoi(argv[i+1]);
+ } else if(strcmp("-S", argv[i]) == 0) {
+ args->stack_size = atoi(argv[++i]);
if(args->stack_size <= 0) {
fprintf(stderr, "Invalid stack size.\n");
exit(2);
}
+ } else if(strcmp("--", argv[i]) == 0) {
+ i++;
+ break;
} else {
+ break;
+ }
+ i++;
+ }
+
+ while(i < argc) {
args->script = slurp_file(args->script, argv[i]);
if(args->script_name == NULL) {
if(strcmp(argv[i], "-") == 0) {
@@ -96,12 +112,11 @@ couch_parse_args(int argc, const char* argv[])
} else {
args->script_name = "<multiple_files>";
}
- }
i++;
}
if(args->script_name == NULL || args->script == NULL) {
- fprintf(stderr, "No script provided.\n");
+ DISPLAY_USAGE;
exit(3);
}
View
@@ -22,7 +22,6 @@ typedef struct {
char* script;
} couch_args;
-void couch_usage();
couch_args* couch_parse_args(int argc, const char* argv[]);
int couch_fgets(char* buf, int size, FILE* fp);
JSString* couch_readline(JSContext* cx, FILE* fp);
View
@@ -63,11 +63,6 @@ var Couch = {
},
compileFunction : function(source, ddoc) {
if (!source) throw(["error","not_found","missing function"]);
- // Some newer SpiderMonkey's appear to not like evaluating
- // an anonymous function at global scope. Simple fix just
- // wraps the source with parens so the function object is
- // returned correctly.
- source = "(" + source + ")";
try {
if (sandbox) {
if (ddoc) {

0 comments on commit cf630a2

Please sign in to comment.