Compare commits
No commits in common. "master" and "pristine-tar" have entirely different histories.
master
...
pristine-t
6197 changed files with 24 additions and 1677414 deletions
3
.gitattributes
vendored
3
.gitattributes
vendored
|
|
@ -1,3 +0,0 @@
|
||||||
*.vcproj -crlf -diff -merge
|
|
||||||
*.pbxproj -crlf -diff -merge
|
|
||||||
|
|
||||||
160
.gitignore
vendored
160
.gitignore
vendored
|
|
@ -1,160 +0,0 @@
|
||||||
/build
|
|
||||||
/src/mongo/db/modules
|
|
||||||
/.jsdbshell
|
|
||||||
/.dbshell
|
|
||||||
/.sconsign.dblite
|
|
||||||
/.sconf_temp
|
|
||||||
/perf.data
|
|
||||||
/massif.out.*
|
|
||||||
.scons
|
|
||||||
/smoke-last.json
|
|
||||||
|
|
||||||
*~
|
|
||||||
*.swp
|
|
||||||
*.o
|
|
||||||
*.os
|
|
||||||
*.obj
|
|
||||||
*.aps
|
|
||||||
*.ilk
|
|
||||||
*.tar.gz
|
|
||||||
*.suo
|
|
||||||
*.ncb
|
|
||||||
*.idb
|
|
||||||
*.obj
|
|
||||||
*.opt
|
|
||||||
*.pch
|
|
||||||
*.jsh
|
|
||||||
*.jsall
|
|
||||||
*.pyc
|
|
||||||
*.log
|
|
||||||
*.exe
|
|
||||||
*.exp
|
|
||||||
*.lib
|
|
||||||
*.idb
|
|
||||||
*.pdb
|
|
||||||
*.manifest
|
|
||||||
*.user
|
|
||||||
*.gch
|
|
||||||
*.*sdf
|
|
||||||
*.psess
|
|
||||||
*#
|
|
||||||
.#*
|
|
||||||
|
|
||||||
/src/mongo/*/*Debug*/
|
|
||||||
/src/mongo/*/*/*Debug*/
|
|
||||||
/src/mongo/*/*Release*/
|
|
||||||
/src/mongo/*/*/*Release*/
|
|
||||||
/src/ipch
|
|
||||||
/src/mongo/*/ipch
|
|
||||||
/src/mongo/*/*/ipch
|
|
||||||
/src/mongo/db/.gdb*
|
|
||||||
/src/mongo/db/makefile.local
|
|
||||||
/src/mongo/db/_ReSharper.db
|
|
||||||
/src/third_party/*/*.cache
|
|
||||||
/src/third_party/*/*.tlog
|
|
||||||
/src/third_party/*/*.lastbuildstate
|
|
||||||
config.log
|
|
||||||
settings.py
|
|
||||||
log_config.py
|
|
||||||
tags
|
|
||||||
TAGS
|
|
||||||
failfile.smoke
|
|
||||||
|
|
||||||
#temp dirs
|
|
||||||
dump
|
|
||||||
log
|
|
||||||
logs
|
|
||||||
docs/html
|
|
||||||
docs/latex
|
|
||||||
docs/doxygen
|
|
||||||
32bit
|
|
||||||
scratch
|
|
||||||
|
|
||||||
# binaries
|
|
||||||
/mongo
|
|
||||||
/mongod
|
|
||||||
/mongogrid
|
|
||||||
/mongos
|
|
||||||
|
|
||||||
/mongodump
|
|
||||||
/mongorestore
|
|
||||||
|
|
||||||
/mongofiles
|
|
||||||
/mongoexport
|
|
||||||
|
|
||||||
/mongoimport
|
|
||||||
/mongosniff
|
|
||||||
/mongobridge
|
|
||||||
/mongostat
|
|
||||||
/mongotop
|
|
||||||
/mongooplog
|
|
||||||
/mongoperf
|
|
||||||
/bsondump
|
|
||||||
|
|
||||||
*.tgz
|
|
||||||
*.zip
|
|
||||||
*.tar.gz
|
|
||||||
|
|
||||||
#libs
|
|
||||||
/libmongoclient.*
|
|
||||||
/libmongotestfiles.*
|
|
||||||
/libmongoshellfiles.*
|
|
||||||
|
|
||||||
/emr.jar
|
|
||||||
*.class
|
|
||||||
|
|
||||||
# examples
|
|
||||||
/firstExample
|
|
||||||
/secondExample
|
|
||||||
/whereExample
|
|
||||||
/bsondemo
|
|
||||||
/rsExample
|
|
||||||
/tutorial
|
|
||||||
|
|
||||||
#tests
|
|
||||||
/test
|
|
||||||
/authTest
|
|
||||||
/perftest
|
|
||||||
/clientTest
|
|
||||||
/httpClientTest
|
|
||||||
|
|
||||||
#debian
|
|
||||||
build-stamp
|
|
||||||
configure-stamp
|
|
||||||
debian/mongodb
|
|
||||||
# This was inserted 2009-08-16, nobody knows why.
|
|
||||||
#debian/mongodb.*
|
|
||||||
|
|
||||||
#osx
|
|
||||||
.DS_Store
|
|
||||||
._.DS_Store
|
|
||||||
|
|
||||||
# QtCreator
|
|
||||||
*.config
|
|
||||||
*.creator
|
|
||||||
*.creator.user
|
|
||||||
*.files
|
|
||||||
*.includes
|
|
||||||
*.orig
|
|
||||||
|
|
||||||
#built by Visual Studio
|
|
||||||
src/mongo/base/error_codes.cpp
|
|
||||||
src/mongo/base/error_codes.h
|
|
||||||
src/mongo/db/auth/action_type.cpp
|
|
||||||
src/mongo/db/auth/action_type.h
|
|
||||||
src/mongo/db/fts/stop_words_list.cpp
|
|
||||||
src/mongo/db/fts/stop_words_list.h
|
|
||||||
src/mongo/shell/mongo-server.cpp
|
|
||||||
src/mongo/shell/mongo.cpp
|
|
||||||
src/third_party/js-1.7/jsautocfg.h
|
|
||||||
src/third_party/js-1.7/jsautokw.h
|
|
||||||
src/third_party/v8/src/experimental-libraries.cc
|
|
||||||
src/third_party/v8/src/libraries.cc
|
|
||||||
|
|
||||||
# old things that should be removed
|
|
||||||
# maybe remove this mid 2012
|
|
||||||
src/third_party/js-1.7/jscpucfg
|
|
||||||
src/third_party/js-1.7/jskwgen
|
|
||||||
src/mongo/buildinfo.cpp
|
|
||||||
buildinfo.cpp
|
|
||||||
/.settings/
|
|
||||||
202
APACHE-2.0.txt
202
APACHE-2.0.txt
|
|
@ -1,202 +0,0 @@
|
||||||
|
|
||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright [yyyy] [name of copyright owner]
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
Contributing to the MongoDB project
|
|
||||||
===================================
|
|
||||||
|
|
||||||
Pull requests are always welcome, and the MongoDB dev team appreciates any help the community can
|
|
||||||
give to help make MongoDB better.
|
|
||||||
|
|
||||||
For any particular improvement you want to make, you can begin a discussion on the
|
|
||||||
`MongoDB Developers Forum`_. This is the best place discuss your proposed improvement (and its
|
|
||||||
implementation) with the core development team.
|
|
||||||
|
|
||||||
.. _MongoDB Developers Forum: https://groups.google.com/forum/?fromgroups#!forum/mongodb-dev
|
|
||||||
|
|
||||||
|
|
||||||
Getting Started
|
|
||||||
---------------
|
|
||||||
|
|
||||||
- Create a `MongoDB JIRA account`_.
|
|
||||||
- Create a `Github account`_.
|
|
||||||
- Fork the repository on Github at https://github.com/mongodb/mongo.
|
|
||||||
|
|
||||||
.. _MongoDB JIRA account: https://jira.mongodb.org/secure/Signup!default.jspa
|
|
||||||
.. _Github account: https://github.com/signup/free
|
|
||||||
|
|
||||||
|
|
||||||
JIRA Tickets
|
|
||||||
------------
|
|
||||||
|
|
||||||
All commits to the MongoDB repository must reference an issue in the `SERVER project`_ of the
|
|
||||||
MongoDB JIRA. Before creating any new tickets, please search the existing backlog for any open
|
|
||||||
tickets that represent your change request. If there is not one, then you should create a new
|
|
||||||
ticket.
|
|
||||||
|
|
||||||
For bugs, please clearly describe the issue you are resolving, including the platforms on which
|
|
||||||
the issue is present and clear steps to reproduce.
|
|
||||||
|
|
||||||
For improvements or feature requests, be sure to explain the goal or use case and the approach
|
|
||||||
your solution will take.
|
|
||||||
|
|
||||||
.. _SERVER project: https://jira.mongodb.org/browse/SERVER
|
|
||||||
|
|
||||||
|
|
||||||
Style Guide
|
|
||||||
-----------
|
|
||||||
|
|
||||||
All commits to the MongoDB repository must follow the `kernel development rules`_.
|
|
||||||
|
|
||||||
In particular, all code must follow the MongoDB `kernel code style guidelines`_. For anything
|
|
||||||
not covered in this document you should default to the `Google CPP Style Guide`_ and the
|
|
||||||
`Google JavaScript Style Guide`_.
|
|
||||||
|
|
||||||
Your commit message should also be prefaced with the relevant JIRA ticket, e.g. "SERVER-XXX Fixed
|
|
||||||
a bug in aggregation".
|
|
||||||
|
|
||||||
.. _kernel development rules: http://dochub.mongodb.org/core/kernelcodedevelopmentrules
|
|
||||||
.. _Kernel Code Style guidelines: http://dochub.mongodb.org/core/kernelcodestyle
|
|
||||||
.. _Google CPP Style Guide: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
|
|
||||||
.. _Google JavaScript Style Guide: http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml
|
|
||||||
|
|
||||||
|
|
||||||
Testing
|
|
||||||
-------
|
|
||||||
|
|
||||||
Every non-trivial change to the code base should be accompanied by a relevant addition to or
|
|
||||||
modification of the test suite. If you don't believe this is necessary, please add an explanation
|
|
||||||
in the JIRA ticket why no such changes are either needed or possible.
|
|
||||||
|
|
||||||
All changes must also pass the full test suite (including your test additions/changes) on your
|
|
||||||
local machine before you open a pull request.
|
|
||||||
|
|
||||||
|
|
||||||
Contributor Agreement
|
|
||||||
---------------------
|
|
||||||
|
|
||||||
A patch will only be considered for merging into the upstream codebase after you have signed the
|
|
||||||
`contributor agreement`_.
|
|
||||||
|
|
||||||
.. _contributor agreement: http://www.10gen.com/contributor
|
|
||||||
661
GNU-AGPL-3.0.txt
661
GNU-AGPL-3.0.txt
|
|
@ -1,661 +0,0 @@
|
||||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 19 November 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU Affero General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works, specifically designed to ensure
|
|
||||||
cooperation with the community in the case of network server software.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
our General Public Licenses are intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
Developers that use our General Public Licenses protect your rights
|
|
||||||
with two steps: (1) assert copyright on the software, and (2) offer
|
|
||||||
you this License which gives you legal permission to copy, distribute
|
|
||||||
and/or modify the software.
|
|
||||||
|
|
||||||
A secondary benefit of defending all users' freedom is that
|
|
||||||
improvements made in alternate versions of the program, if they
|
|
||||||
receive widespread use, become available for other developers to
|
|
||||||
incorporate. Many developers of free software are heartened and
|
|
||||||
encouraged by the resulting cooperation. However, in the case of
|
|
||||||
software used on network servers, this result may fail to come about.
|
|
||||||
The GNU General Public License permits making a modified version and
|
|
||||||
letting the public access it on a server without ever releasing its
|
|
||||||
source code to the public.
|
|
||||||
|
|
||||||
The GNU Affero General Public License is designed specifically to
|
|
||||||
ensure that, in such cases, the modified source code becomes available
|
|
||||||
to the community. It requires the operator of a network server to
|
|
||||||
provide the source code of the modified version running there to the
|
|
||||||
users of that server. Therefore, public use of a modified version, on
|
|
||||||
a publicly accessible server, gives the public access to the source
|
|
||||||
code of the modified version.
|
|
||||||
|
|
||||||
An older license, called the Affero General Public License and
|
|
||||||
published by Affero, was designed to accomplish similar goals. This is
|
|
||||||
a different license, not a version of the Affero GPL, but Affero has
|
|
||||||
released a new version of the Affero GPL which permits relicensing under
|
|
||||||
this license.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, if you modify the
|
|
||||||
Program, your modified version must prominently offer all users
|
|
||||||
interacting with it remotely through a computer network (if your version
|
|
||||||
supports such interaction) an opportunity to receive the Corresponding
|
|
||||||
Source of your version by providing access to the Corresponding Source
|
|
||||||
from a network server at no charge, through some standard or customary
|
|
||||||
means of facilitating copying of software. This Corresponding Source
|
|
||||||
shall include the Corresponding Source for any work covered by version 3
|
|
||||||
of the GNU General Public License that is incorporated pursuant to the
|
|
||||||
following paragraph.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the work with which it is combined will remain governed by version
|
|
||||||
3 of the GNU General Public License.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU Affero General Public License from time to time. Such new versions
|
|
||||||
will be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU Affero General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU Affero General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU Affero General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Affero General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Affero General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If your software can interact with users remotely through a computer
|
|
||||||
network, you should also make sure that it provides a way for users to
|
|
||||||
get its source. For example, if your program is a web application, its
|
|
||||||
interface could display a "Source" link that leads users to an archive
|
|
||||||
of the code. There are many ways you could offer source, and different
|
|
||||||
solutions will be better for different programs; see section 13 for the
|
|
||||||
specific requirements.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
|
||||||
<http://www.gnu.org/licenses/>.
|
|
||||||
66
README
66
README
|
|
@ -1,66 +0,0 @@
|
||||||
MongoDB README
|
|
||||||
|
|
||||||
Welcome to MongoDB!
|
|
||||||
|
|
||||||
COMPONENTS
|
|
||||||
|
|
||||||
mongod - The database process.
|
|
||||||
mongos - Sharding controller.
|
|
||||||
mongo - The database shell (uses interactive javascript).
|
|
||||||
|
|
||||||
UTILITIES
|
|
||||||
|
|
||||||
mongodump - MongoDB dump tool - for backups, snapshots, etc..
|
|
||||||
mongorestore - MongoDB restore a dump
|
|
||||||
mongoexport - Export a single collection to test (JSON, CSV)
|
|
||||||
mongoimport - Import from JSON or CSV
|
|
||||||
mongofiles - Utility for putting and getting files from MongoDB GridFS
|
|
||||||
mongostat - Show performance statistics
|
|
||||||
|
|
||||||
BUILDING
|
|
||||||
|
|
||||||
See docs/building.md, also www.mongodb.org search for "Building".
|
|
||||||
|
|
||||||
RUNNING
|
|
||||||
|
|
||||||
For command line options invoke:
|
|
||||||
|
|
||||||
$ ./mongod --help
|
|
||||||
|
|
||||||
To run a single server database:
|
|
||||||
|
|
||||||
$ mkdir /data/db
|
|
||||||
$ ./mongod
|
|
||||||
$
|
|
||||||
$ # The mongo javascript shell connects to localhost and test database by default:
|
|
||||||
$ ./mongo
|
|
||||||
> help
|
|
||||||
|
|
||||||
DRIVERS
|
|
||||||
|
|
||||||
Client drivers for most programming languages are available at mongodb.org. Use the
|
|
||||||
shell ("mongo") for administrative tasks.
|
|
||||||
|
|
||||||
DOCUMENTATION
|
|
||||||
|
|
||||||
http://www.mongodb.org/
|
|
||||||
|
|
||||||
MAIL LISTS AND IRC
|
|
||||||
|
|
||||||
http://dochub.mongodb.org/core/community
|
|
||||||
|
|
||||||
32 BIT BUILD NOTES
|
|
||||||
|
|
||||||
MongoDB uses memory mapped files. If built as a 32 bit executable, you will
|
|
||||||
not be able to work with large (multi-gigabyte) databases. However, 32 bit
|
|
||||||
builds work fine with small development databases.
|
|
||||||
|
|
||||||
LICENSE
|
|
||||||
|
|
||||||
Most MongoDB source files are made available under the terms of the
|
|
||||||
GNU Affero General Public License (AGPL). See individual files for
|
|
||||||
details.
|
|
||||||
|
|
||||||
As an exception, the files in the client/, debian/, rpm/,
|
|
||||||
utils/mongoutils, and all subdirectories thereof are made available under
|
|
||||||
the terms of the Apache License, version 2.0.
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
# -*- mode: python; -*-
|
|
||||||
|
|
||||||
# This SConscript describes construction of buildinfo.cpp, which is independent of the
|
|
||||||
# build variant's target.
|
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
import buildscripts.utils
|
|
||||||
|
|
||||||
Import('env windows usev8 usesm')
|
|
||||||
|
|
||||||
def getSysInfo():
|
|
||||||
if windows:
|
|
||||||
return "windows " + str( sys.getwindowsversion() )
|
|
||||||
else:
|
|
||||||
return " ".join( os.uname() )
|
|
||||||
|
|
||||||
buildinfo_filename = '#build/buildinfo.cpp'
|
|
||||||
|
|
||||||
buildinfo_template = '''
|
|
||||||
#include <string>
|
|
||||||
#include <boost/version.hpp>
|
|
||||||
|
|
||||||
#include "mongo/util/version.h"
|
|
||||||
|
|
||||||
namespace mongo {
|
|
||||||
const char * gitVersion() { return "%(git_version)s"; }
|
|
||||||
const char * compiledJSEngine() { return "%(js_engine)s"; }
|
|
||||||
const char * allocator() { return "%(allocator)s"; }
|
|
||||||
const char * loaderFlags() { return "%(loader_flags)s"; }
|
|
||||||
const char * compilerFlags() { return "%(compiler_flags)s"; }
|
|
||||||
std::string sysInfo() { return "%(sys_info)s BOOST_LIB_VERSION=" BOOST_LIB_VERSION ; }
|
|
||||||
} // namespace mongo
|
|
||||||
'''
|
|
||||||
|
|
||||||
def generate_buildinfo(env, target, source, **kw):
|
|
||||||
git_version = buildscripts.utils.getGitVersion()
|
|
||||||
if len(env["MONGO_MODULES"]):
|
|
||||||
git_version += " modules: " + ", ".join(env["MONGO_MODULES"])
|
|
||||||
|
|
||||||
if usev8:
|
|
||||||
js_engine = "V8"
|
|
||||||
elif usesm:
|
|
||||||
js_engine = "SpiderMonkey"
|
|
||||||
else:
|
|
||||||
js_engine = "Unknown"
|
|
||||||
|
|
||||||
contents = str(source[0]) % dict(git_version=git_version,
|
|
||||||
js_engine=js_engine,
|
|
||||||
sys_info=getSysInfo(),
|
|
||||||
allocator=GetOption('allocator'),
|
|
||||||
loader_flags=env.subst('$LINKFLAGS $LDFLAGS',
|
|
||||||
source=source, target=target),
|
|
||||||
compiler_flags=env.subst('$CXXFLAGS $CCFLAGS $CFLAGS',
|
|
||||||
source=source, target=target))
|
|
||||||
out = open(str(target[0]), 'wb')
|
|
||||||
try:
|
|
||||||
out.write(contents)
|
|
||||||
finally:
|
|
||||||
out.close()
|
|
||||||
|
|
||||||
env.Command(buildinfo_filename, Value(buildinfo_template), generate_buildinfo)
|
|
||||||
env.AlwaysBuild(buildinfo_filename)
|
|
||||||
env.Install('$BUILD_DIR/mongo', buildinfo_filename)
|
|
||||||
env.Install('$BUILD_DIR/client_build/mongo', buildinfo_filename)
|
|
||||||
143
SConscript.smoke
143
SConscript.smoke
|
|
@ -1,143 +0,0 @@
|
||||||
# -*- mode: python -*-
|
|
||||||
#
|
|
||||||
# This SConscript file describes the build rules for smoke tests (scons smoke,
|
|
||||||
# e.g.)
|
|
||||||
|
|
||||||
import os
|
|
||||||
from buildscripts import utils
|
|
||||||
|
|
||||||
Import( "has_option env shellEnv testEnv" )
|
|
||||||
|
|
||||||
def add_exe( v ):
|
|
||||||
return "${PROGPREFIX}%s${PROGSUFFIX}" % v
|
|
||||||
|
|
||||||
smokeEnv = testEnv.Clone()
|
|
||||||
smokeEnv['ENV']['PATH']=os.environ['PATH']
|
|
||||||
|
|
||||||
# copy in any envrionment variables beginning with MONGO_; these
|
|
||||||
# are used by buildscripts/buildlogger.py
|
|
||||||
for name, value in os.environ.items():
|
|
||||||
if name.startswith('MONGO_'):
|
|
||||||
smokeEnv['ENV'][name] = value
|
|
||||||
|
|
||||||
smokeEnv.Alias( "dummySmokeSideEffect", [], [] )
|
|
||||||
|
|
||||||
smokeFlags = []
|
|
||||||
|
|
||||||
# Ugh. Frobbing the smokeFlags must precede using them to construct
|
|
||||||
# actions, I think.
|
|
||||||
if has_option( 'smokedbprefix'):
|
|
||||||
smokeFlags += ['--smoke-db-prefix', GetOption( 'smokedbprefix')]
|
|
||||||
|
|
||||||
if 'startMongodSmallOplog' in COMMAND_LINE_TARGETS:
|
|
||||||
smokeFlags += ["--small-oplog"]
|
|
||||||
|
|
||||||
if has_option('smokeauth'):
|
|
||||||
smokeFlags += ['--auth']
|
|
||||||
|
|
||||||
def addTest(name, deps, actions):
|
|
||||||
smokeEnv.Alias( name, deps, actions )
|
|
||||||
smokeEnv.AlwaysBuild( name )
|
|
||||||
# Prevent smoke tests from running in parallel
|
|
||||||
smokeEnv.SideEffect( "dummySmokeSideEffect", name )
|
|
||||||
|
|
||||||
def addSmoketest( name, deps, extraSmokeArgs=[] ):
|
|
||||||
# Convert from smoke to test, smokeJs to js, and foo to foo
|
|
||||||
target = name
|
|
||||||
if name.startswith("smoke"):
|
|
||||||
if name == "smoke":
|
|
||||||
target = File("test").path
|
|
||||||
else:
|
|
||||||
target = name[5].lower() + name[6:]
|
|
||||||
|
|
||||||
smokeArgs = smokeFlags + [target] + extraSmokeArgs
|
|
||||||
addTest(name, deps, utils.run_smoke_command(*smokeArgs))
|
|
||||||
|
|
||||||
def addSmokeSuite( name, suitefile, needMongod=False ):
|
|
||||||
# Add a smoketest target which invokes smoke.py with
|
|
||||||
# --from-file, and passes the named suitefile as the
|
|
||||||
# command line argument.
|
|
||||||
|
|
||||||
# resolve an initial # in the suitefile
|
|
||||||
suitefile = str(env.File(suitefile))
|
|
||||||
|
|
||||||
smoke_args = ['--mode', 'files', '--from-file', suitefile]
|
|
||||||
if not needMongod:
|
|
||||||
smoke_args.append('--dont-start-mongod')
|
|
||||||
addTest(name, [suitefile], utils.run_smoke_command(*smoke_args))
|
|
||||||
|
|
||||||
addSmoketest( "smoke", [ add_exe( "test" ), add_exe( "mongod" ), add_exe( "mongo" ) ] )
|
|
||||||
addSmoketest( "smokePerf", [ add_exe("perftest") ] )
|
|
||||||
addSmoketest( "smokeClient", [
|
|
||||||
add_exe('firstExample'),
|
|
||||||
add_exe('rsExample'),
|
|
||||||
add_exe('secondExample'),
|
|
||||||
add_exe('whereExample'),
|
|
||||||
add_exe('authTest'),
|
|
||||||
add_exe('httpClientTest'),
|
|
||||||
add_exe('bsondemo'),
|
|
||||||
add_exe('clientTest'),
|
|
||||||
] )
|
|
||||||
addSmoketest( "mongosTest", [ add_exe( 'mongos' ) ])
|
|
||||||
addSmokeSuite( "smokeCppUnittests", "$UNITTEST_LIST" )
|
|
||||||
addSmokeSuite( "smokeModuleTests", "$MODULETEST_LIST" )
|
|
||||||
|
|
||||||
# These tests require the mongo shell
|
|
||||||
if shellEnv is not None:
|
|
||||||
addSmoketest( "smokeJs", [add_exe("mongo"), add_exe("mongod")] )
|
|
||||||
addSmoketest( "smokeClone", [ add_exe("mongo"), add_exe("mongod") ] )
|
|
||||||
addSmoketest( "smokeRepl", [ add_exe("mongo"), add_exe("mongod"), add_exe("mongobridge") ] )
|
|
||||||
addSmoketest( "smokeReplSets", [ add_exe("mongo"), add_exe("mongod"), add_exe("mongobridge") ] )
|
|
||||||
addSmoketest( "smokeDur", [ add_exe( "mongo" ), add_exe( "mongod" ), add_exe('mongorestore') ] )
|
|
||||||
addSmoketest( "smokeDisk", [ add_exe( "mongo" ), add_exe( "mongod" ), add_exe( "mongodump" ), add_exe( "mongorestore" ) ] )
|
|
||||||
addSmoketest( "smokeAuth", [ add_exe( "mongo" ), add_exe( "mongod" ) ] )
|
|
||||||
addSmoketest( "smokeParallel", [ add_exe( "mongo" ), add_exe( "mongod" ) ] )
|
|
||||||
addSmoketest( "smokeSharding", [ add_exe("mongo"), add_exe("mongod"), add_exe("mongos"), add_exe('mongofiles') ] )
|
|
||||||
addSmoketest( "smokeJsPerf", [ add_exe("mongo"), add_exe("mongod") ] )
|
|
||||||
addSmoketest( "smokeJsSlowNightly", [add_exe("mongo"), add_exe("mongod"), add_exe("mongos") ])
|
|
||||||
addSmoketest( "smokeJsSlowWeekly", [add_exe("mongo"), add_exe("mongod"), add_exe("mongos") ])
|
|
||||||
addSmoketest( "smokeQuota", [ add_exe("mongo"), add_exe("mongod") ] )
|
|
||||||
addSmoketest( "smokeTool", [ add_exe( "mongo" ), add_exe("mongod"), add_exe("mongos"), "tools" ] )
|
|
||||||
addSmoketest( "smokeAggregation", [ add_exe( "mongo" ), add_exe( "mongod" ), add_exe( "mongos" ) ] )
|
|
||||||
addSmoketest( "smokeMultiVersion", [ add_exe( "mongo" ), add_exe( "mongod" ), add_exe( "mongos" ) ] )
|
|
||||||
addSmoketest( "smokeFailPoint", [ add_exe( "mongo" ), add_exe( "mongod" ), add_exe( "mongos" ) ] )
|
|
||||||
addSmoketest( "smokeSsl", [ add_exe("mongo"), add_exe("mongod"), add_exe("mongos") ], ['--use-ssl'] )
|
|
||||||
|
|
||||||
addSmoketest( "smokeFailingTests", [ add_exe( "mongo" ), add_exe( "mongod" ) ], ['--only-old-fails', '--continue-on-failure'] )
|
|
||||||
addSmoketest( "smokeResetFails", [ add_exe( "mongo" ), add_exe( "mongod" ) ], ['--reset-old-fails'] )
|
|
||||||
|
|
||||||
smokeEnv.Alias( "startMongodSmallOplog", [add_exe("mongod")], [] );
|
|
||||||
smokeEnv.AlwaysBuild( "startMongodSmallOplog" );
|
|
||||||
smokeEnv.SideEffect( "dummySmokeSideEffect", "startMongodSmallOplog" )
|
|
||||||
|
|
||||||
def addMongodReqTargets( env, target, source ):
|
|
||||||
mongodReqTargets = [ "smokeClient", "smokeJs" ]
|
|
||||||
for target in mongodReqTargets:
|
|
||||||
smokeEnv.Depends( target, "startMongod" )
|
|
||||||
smokeEnv.Depends( "smokeAll", target )
|
|
||||||
|
|
||||||
smokeEnv.Alias( "addMongodReqTargets", [], [addMongodReqTargets] )
|
|
||||||
smokeEnv.AlwaysBuild( "addMongodReqTargets" )
|
|
||||||
|
|
||||||
smokeEnv.Alias( "smokeAll", [ "smoke", "mongosTest", "smokeClone", "smokeRepl", "addMongodReqTargets", "smokeDisk", "smokeAuth", "smokeSharding", "smokeTool" ] )
|
|
||||||
smokeEnv.AlwaysBuild( "smokeAll" )
|
|
||||||
|
|
||||||
def addMongodReqNoJsTargets( env, target, source ):
|
|
||||||
mongodReqTargets = [ "smokeClient" ]
|
|
||||||
for target in mongodReqTargets:
|
|
||||||
smokeEnv.Depends( target, "startMongod" )
|
|
||||||
smokeEnv.Depends( "smokeAllNoJs", target )
|
|
||||||
|
|
||||||
smokeEnv.Alias( "addMongodReqNoJsTargets", [], [addMongodReqNoJsTargets] )
|
|
||||||
smokeEnv.AlwaysBuild( "addMongodReqNoJsTargets" )
|
|
||||||
|
|
||||||
smokeEnv.Alias( "smokeAllNoJs", [ "smoke", "mongosTest", "addMongodReqNoJsTargets" ] )
|
|
||||||
smokeEnv.AlwaysBuild( "smokeAllNoJs" )
|
|
||||||
|
|
||||||
def run_shell_tests(env, target, source):
|
|
||||||
from buildscripts import test_shell
|
|
||||||
test_shell.mongo_path = windows and "mongo.exe" or "mongo"
|
|
||||||
test_shell.run_tests()
|
|
||||||
|
|
||||||
env.Alias("test_shell", [], [run_shell_tests])
|
|
||||||
env.AlwaysBuild("test_shell")
|
|
||||||
1155
SConstruct
1155
SConstruct
File diff suppressed because it is too large
Load diff
|
|
@ -1,5 +0,0 @@
|
||||||
|
|
||||||
import os;
|
|
||||||
|
|
||||||
def findHacks( un ):
|
|
||||||
return None
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
import subprocess
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
from optparse import OptionParser
|
|
||||||
|
|
||||||
""" This script aggregates several tracefiles into one tracefile
|
|
||||||
All but the last argument are input tracefiles or .txt files which list tracefiles.
|
|
||||||
The last argument is the tracefile to which the output will be written
|
|
||||||
"""
|
|
||||||
def aggregate(inputs, output):
|
|
||||||
"""Aggregates the tracefiles given in inputs to a tracefile given by output"""
|
|
||||||
args = ['lcov']
|
|
||||||
|
|
||||||
for name in inputs:
|
|
||||||
args += ['-a', name]
|
|
||||||
|
|
||||||
args += ['-o', output]
|
|
||||||
|
|
||||||
print ' '.join(args)
|
|
||||||
|
|
||||||
return subprocess.call(args)
|
|
||||||
|
|
||||||
def getfilesize(path):
|
|
||||||
if not os.path.isfile(path):
|
|
||||||
return 0
|
|
||||||
return os.path.getsize(path)
|
|
||||||
|
|
||||||
def main ():
|
|
||||||
inputs = []
|
|
||||||
|
|
||||||
usage = "usage: %prog input1.info input2.info ... output.info"
|
|
||||||
parser = OptionParser(usage=usage)
|
|
||||||
|
|
||||||
(options, args) = parser.parse_args()
|
|
||||||
if len(args) < 2:
|
|
||||||
return "must supply input files"
|
|
||||||
|
|
||||||
for path in args[:-1]:
|
|
||||||
name, ext = os.path.splitext(path)
|
|
||||||
|
|
||||||
if ext == '.info':
|
|
||||||
if getfilesize(path) > 0:
|
|
||||||
inputs.append(path)
|
|
||||||
|
|
||||||
elif ext == '.txt':
|
|
||||||
inputs += [line.strip() for line in open(path)
|
|
||||||
if getfilesize(line.strip()) > 0]
|
|
||||||
else:
|
|
||||||
return "unrecognized file type"
|
|
||||||
|
|
||||||
return aggregate(inputs, args[-1])
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
sys.exit(main())
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
|
|
||||||
import utils
|
|
||||||
import os
|
|
||||||
import shutil
|
|
||||||
import sys
|
|
||||||
|
|
||||||
def go( boost_root ):
|
|
||||||
|
|
||||||
OUTPUT = "src/third_party/boost"
|
|
||||||
if os.path.exists( OUTPUT ):
|
|
||||||
shutil.rmtree( OUTPUT )
|
|
||||||
|
|
||||||
cmd = [ "bcp" , "--scan" , "--boost=%s" % boost_root ]
|
|
||||||
|
|
||||||
src = utils.getAllSourceFiles()
|
|
||||||
|
|
||||||
cmd += src
|
|
||||||
cmd.append( OUTPUT )
|
|
||||||
|
|
||||||
if not os.path.exists( OUTPUT ):
|
|
||||||
os.makedirs( OUTPUT )
|
|
||||||
|
|
||||||
res = utils.execsys( cmd )
|
|
||||||
|
|
||||||
out = open( OUTPUT + "/bcp-out.txt" , 'w' )
|
|
||||||
out.write( res[0] )
|
|
||||||
out.close()
|
|
||||||
|
|
||||||
out = open( OUTPUT + "/notes.txt" , 'w' )
|
|
||||||
out.write( "command: " + " ".join( cmd ) )
|
|
||||||
out.close()
|
|
||||||
|
|
||||||
print( res[1] )
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
if len(sys.argv) == 1:
|
|
||||||
print( "usage: python %s <boost root directory>" % sys.argv[0] )
|
|
||||||
sys.exit(1)
|
|
||||||
go( sys.argv[1] )
|
|
||||||
|
|
||||||
|
|
@ -1,75 +0,0 @@
|
||||||
#!/usr/bin/python
|
|
||||||
|
|
||||||
'''Script to attempt an isolated build of the C++ driver and its examples.
|
|
||||||
|
|
||||||
Working directory must be the repository root.
|
|
||||||
|
|
||||||
Usage:
|
|
||||||
|
|
||||||
./buildscripts/build_and_test_client.py <mongo client archive file> [optional scons arguments]
|
|
||||||
|
|
||||||
The client is built in a temporary directory, and the sample programs are run against a mongod
|
|
||||||
instance found in the current working directory. The temporary directory and its contents are
|
|
||||||
destroyed at the end of execution.
|
|
||||||
'''
|
|
||||||
|
|
||||||
import os
|
|
||||||
import shutil
|
|
||||||
import subprocess
|
|
||||||
import sys
|
|
||||||
import tempfile
|
|
||||||
import tarfile
|
|
||||||
import zipfile
|
|
||||||
|
|
||||||
import utils
|
|
||||||
|
|
||||||
def main(args):
|
|
||||||
archive_file = args[1]
|
|
||||||
scons_args = args[2:]
|
|
||||||
build_and_test(archive_file, scons_args)
|
|
||||||
|
|
||||||
def build_and_test(archive_name, scons_args):
|
|
||||||
work_dir = tempfile.mkdtemp()
|
|
||||||
try:
|
|
||||||
archive = open_archive(archive_name)
|
|
||||||
extracted_root = extract_archive(work_dir, archive)
|
|
||||||
run_scons(extracted_root, scons_args)
|
|
||||||
smoke_client(extracted_root)
|
|
||||||
finally:
|
|
||||||
shutil.rmtree(work_dir)
|
|
||||||
|
|
||||||
def open_tar(archive_name):
|
|
||||||
return tarfile.open(archive_name, 'r')
|
|
||||||
|
|
||||||
def open_zip(archive_name):
|
|
||||||
class ZipWrapper(zipfile.ZipFile):
|
|
||||||
def getnames(self):
|
|
||||||
return self.namelist()
|
|
||||||
return ZipWrapper(archive_name, 'r')
|
|
||||||
|
|
||||||
def open_archive(archive_name):
|
|
||||||
try:
|
|
||||||
return open_tar(archive_name)
|
|
||||||
except:
|
|
||||||
return open_zip(archive_name)
|
|
||||||
|
|
||||||
def extract_archive(work_dir, archive_file):
|
|
||||||
archive_file.extractall(path=work_dir)
|
|
||||||
return os.path.join(
|
|
||||||
work_dir,
|
|
||||||
os.path.dirname([n for n in archive_file.getnames() if n.endswith('SConstruct')][0])
|
|
||||||
)
|
|
||||||
|
|
||||||
def run_scons(extracted_root, scons_args):
|
|
||||||
rc = subprocess.call(['scons', '-C', extracted_root, ] + scons_args + ['clientTests'])
|
|
||||||
if rc is not 0:
|
|
||||||
sys.exit(rc)
|
|
||||||
|
|
||||||
def smoke_client(extracted_root):
|
|
||||||
rc = subprocess.call(utils.smoke_command("--test-path", extracted_root, "client"))
|
|
||||||
if rc is not 0:
|
|
||||||
sys.exit(rc)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main(sys.argv)
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
@echo off
|
|
||||||
|
|
||||||
cls
|
|
||||||
echo This script builds the boost libs that MongoDB requires on Windows.
|
|
||||||
echo We assume boost source is in machine's \boost directory.
|
|
||||||
echo You can get boost at www.boost.org.
|
|
||||||
echo .
|
|
||||||
echo Note: you will want boost v1.42 or higher with VS2010.
|
|
||||||
echo .
|
|
||||||
echo We assume you have bjam. To build bjam:
|
|
||||||
echo cd tools\jam\src
|
|
||||||
echo build.bat
|
|
||||||
echo .
|
|
||||||
|
|
||||||
cd \boost
|
|
||||||
echo bin\bjam --version
|
|
||||||
bin\bjam --version
|
|
||||||
|
|
||||||
echo .
|
|
||||||
echo .
|
|
||||||
echo .
|
|
||||||
echo About to build release libraries
|
|
||||||
pause
|
|
||||||
cls
|
|
||||||
bin\bjam variant=release runtime-link=static link=static --with-filesystem --with-thread --with-date_time --with-program_options --layout=versioned threading=multi toolset=msvc
|
|
||||||
echo .
|
|
||||||
echo .
|
|
||||||
echo .
|
|
||||||
echo About to try to move libs from /boost/stage/lib to /boost/lib/
|
|
||||||
pause
|
|
||||||
cls
|
|
||||||
rem bjam makes extra copies without the ver #; we kill those:
|
|
||||||
del stage\lib\*s.lib
|
|
||||||
move stage\lib\* lib\
|
|
||||||
|
|
||||||
echo .
|
|
||||||
echo .
|
|
||||||
echo .
|
|
||||||
echo About to build debug libraries
|
|
||||||
pause
|
|
||||||
cls
|
|
||||||
bin\bjam variant=debug --with-filesystem --with-thread --with-date_time --with-program_options --layout=versioned threading=multi toolset=msvc
|
|
||||||
|
|
||||||
echo .
|
|
||||||
echo .
|
|
||||||
echo .
|
|
||||||
echo About to try to move libs from /boost/stage/lib to /boost/lib/
|
|
||||||
pause
|
|
||||||
cls
|
|
||||||
rem bjam makes extra copies without the ver #; we kill those:
|
|
||||||
del stage\lib\*-gd.lib
|
|
||||||
move stage\lib\* lib\
|
|
||||||
|
|
||||||
echo Done - try running "dir \boost\lib\"
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
@echo off
|
|
||||||
|
|
||||||
rem 64 bit version
|
|
||||||
rem address-model=64
|
|
||||||
|
|
||||||
rem run
|
|
||||||
rem bin\bjam --clean
|
|
||||||
rem if you switch compilers etc.
|
|
||||||
|
|
||||||
cls
|
|
||||||
echo This script builds the (64 bit) boost libs that MongoDB requires on Windows.
|
|
||||||
echo We assume boost source is in machine's \boost directory.
|
|
||||||
echo You can get boost at www.boost.org.
|
|
||||||
echo .
|
|
||||||
echo Note: you will want boost v1.42 or higher with VS2010.
|
|
||||||
echo .
|
|
||||||
echo We assume you have bjam. To build bjam:
|
|
||||||
echo cd tools\jam\src
|
|
||||||
echo build.bat
|
|
||||||
echo .
|
|
||||||
|
|
||||||
cd \boost
|
|
||||||
echo bin\bjam --version
|
|
||||||
bin\bjam --version
|
|
||||||
|
|
||||||
echo .
|
|
||||||
echo .
|
|
||||||
echo .
|
|
||||||
echo About to build release libraries
|
|
||||||
pause
|
|
||||||
cls
|
|
||||||
bin\bjam --build-dir=c:\temp\boost64 address-model=64 variant=release runtime-link=static link=static --with-filesystem --with-thread --with-date_time --with-program_options --layout=versioned threading=multi toolset=msvc
|
|
||||||
echo .
|
|
||||||
echo .
|
|
||||||
echo .
|
|
||||||
echo About to try to move libs from /boost/stage/lib to /boost/lib/
|
|
||||||
pause
|
|
||||||
cls
|
|
||||||
rem bjam makes extra copies without the ver #; we kill those:
|
|
||||||
del stage\lib\*s.lib
|
|
||||||
move stage\lib\* lib\
|
|
||||||
|
|
||||||
echo .
|
|
||||||
echo .
|
|
||||||
echo .
|
|
||||||
echo About to build debug libraries
|
|
||||||
pause
|
|
||||||
cls
|
|
||||||
bin\bjam --build-dir=c:\temp\boost64 address-model=64 variant=debug --with-filesystem --with-thread --with-date_time --with-program_options --layout=versioned threading=multi toolset=msvc
|
|
||||||
|
|
||||||
echo .
|
|
||||||
echo .
|
|
||||||
echo .
|
|
||||||
echo About to try to move libs from /boost/stage/lib to /boost/lib/
|
|
||||||
pause
|
|
||||||
cls
|
|
||||||
rem bjam makes extra copies without the ver #; we kill those:
|
|
||||||
del stage\lib\*-gd.lib
|
|
||||||
move stage\lib\* lib\
|
|
||||||
|
|
||||||
echo Done - try running "dir \boost\lib\"
|
|
||||||
|
|
@ -1,480 +0,0 @@
|
||||||
"""
|
|
||||||
buildlogger.py
|
|
||||||
|
|
||||||
Wrap a command (specified on the command line invocation of buildlogger.py)
|
|
||||||
and send output in batches to the buildlogs web application via HTTP POST.
|
|
||||||
|
|
||||||
The script configures itself from environment variables:
|
|
||||||
|
|
||||||
required env vars:
|
|
||||||
MONGO_BUILDER_NAME (e.g. "Nightly Linux 64-bit")
|
|
||||||
MONGO_BUILD_NUMBER (an integer)
|
|
||||||
MONGO_TEST_FILENAME (not required when invoked with -g)
|
|
||||||
|
|
||||||
optional env vars:
|
|
||||||
MONGO_PHASE (e.g. "core", "slow nightly", etc)
|
|
||||||
MONGO_* (any other environment vars are passed to the web app)
|
|
||||||
BUILDLOGGER_CREDENTIALS (see below)
|
|
||||||
|
|
||||||
This script has two modes: a "test" mode, intended to wrap the invocation of
|
|
||||||
an individual test file, and a "global" mode, intended to wrap the mongod
|
|
||||||
instances that run throughout the duration of a mongo test phase (the logs
|
|
||||||
from "global" invocations are displayed interspersed with the logs of each
|
|
||||||
test, in order to let the buildlogs web app display the full output sensibly.)
|
|
||||||
|
|
||||||
If the BUILDLOGGER_CREDENTIALS environment variable is set, it should be a
|
|
||||||
path to a valid Python file containing "username" and "password" variables,
|
|
||||||
which should be valid credentials for authenticating to the buildlogger web
|
|
||||||
app. For example:
|
|
||||||
|
|
||||||
username = "hello"
|
|
||||||
password = "world"
|
|
||||||
|
|
||||||
If BUILDLOGGER_CREDENTIALS is a relative path, then the working directory
|
|
||||||
and the directories one, two, and three levels up, are searched, in that
|
|
||||||
order.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import functools
|
|
||||||
import os
|
|
||||||
import os.path
|
|
||||||
import re
|
|
||||||
import signal
|
|
||||||
import socket
|
|
||||||
import subprocess
|
|
||||||
import sys
|
|
||||||
import time
|
|
||||||
import traceback
|
|
||||||
import urllib2
|
|
||||||
import utils
|
|
||||||
|
|
||||||
# suppress deprecation warnings that happen when
|
|
||||||
# we import the 'buildbot.tac' file below
|
|
||||||
import warnings
|
|
||||||
warnings.simplefilter('ignore', DeprecationWarning)
|
|
||||||
|
|
||||||
try:
|
|
||||||
import json
|
|
||||||
except:
|
|
||||||
try:
|
|
||||||
import simplejson as json
|
|
||||||
except:
|
|
||||||
json = None
|
|
||||||
|
|
||||||
# try to load the shared secret from settings.py
|
|
||||||
# which will be one, two, or three directories up
|
|
||||||
# from this file's location
|
|
||||||
credentials_file = os.environ.get('BUILDLOGGER_CREDENTIALS', 'buildbot.tac')
|
|
||||||
credentials_loc, credentials_name = os.path.split(credentials_file)
|
|
||||||
if not credentials_loc:
|
|
||||||
here = os.path.abspath(os.path.dirname(__file__))
|
|
||||||
possible_paths = [
|
|
||||||
os.path.abspath(os.path.join(here, '..')),
|
|
||||||
os.path.abspath(os.path.join(here, '..', '..')),
|
|
||||||
os.path.abspath(os.path.join(here, '..', '..', '..')),
|
|
||||||
]
|
|
||||||
else:
|
|
||||||
possible_paths = [credentials_loc]
|
|
||||||
|
|
||||||
username, password = None, None
|
|
||||||
for path in possible_paths:
|
|
||||||
credentials_path = os.path.join(path, credentials_name)
|
|
||||||
if os.path.isfile(credentials_path):
|
|
||||||
credentials = {}
|
|
||||||
try:
|
|
||||||
execfile(credentials_path, credentials, credentials)
|
|
||||||
username = credentials.get('slavename', credentials.get('username'))
|
|
||||||
password = credentials.get('passwd', credentials.get('password'))
|
|
||||||
break
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
URL_ROOT = 'http://buildlogs.mongodb.org/'
|
|
||||||
TIMEOUT_SECONDS = 10
|
|
||||||
socket.setdefaulttimeout(TIMEOUT_SECONDS)
|
|
||||||
|
|
||||||
digest_handler = urllib2.HTTPDigestAuthHandler()
|
|
||||||
digest_handler.add_password(
|
|
||||||
realm='buildlogs',
|
|
||||||
uri=URL_ROOT,
|
|
||||||
user=username,
|
|
||||||
passwd=password)
|
|
||||||
|
|
||||||
# This version of HTTPErrorProcessor is copied from
|
|
||||||
# Python 2.7, and allows REST response codes (e.g.
|
|
||||||
# "201 Created") which are treated as errors by
|
|
||||||
# older versions.
|
|
||||||
class HTTPErrorProcessor(urllib2.HTTPErrorProcessor):
|
|
||||||
def http_response(self, request, response):
|
|
||||||
code, msg, hdrs = response.code, response.msg, response.info()
|
|
||||||
|
|
||||||
# According to RFC 2616, "2xx" code indicates that the client's
|
|
||||||
# request was successfully received, understood, and accepted.
|
|
||||||
if not (200 <= code < 300):
|
|
||||||
response = self.parent.error(
|
|
||||||
'http', request, response, code, msg, hdrs)
|
|
||||||
|
|
||||||
return response
|
|
||||||
|
|
||||||
url_opener = urllib2.build_opener(digest_handler, HTTPErrorProcessor())
|
|
||||||
|
|
||||||
def url(endpoint):
|
|
||||||
if not endpoint.endswith('/'):
|
|
||||||
endpoint = '%s/' % endpoint
|
|
||||||
|
|
||||||
return '%s/%s' % (URL_ROOT.rstrip('/'), endpoint)
|
|
||||||
|
|
||||||
def post(endpoint, data, headers=None):
|
|
||||||
data = json.dumps(data, encoding='utf-8')
|
|
||||||
|
|
||||||
headers = headers or {}
|
|
||||||
headers.update({'Content-Type': 'application/json; charset=utf-8'})
|
|
||||||
|
|
||||||
req = urllib2.Request(url=url(endpoint), data=data, headers=headers)
|
|
||||||
try:
|
|
||||||
response = url_opener.open(req)
|
|
||||||
except urllib2.URLError:
|
|
||||||
import traceback
|
|
||||||
traceback.print_exc(file=sys.stderr)
|
|
||||||
sys.stderr.flush()
|
|
||||||
# indicate that the request did not succeed
|
|
||||||
return None
|
|
||||||
|
|
||||||
response_headers = dict(response.info())
|
|
||||||
|
|
||||||
# eg "Content-Type: application/json; charset=utf-8"
|
|
||||||
content_type = response_headers.get('content-type')
|
|
||||||
match = re.match(r'(?P<mimetype>[^;]+).*(?:charset=(?P<charset>[^ ]+))?$', content_type)
|
|
||||||
if match and match.group('mimetype') == 'application/json':
|
|
||||||
encoding = match.group('charset') or 'utf-8'
|
|
||||||
return json.load(response, encoding=encoding)
|
|
||||||
|
|
||||||
return response.read()
|
|
||||||
|
|
||||||
def traceback_to_stderr(func):
|
|
||||||
"""
|
|
||||||
decorator which logs any exceptions encountered to stderr
|
|
||||||
and returns none.
|
|
||||||
"""
|
|
||||||
@functools.wraps(func)
|
|
||||||
def wrapper(*args, **kwargs):
|
|
||||||
try:
|
|
||||||
return func(*args, **kwargs)
|
|
||||||
except urllib2.HTTPError, err:
|
|
||||||
sys.stderr.write('error: HTTP code %d\n----\n' % err.code)
|
|
||||||
if hasattr(err, 'hdrs'):
|
|
||||||
for k, v in err.hdrs.items():
|
|
||||||
sys.stderr.write("%s: %s\n" % (k, v))
|
|
||||||
sys.stderr.write('\n')
|
|
||||||
sys.stderr.write(err.read())
|
|
||||||
sys.stderr.write('\n----\n')
|
|
||||||
sys.stderr.flush()
|
|
||||||
except:
|
|
||||||
sys.stderr.write('Traceback from buildlogger:\n')
|
|
||||||
traceback.print_exc(file=sys.stderr)
|
|
||||||
sys.stderr.flush()
|
|
||||||
return None
|
|
||||||
return wrapper
|
|
||||||
|
|
||||||
|
|
||||||
@traceback_to_stderr
|
|
||||||
def get_or_create_build(builder, buildnum, extra={}):
|
|
||||||
data = {'builder': builder, 'buildnum': buildnum}
|
|
||||||
data.update(extra)
|
|
||||||
response = post('build', data)
|
|
||||||
if response is None:
|
|
||||||
return None
|
|
||||||
return response['id']
|
|
||||||
|
|
||||||
@traceback_to_stderr
|
|
||||||
def create_test(build_id, test_filename, test_command, test_phase):
|
|
||||||
response = post('build/%s/test' % build_id, {
|
|
||||||
'test_filename': test_filename,
|
|
||||||
'command': test_command,
|
|
||||||
'phase': test_phase,
|
|
||||||
})
|
|
||||||
if response is None:
|
|
||||||
return None
|
|
||||||
return response['id']
|
|
||||||
|
|
||||||
@traceback_to_stderr
|
|
||||||
def append_test_logs(build_id, test_id, log_lines):
|
|
||||||
response = post('build/%s/test/%s' % (build_id, test_id), data=log_lines)
|
|
||||||
if response is None:
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
@traceback_to_stderr
|
|
||||||
def append_global_logs(build_id, log_lines):
|
|
||||||
"""
|
|
||||||
"global" logs are for the mongod(s) started by smoke.py
|
|
||||||
that last the duration of a test phase -- since there
|
|
||||||
may be output in here that is important but spans individual
|
|
||||||
tests, the buildlogs webapp handles these logs specially.
|
|
||||||
"""
|
|
||||||
response = post('build/%s' % build_id, data=log_lines)
|
|
||||||
if response is None:
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
@traceback_to_stderr
|
|
||||||
def finish_test(build_id, test_id, failed=False):
|
|
||||||
response = post('build/%s/test/%s' % (build_id, test_id), data=[], headers={
|
|
||||||
'X-Sendlogs-Test-Done': 'true',
|
|
||||||
'X-Sendlogs-Test-Failed': failed and 'true' or 'false',
|
|
||||||
})
|
|
||||||
if response is None:
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
def run_and_echo(command):
|
|
||||||
"""
|
|
||||||
this just calls the command, and returns its return code,
|
|
||||||
allowing stdout and stderr to work as normal. it is used
|
|
||||||
as a fallback when environment variables or python
|
|
||||||
dependencies cannot be configured, or when the logging
|
|
||||||
webapp is unavailable, etc
|
|
||||||
"""
|
|
||||||
proc = subprocess.Popen(command)
|
|
||||||
|
|
||||||
def handle_sigterm(signum, frame):
|
|
||||||
try:
|
|
||||||
proc.send_signal(signum)
|
|
||||||
except AttributeError:
|
|
||||||
os.kill(proc.pid, signum)
|
|
||||||
orig_handler = signal.signal(signal.SIGTERM, handle_sigterm)
|
|
||||||
|
|
||||||
proc.wait()
|
|
||||||
|
|
||||||
signal.signal(signal.SIGTERM, orig_handler)
|
|
||||||
return proc.returncode
|
|
||||||
|
|
||||||
class LogAppender(object):
|
|
||||||
def __init__(self, callback, args, send_after_lines=200, send_after_seconds=2):
|
|
||||||
self.callback = callback
|
|
||||||
self.callback_args = args
|
|
||||||
|
|
||||||
self.send_after_lines = send_after_lines
|
|
||||||
self.send_after_seconds = send_after_seconds
|
|
||||||
|
|
||||||
self.buf = []
|
|
||||||
self.retrybuf = []
|
|
||||||
self.last_sent = time.time()
|
|
||||||
|
|
||||||
def __call__(self, line):
|
|
||||||
self.buf.append((time.time(), line))
|
|
||||||
|
|
||||||
delay = time.time() - self.last_sent
|
|
||||||
if len(self.buf) >= self.send_after_lines or delay >= self.send_after_seconds:
|
|
||||||
self.submit()
|
|
||||||
|
|
||||||
# no return value is expected
|
|
||||||
|
|
||||||
def submit(self):
|
|
||||||
if len(self.buf) + len(self.retrybuf) == 0:
|
|
||||||
return True
|
|
||||||
|
|
||||||
args = list(self.callback_args)
|
|
||||||
args.append(list(self.buf) + self.retrybuf)
|
|
||||||
|
|
||||||
self.last_sent = time.time()
|
|
||||||
|
|
||||||
if self.callback(*args):
|
|
||||||
self.buf = []
|
|
||||||
self.retrybuf = []
|
|
||||||
return True
|
|
||||||
else:
|
|
||||||
self.retrybuf += self.buf
|
|
||||||
self.buf = []
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
def wrap_test(command):
|
|
||||||
"""
|
|
||||||
call the given command, intercept its stdout and stderr,
|
|
||||||
and send results in batches of 100 lines or 10s to the
|
|
||||||
buildlogger webapp
|
|
||||||
"""
|
|
||||||
|
|
||||||
# get builder name and build number from environment
|
|
||||||
builder = os.environ.get('MONGO_BUILDER_NAME')
|
|
||||||
buildnum = os.environ.get('MONGO_BUILD_NUMBER')
|
|
||||||
|
|
||||||
if builder is None or buildnum is None:
|
|
||||||
return run_and_echo(command)
|
|
||||||
|
|
||||||
try:
|
|
||||||
buildnum = int(buildnum)
|
|
||||||
except ValueError:
|
|
||||||
sys.stderr.write('buildlogger: build number ("%s") was not an int\n' % buildnum)
|
|
||||||
sys.stderr.flush()
|
|
||||||
return run_and_echo(command)
|
|
||||||
|
|
||||||
# test takes some extra info
|
|
||||||
phase = os.environ.get('MONGO_PHASE', 'unknown')
|
|
||||||
test_filename = os.environ.get('MONGO_TEST_FILENAME', 'unknown')
|
|
||||||
|
|
||||||
build_info = dict((k, v) for k, v in os.environ.items() if k.startswith('MONGO_'))
|
|
||||||
build_info.pop('MONGO_BUILDER_NAME', None)
|
|
||||||
build_info.pop('MONGO_BUILD_NUMBER', None)
|
|
||||||
build_info.pop('MONGO_PHASE', None)
|
|
||||||
build_info.pop('MONGO_TEST_FILENAME', None)
|
|
||||||
|
|
||||||
build_id = get_or_create_build(builder, buildnum, extra=build_info)
|
|
||||||
if not build_id:
|
|
||||||
return run_and_echo(command)
|
|
||||||
|
|
||||||
test_id = create_test(build_id, test_filename, ' '.join(command), phase)
|
|
||||||
if not test_id:
|
|
||||||
return run_and_echo(command)
|
|
||||||
|
|
||||||
# the peculiar formatting here matches what is printed by
|
|
||||||
# smoke.py when starting tests
|
|
||||||
output_url = '%s/build/%s/test/%s/' % (URL_ROOT.rstrip('/'), build_id, test_id)
|
|
||||||
sys.stdout.write(' (output suppressed; see %s)\n' % output_url)
|
|
||||||
sys.stdout.flush()
|
|
||||||
|
|
||||||
callback = LogAppender(callback=append_test_logs, args=(build_id, test_id))
|
|
||||||
returncode = loop_and_callback(command, callback)
|
|
||||||
failed = bool(returncode != 0)
|
|
||||||
|
|
||||||
# this will append any remaining unsubmitted logs, or
|
|
||||||
# return True if there are none left to submit
|
|
||||||
tries = 5
|
|
||||||
while not callback.submit() and tries > 0:
|
|
||||||
sys.stderr.write('failed to finish sending test logs, retrying in 1s\n')
|
|
||||||
sys.stderr.flush()
|
|
||||||
time.sleep(1)
|
|
||||||
tries -= 1
|
|
||||||
|
|
||||||
tries = 5
|
|
||||||
while not finish_test(build_id, test_id, failed) and tries > 5:
|
|
||||||
sys.stderr.write('failed to mark test finished, retrying in 1s\n')
|
|
||||||
sys.stderr.flush()
|
|
||||||
time.sleep(1)
|
|
||||||
tries -= 1
|
|
||||||
|
|
||||||
return returncode
|
|
||||||
|
|
||||||
def wrap_global(command):
|
|
||||||
"""
|
|
||||||
call the given command, intercept its stdout and stderr,
|
|
||||||
and send results in batches of 100 lines or 10s to the
|
|
||||||
buildlogger webapp. see :func:`append_global_logs` for the
|
|
||||||
difference between "global" and "test" log output.
|
|
||||||
"""
|
|
||||||
|
|
||||||
# get builder name and build number from environment
|
|
||||||
builder = os.environ.get('MONGO_BUILDER_NAME')
|
|
||||||
buildnum = os.environ.get('MONGO_BUILD_NUMBER')
|
|
||||||
|
|
||||||
if builder is None or buildnum is None:
|
|
||||||
return run_and_echo(command)
|
|
||||||
|
|
||||||
try:
|
|
||||||
buildnum = int(buildnum)
|
|
||||||
except ValueError:
|
|
||||||
sys.stderr.write('int(os.environ["MONGO_BUILD_NUMBER"]):\n')
|
|
||||||
sys.stderr.write(traceback.format_exc())
|
|
||||||
sys.stderr.flush()
|
|
||||||
return run_and_echo(command)
|
|
||||||
|
|
||||||
build_info = dict((k, v) for k, v in os.environ.items() if k.startswith('MONGO_'))
|
|
||||||
build_info.pop('MONGO_BUILDER_NAME', None)
|
|
||||||
build_info.pop('MONGO_BUILD_NUMBER', None)
|
|
||||||
|
|
||||||
build_id = get_or_create_build(builder, buildnum, extra=build_info)
|
|
||||||
if not build_id:
|
|
||||||
return run_and_echo(command)
|
|
||||||
|
|
||||||
callback = LogAppender(callback=append_global_logs, args=(build_id, ))
|
|
||||||
returncode = loop_and_callback(command, callback)
|
|
||||||
|
|
||||||
# this will append any remaining unsubmitted logs, or
|
|
||||||
# return True if there are none left to submit
|
|
||||||
tries = 5
|
|
||||||
while not callback.submit() and tries > 0:
|
|
||||||
sys.stderr.write('failed to finish sending global logs, retrying in 1s\n')
|
|
||||||
sys.stderr.flush()
|
|
||||||
time.sleep(1)
|
|
||||||
tries -= 1
|
|
||||||
|
|
||||||
return returncode
|
|
||||||
|
|
||||||
def loop_and_callback(command, callback):
|
|
||||||
"""
|
|
||||||
run the given command (a sequence of arguments, ordinarily
|
|
||||||
from sys.argv), and call the given callback with each line
|
|
||||||
of stdout or stderr encountered. after the command is finished,
|
|
||||||
callback is called once more with None instead of a string.
|
|
||||||
"""
|
|
||||||
proc = subprocess.Popen(
|
|
||||||
command,
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.STDOUT,
|
|
||||||
)
|
|
||||||
|
|
||||||
def handle_sigterm(signum, frame):
|
|
||||||
try:
|
|
||||||
proc.send_signal(signum)
|
|
||||||
except AttributeError:
|
|
||||||
os.kill(proc.pid, signum)
|
|
||||||
|
|
||||||
# register a handler to delegate SIGTERM
|
|
||||||
# to the child process
|
|
||||||
orig_handler = signal.signal(signal.SIGTERM, handle_sigterm)
|
|
||||||
|
|
||||||
while proc.poll() is None:
|
|
||||||
try:
|
|
||||||
line = proc.stdout.readline().strip('\r\n')
|
|
||||||
line = utils.unicode_dammit(line)
|
|
||||||
callback(line)
|
|
||||||
except IOError:
|
|
||||||
# if the signal handler is called while
|
|
||||||
# we're waiting for readline() to return,
|
|
||||||
# don't show a traceback
|
|
||||||
break
|
|
||||||
|
|
||||||
# There may be additional buffered output
|
|
||||||
for line in proc.stdout.readlines():
|
|
||||||
callback(line.strip('\r\n'))
|
|
||||||
|
|
||||||
# restore the original signal handler, if any
|
|
||||||
signal.signal(signal.SIGTERM, orig_handler)
|
|
||||||
return proc.returncode
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
# argv[0] is 'buildlogger.py'
|
|
||||||
del sys.argv[0]
|
|
||||||
|
|
||||||
if sys.argv[0] in ('-g', '--global'):
|
|
||||||
# then this is wrapping a "global" command, and should
|
|
||||||
# submit global logs to the build, not test logs to a
|
|
||||||
# test within the build
|
|
||||||
del sys.argv[0]
|
|
||||||
wrapper = wrap_global
|
|
||||||
|
|
||||||
else:
|
|
||||||
wrapper = wrap_test
|
|
||||||
|
|
||||||
# if we are missing credentials or the json module, then
|
|
||||||
# we can't use buildlogger; so just echo output, but also
|
|
||||||
# log why we can't work.
|
|
||||||
if json is None:
|
|
||||||
sys.stderr.write('buildlogger: could not import a json module\n')
|
|
||||||
sys.stderr.flush()
|
|
||||||
wrapper = run_and_echo
|
|
||||||
|
|
||||||
elif username is None or password is None:
|
|
||||||
sys.stderr.write('buildlogger: could not find or import %s for authentication\n' % credentials_file)
|
|
||||||
sys.stderr.flush()
|
|
||||||
wrapper = run_and_echo
|
|
||||||
|
|
||||||
# otherwise wrap a test command as normal; the
|
|
||||||
# wrapper functions return the return code of
|
|
||||||
# the wrapped command, so that should be our
|
|
||||||
# exit code as well.
|
|
||||||
sys.exit(wrapper(sys.argv))
|
|
||||||
|
|
||||||
|
|
@ -1,94 +0,0 @@
|
||||||
|
|
||||||
import sys
|
|
||||||
import os, os.path
|
|
||||||
import utils
|
|
||||||
import time
|
|
||||||
from optparse import OptionParser
|
|
||||||
|
|
||||||
# set cwd to the root mongo dir, one level up from this
|
|
||||||
# file's location (if we're not already running from there)
|
|
||||||
cwd = os.getcwd()
|
|
||||||
if os.path.basename(cwd) == 'buildscripts':
|
|
||||||
cwd = os.path.dirname(cwd)
|
|
||||||
|
|
||||||
print( "cwd [" + cwd + "]" )
|
|
||||||
|
|
||||||
def shouldKill( c ):
|
|
||||||
|
|
||||||
if "smoke.py" in c:
|
|
||||||
return False
|
|
||||||
|
|
||||||
if "emr.py" in c:
|
|
||||||
return False
|
|
||||||
|
|
||||||
if "java" in c:
|
|
||||||
return False
|
|
||||||
|
|
||||||
if c.find( cwd ) >= 0:
|
|
||||||
return True
|
|
||||||
|
|
||||||
if ( c.find( "buildbot" ) >= 0 or c.find( "slave" ) ) and c.find( "/mongo/" ) >= 0:
|
|
||||||
return True
|
|
||||||
|
|
||||||
if c.find( "xml-data/build-dir" ) >= 0: # for bamboo
|
|
||||||
return True
|
|
||||||
|
|
||||||
return False
|
|
||||||
|
|
||||||
def killprocs( signal="" ):
|
|
||||||
|
|
||||||
killed = 0
|
|
||||||
|
|
||||||
if sys.platform == 'win32':
|
|
||||||
return killed
|
|
||||||
|
|
||||||
l = utils.getprocesslist()
|
|
||||||
print( "num procs:" + str( len( l ) ) )
|
|
||||||
if len(l) == 0:
|
|
||||||
print( "no procs" )
|
|
||||||
try:
|
|
||||||
print( execsys( "/sbin/ifconfig -a" ) )
|
|
||||||
except Exception,e:
|
|
||||||
print( "can't get interfaces" + str( e ) )
|
|
||||||
|
|
||||||
for x in l:
|
|
||||||
x = x.lstrip()
|
|
||||||
if not shouldKill( x ):
|
|
||||||
continue
|
|
||||||
|
|
||||||
pid = x.split( " " )[0]
|
|
||||||
print( "killing: " + x )
|
|
||||||
utils.execsys( "/bin/kill " + signal + " " + pid )
|
|
||||||
killed = killed + 1
|
|
||||||
|
|
||||||
return killed
|
|
||||||
|
|
||||||
|
|
||||||
def cleanup( root , nokill ):
|
|
||||||
|
|
||||||
if nokill:
|
|
||||||
print "nokill requested, not killing anybody"
|
|
||||||
else:
|
|
||||||
if killprocs() > 0:
|
|
||||||
time.sleep(3)
|
|
||||||
killprocs("-9")
|
|
||||||
|
|
||||||
# delete all regular files, directories can stay
|
|
||||||
# NOTE: if we delete directories later, we can't delete diskfulltest
|
|
||||||
for ( dirpath , dirnames , filenames ) in os.walk( root , topdown=False ):
|
|
||||||
for x in filenames:
|
|
||||||
foo = dirpath + "/" + x
|
|
||||||
print( "removing: " + foo )
|
|
||||||
os.remove( foo )
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
parser = OptionParser(usage="read the script")
|
|
||||||
parser.add_option("--nokill", dest='nokill', default=False, action='store_true')
|
|
||||||
(options, args) = parser.parse_args()
|
|
||||||
|
|
||||||
root = "/data/db/"
|
|
||||||
if len(args) > 0:
|
|
||||||
root = args[0]
|
|
||||||
|
|
||||||
cleanup( root , options.nokill )
|
|
||||||
3361
buildscripts/cpplint.py
vendored
3361
buildscripts/cpplint.py
vendored
File diff suppressed because it is too large
Load diff
|
|
@ -1,120 +0,0 @@
|
||||||
"""Build the C++ client docs and the MongoDB server docs.
|
|
||||||
"""
|
|
||||||
|
|
||||||
from __future__ import with_statement
|
|
||||||
import os
|
|
||||||
import shutil
|
|
||||||
import socket
|
|
||||||
import subprocess
|
|
||||||
import time
|
|
||||||
import urllib2
|
|
||||||
|
|
||||||
import markdown
|
|
||||||
|
|
||||||
|
|
||||||
def clean_dir(dir):
|
|
||||||
try:
|
|
||||||
shutil.rmtree(dir)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
os.makedirs(dir)
|
|
||||||
|
|
||||||
|
|
||||||
def convert_dir(source, dest):
|
|
||||||
clean_dir(dest)
|
|
||||||
|
|
||||||
for x in os.listdir(source + "/"):
|
|
||||||
if not x.endswith(".md"):
|
|
||||||
continue
|
|
||||||
|
|
||||||
with open("%s/%s" % (source, x)) as f:
|
|
||||||
raw = f.read()
|
|
||||||
|
|
||||||
html = markdown.markdown(raw)
|
|
||||||
print(x)
|
|
||||||
|
|
||||||
with open("%s/%s" % (dest, x.replace(".md", ".html")), 'w') as o:
|
|
||||||
o.write(html)
|
|
||||||
|
|
||||||
|
|
||||||
def check_mongo():
|
|
||||||
sock = socket.socket()
|
|
||||||
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
|
|
||||||
sock.settimeout(1)
|
|
||||||
sock.connect(("localhost", 31999))
|
|
||||||
sock.close()
|
|
||||||
|
|
||||||
def did_mongod_start(timeout=20):
|
|
||||||
while timeout > 0:
|
|
||||||
time.sleep(1)
|
|
||||||
try:
|
|
||||||
check_mongo()
|
|
||||||
return True
|
|
||||||
except Exception,e:
|
|
||||||
print e
|
|
||||||
timeout = timeout - 1
|
|
||||||
return False
|
|
||||||
|
|
||||||
def stop(proc):
|
|
||||||
try:
|
|
||||||
proc.terminate()
|
|
||||||
except AttributeError:
|
|
||||||
os.kill(proc.pid, 15)
|
|
||||||
|
|
||||||
def commands_list(out):
|
|
||||||
clean_dir("dummy_data_dir")
|
|
||||||
with open("/dev/null") as null:
|
|
||||||
try:
|
|
||||||
p = subprocess.Popen(["./mongod", "--dbpath", "dummy_data_dir",
|
|
||||||
"--port", "31999", "--rest"], stdout=null, stderr=null)
|
|
||||||
except:
|
|
||||||
print "No mongod? Skipping..."
|
|
||||||
return
|
|
||||||
if not did_mongod_start():
|
|
||||||
print "Slow mongod? Skipping..."
|
|
||||||
stop(p)
|
|
||||||
return
|
|
||||||
print "Started mongod"
|
|
||||||
|
|
||||||
with open(out, "w") as f:
|
|
||||||
f.write("<base href='http://localhost:28017'/>")
|
|
||||||
f.write(urllib2.urlopen("http://localhost:32999/_commands").read())
|
|
||||||
|
|
||||||
print "Stopping mongod"
|
|
||||||
stop(p)
|
|
||||||
|
|
||||||
def gen_cplusplus(dir):
|
|
||||||
clean_dir(dir)
|
|
||||||
clean_dir("docs/doxygen")
|
|
||||||
|
|
||||||
# Too noisy...
|
|
||||||
with open("/dev/null") as null:
|
|
||||||
subprocess.call(["doxygen", "doxygenConfig"], stdout=null, stderr=null)
|
|
||||||
|
|
||||||
os.rename("docs/doxygen/html", dir)
|
|
||||||
|
|
||||||
|
|
||||||
def version():
|
|
||||||
"""Get the server version from doxygenConfig.
|
|
||||||
"""
|
|
||||||
with open("doxygenConfig") as f:
|
|
||||||
for line in f.readlines():
|
|
||||||
if line.startswith("PROJECT_NUMBER"):
|
|
||||||
return line.split("=")[1].strip()
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
v = version()
|
|
||||||
print("Generating server docs in docs/html/internal/%s" % v)
|
|
||||||
convert_dir("docs", "docs/html/internal/%s" % v)
|
|
||||||
print("Generating commands list")
|
|
||||||
commands_list("docs/html/internal/%s/commands.html" % v)
|
|
||||||
shutil.rmtree("dummy_data_dir")
|
|
||||||
print("Generating C++ docs in docs/html/cplusplus/%s" % v)
|
|
||||||
gen_cplusplus("docs/html/cplusplus/%s" % v)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,107 +0,0 @@
|
||||||
// FileLock.java
|
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.concurrent.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* "locks" a resource by using the file system as storage
|
|
||||||
* file has 1 line
|
|
||||||
* <incarnation> <last ping time in millis>
|
|
||||||
*/
|
|
||||||
public class FileLock {
|
|
||||||
|
|
||||||
public FileLock( String logicalName )
|
|
||||||
throws IOException {
|
|
||||||
|
|
||||||
_file = new File( "/tmp/java-fileLock-" + logicalName );
|
|
||||||
_incarnation = "xxx" + Math.random() + "yyy";
|
|
||||||
|
|
||||||
if ( ! _file.exists() ) {
|
|
||||||
FileOutputStream fout = new FileOutputStream( _file );
|
|
||||||
fout.write( "\n".getBytes() );
|
|
||||||
fout.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* takes lock
|
|
||||||
* if someone else has it, blocks until the other one finishes
|
|
||||||
*/
|
|
||||||
public void lock()
|
|
||||||
throws IOException {
|
|
||||||
if ( _lock != null )
|
|
||||||
throw new IllegalStateException( "can't lock when you're locked" );
|
|
||||||
|
|
||||||
try {
|
|
||||||
_semaphore.acquire();
|
|
||||||
}
|
|
||||||
catch ( InterruptedException ie ) {
|
|
||||||
throw new RuntimeException( "sad" , ie );
|
|
||||||
}
|
|
||||||
|
|
||||||
_raf = new RandomAccessFile( _file , "rw" );
|
|
||||||
_lock = _raf.getChannel().lock();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void unlock()
|
|
||||||
throws IOException {
|
|
||||||
|
|
||||||
if ( _lock == null )
|
|
||||||
throw new IllegalStateException( "can't unlock when you're not locked" );
|
|
||||||
|
|
||||||
_lock.release();
|
|
||||||
_semaphore.release();
|
|
||||||
|
|
||||||
_locked = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
final File _file;
|
|
||||||
final String _incarnation;
|
|
||||||
|
|
||||||
private RandomAccessFile _raf;
|
|
||||||
private java.nio.channels.FileLock _lock;
|
|
||||||
|
|
||||||
private boolean _locked;
|
|
||||||
|
|
||||||
private static Semaphore _semaphore = new Semaphore(1);
|
|
||||||
|
|
||||||
|
|
||||||
public static void main( final String[] args )
|
|
||||||
throws Exception {
|
|
||||||
|
|
||||||
List<Thread> threads = new ArrayList<Thread>();
|
|
||||||
|
|
||||||
for ( int i=0; i<3; i++ ) {
|
|
||||||
|
|
||||||
threads.add( new Thread() {
|
|
||||||
public void run() {
|
|
||||||
try {
|
|
||||||
FileLock lock = new FileLock( args[0] );
|
|
||||||
|
|
||||||
long start = System.currentTimeMillis();
|
|
||||||
|
|
||||||
lock.lock();
|
|
||||||
System.out.println( "time to lock:\t" + (System.currentTimeMillis()-start) );
|
|
||||||
Thread.sleep( Integer.parseInt( args[1] ) );
|
|
||||||
lock.unlock();
|
|
||||||
System.out.println( "total time:\t" + (System.currentTimeMillis()-start) );
|
|
||||||
}
|
|
||||||
catch ( Exception e ) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
}
|
|
||||||
|
|
||||||
for ( Thread t : threads ) {
|
|
||||||
t.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
for ( Thread t : threads ) {
|
|
||||||
t.join();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,156 +0,0 @@
|
||||||
// IOUtil.java
|
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
import java.net.*;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
public class IOUtil {
|
|
||||||
|
|
||||||
public static String urlFileName( String url ) {
|
|
||||||
int idx = url.lastIndexOf( "/" );
|
|
||||||
if ( idx < 0 )
|
|
||||||
return url;
|
|
||||||
return url.substring( idx + 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static long pipe( InputStream in , OutputStream out )
|
|
||||||
throws IOException {
|
|
||||||
|
|
||||||
long bytes = 0;
|
|
||||||
|
|
||||||
byte[] buf = new byte[2048];
|
|
||||||
|
|
||||||
while ( true ) {
|
|
||||||
int x = in.read( buf );
|
|
||||||
if ( x < 0 )
|
|
||||||
break;
|
|
||||||
|
|
||||||
bytes += x;
|
|
||||||
out.write( buf , 0 , x );
|
|
||||||
}
|
|
||||||
|
|
||||||
return bytes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class PipingThread extends Thread {
|
|
||||||
public PipingThread( InputStream in , OutputStream out ) {
|
|
||||||
_in = in;
|
|
||||||
_out = out;
|
|
||||||
|
|
||||||
_wrote = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void run() {
|
|
||||||
try {
|
|
||||||
_wrote = pipe( _in , _out );
|
|
||||||
}
|
|
||||||
catch ( IOException ioe ) {
|
|
||||||
ioe.printStackTrace();
|
|
||||||
_wrote = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public long wrote() {
|
|
||||||
return _wrote;
|
|
||||||
}
|
|
||||||
|
|
||||||
long _wrote;
|
|
||||||
|
|
||||||
final InputStream _in;
|
|
||||||
final OutputStream _out;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String readStringFully( InputStream in )
|
|
||||||
throws IOException {
|
|
||||||
|
|
||||||
ByteArrayOutputStream bout = new ByteArrayOutputStream();
|
|
||||||
pipe( in , bout );
|
|
||||||
return new String( bout.toByteArray() , "UTF8" );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Map<String,Object> readPythonSettings( File file )
|
|
||||||
throws IOException {
|
|
||||||
|
|
||||||
String all = readStringFully( new FileInputStream( file ) );
|
|
||||||
|
|
||||||
Map<String,Object> map = new TreeMap<String,Object>();
|
|
||||||
|
|
||||||
for ( String line : all.split( "\n" ) ) {
|
|
||||||
line = line.trim();
|
|
||||||
if ( line.length() == 0 )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
String[] pcs = line.split( "=" );
|
|
||||||
if ( pcs.length != 2 )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
String name = pcs[0].trim();
|
|
||||||
String value = pcs[1].trim();
|
|
||||||
|
|
||||||
if ( value.startsWith( "\"" ) ) {
|
|
||||||
map.put( name , value.substring( 1 , value.length() - 1 ) );
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
map.put( name , Long.parseLong( value ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String[] runCommand( String cmd , File dir )
|
|
||||||
throws IOException {
|
|
||||||
|
|
||||||
Process p = Runtime.getRuntime().exec( cmd.split( " +" ) , new String[]{} , dir );
|
|
||||||
String[] results = new String[]{ IOUtil.readStringFully( p.getInputStream() ) , IOUtil.readStringFully( p.getErrorStream() ) };
|
|
||||||
try {
|
|
||||||
if ( p.waitFor() != 0 )
|
|
||||||
throw new RuntimeException( "command failed [" + cmd + "]\n" + results[0] + "\n" + results[1] );
|
|
||||||
}
|
|
||||||
catch ( InterruptedException ie ) {
|
|
||||||
throw new RuntimeException( "uh oh" );
|
|
||||||
}
|
|
||||||
return results;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static void download( String http , File localDir )
|
|
||||||
throws IOException {
|
|
||||||
|
|
||||||
File f = localDir;
|
|
||||||
f.mkdirs();
|
|
||||||
|
|
||||||
f = new File( f.toString() + File.separator + urlFileName( http ) );
|
|
||||||
|
|
||||||
System.out.println( "downloading\n\t" + http + "\n\t" + f );
|
|
||||||
|
|
||||||
if ( f.exists() ) {
|
|
||||||
System.out.println( "\t already exists" );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
URL url = new URL( http );
|
|
||||||
|
|
||||||
InputStream in = url.openConnection().getInputStream();
|
|
||||||
OutputStream out = new FileOutputStream( f );
|
|
||||||
|
|
||||||
pipe( in , out );
|
|
||||||
|
|
||||||
out.close();
|
|
||||||
in.close();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main( String[] args )
|
|
||||||
throws Exception {
|
|
||||||
|
|
||||||
|
|
||||||
byte[] data = new byte[]{ 'e' , 'r' , 'h' , 0 };
|
|
||||||
System.out.write( data );
|
|
||||||
System.out.println( "yo" );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Manifest-Version: 1.0
|
|
||||||
Main-Class: emr
|
|
||||||
|
|
@ -1,380 +0,0 @@
|
||||||
// emr.java
|
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
import java.util.*;
|
|
||||||
import java.net.*;
|
|
||||||
|
|
||||||
import org.apache.hadoop.conf.*;
|
|
||||||
import org.apache.hadoop.io.*;
|
|
||||||
import org.apache.hadoop.mapred.*;
|
|
||||||
import org.apache.hadoop.fs.*;
|
|
||||||
|
|
||||||
|
|
||||||
public class emr {
|
|
||||||
|
|
||||||
static class MongoSuite {
|
|
||||||
String mongo;
|
|
||||||
String code;
|
|
||||||
String workingDir;
|
|
||||||
|
|
||||||
String suite;
|
|
||||||
|
|
||||||
void copy( MongoSuite c ) {
|
|
||||||
mongo = c.mongo;
|
|
||||||
code = c.code;
|
|
||||||
workingDir = c.workingDir;
|
|
||||||
|
|
||||||
suite = c.suite;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void downloadTo( File localDir )
|
|
||||||
throws IOException {
|
|
||||||
IOUtil.download( mongo , localDir );
|
|
||||||
IOUtil.download( code , localDir );
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean runTest()
|
|
||||||
throws IOException {
|
|
||||||
|
|
||||||
// mkdir
|
|
||||||
File dir = new File( workingDir , suite );
|
|
||||||
dir.mkdirs();
|
|
||||||
|
|
||||||
// download
|
|
||||||
System.out.println( "going to download" );
|
|
||||||
downloadTo( dir );
|
|
||||||
|
|
||||||
|
|
||||||
// explode
|
|
||||||
System.out.println( "going to explode" );
|
|
||||||
IOUtil.runCommand( "tar zxvf " + IOUtil.urlFileName( code ) , dir );
|
|
||||||
String[] res = IOUtil.runCommand( "tar zxvf " + IOUtil.urlFileName( mongo ) , dir );
|
|
||||||
for ( String x : res[0].split( "\n" ) ) {
|
|
||||||
if ( x.indexOf( "/bin/" ) < 0 )
|
|
||||||
continue;
|
|
||||||
File f = new File( dir.toString() , x );
|
|
||||||
if ( ! f.renameTo( new File( dir , IOUtil.urlFileName( x ) ) ) )
|
|
||||||
throw new RuntimeException( "rename failed" );
|
|
||||||
}
|
|
||||||
|
|
||||||
List<String> cmd = new ArrayList<String>();
|
|
||||||
cmd.add( "/usr/bin/python" );
|
|
||||||
cmd.add( "buildscripts/smoke.py" );
|
|
||||||
|
|
||||||
File log_config = new File( dir , "log_config.py" );
|
|
||||||
System.out.println( "log_config: " + log_config.exists() );
|
|
||||||
if ( log_config.exists() ) {
|
|
||||||
|
|
||||||
java.util.Map<String,Object> properties = IOUtil.readPythonSettings( log_config );
|
|
||||||
|
|
||||||
cmd.add( "--buildlogger-builder" );
|
|
||||||
cmd.add( properties.get( "name" ).toString() );
|
|
||||||
|
|
||||||
cmd.add( "--buildlogger-buildnum" );
|
|
||||||
cmd.add( properties.get( "number" ).toString() );
|
|
||||||
|
|
||||||
cmd.add( "--buildlogger-credentials" );
|
|
||||||
cmd.add( "log_config.py" );
|
|
||||||
|
|
||||||
cmd.add( "--buildlogger-phase" );
|
|
||||||
{
|
|
||||||
int idx = suite.lastIndexOf( "/" );
|
|
||||||
if ( idx < 0 )
|
|
||||||
cmd.add( suite );
|
|
||||||
else
|
|
||||||
cmd.add( suite.substring( 0 , idx ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd.add( suite );
|
|
||||||
|
|
||||||
System.out.println( cmd );
|
|
||||||
|
|
||||||
Process p = Runtime.getRuntime().exec( cmd.toArray( new String[cmd.size()] ) , new String[]{} , dir );
|
|
||||||
|
|
||||||
List<Thread> threads = new ArrayList<Thread>();
|
|
||||||
threads.add( new IOUtil.PipingThread( p.getInputStream() , System.out ) );
|
|
||||||
threads.add( new IOUtil.PipingThread( p.getErrorStream() , System.out ) );
|
|
||||||
|
|
||||||
for ( Thread t : threads )
|
|
||||||
t.start();
|
|
||||||
|
|
||||||
try {
|
|
||||||
for ( Thread t : threads ) {
|
|
||||||
t.join();
|
|
||||||
}
|
|
||||||
int rc = p.waitFor();
|
|
||||||
return rc == 0;
|
|
||||||
}
|
|
||||||
catch ( InterruptedException ie ) {
|
|
||||||
ie.printStackTrace();
|
|
||||||
throw new RuntimeException( "sad" , ie );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void readFields( DataInput in )
|
|
||||||
throws IOException {
|
|
||||||
mongo = in.readUTF();
|
|
||||||
code = in.readUTF();
|
|
||||||
workingDir = in.readUTF();
|
|
||||||
|
|
||||||
suite = in.readUTF();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void write( final DataOutput out )
|
|
||||||
throws IOException {
|
|
||||||
out.writeUTF( mongo );
|
|
||||||
out.writeUTF( code );
|
|
||||||
out.writeUTF( workingDir );
|
|
||||||
|
|
||||||
out.writeUTF( suite );
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
|
||||||
return "mongo: " + mongo + " code: " + code + " suite: " + suite + " workingDir: " + workingDir;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Map implements Mapper<Text, MongoSuite, Text, IntWritable> {
|
|
||||||
|
|
||||||
public void map( Text key, MongoSuite value, OutputCollector<Text,IntWritable> output, Reporter reporter )
|
|
||||||
throws IOException {
|
|
||||||
|
|
||||||
FileLock lock = new FileLock( "mapper" );
|
|
||||||
try {
|
|
||||||
lock.lock();
|
|
||||||
|
|
||||||
System.out.println( "key: " + key );
|
|
||||||
System.out.println( "value: " + value );
|
|
||||||
|
|
||||||
long start = System.currentTimeMillis();
|
|
||||||
boolean passed = value.runTest();
|
|
||||||
long end = System.currentTimeMillis();
|
|
||||||
|
|
||||||
output.collect( new Text( passed ? "passed" : "failed" ) , new IntWritable( 1 ) );
|
|
||||||
output.collect( new Text( key.toString() + "-time-seconds" ) , new IntWritable( (int)((end-start)/(1000)) ) );
|
|
||||||
output.collect( new Text( key.toString() + "-passed" ) , new IntWritable( passed ? 1 : 0 ) );
|
|
||||||
|
|
||||||
String ip = IOUtil.readStringFully( new URL( "http://myip.10gen.com/" ).openConnection().getInputStream() );
|
|
||||||
ip = ip.substring( ip.indexOf( ":" ) + 1 ).trim();
|
|
||||||
output.collect( new Text( ip ) , new IntWritable(1) );
|
|
||||||
}
|
|
||||||
catch ( RuntimeException re ) {
|
|
||||||
re.printStackTrace();
|
|
||||||
throw re;
|
|
||||||
}
|
|
||||||
catch ( IOException ioe ) {
|
|
||||||
ioe.printStackTrace();
|
|
||||||
throw ioe;
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
lock.unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void configure(JobConf job) {}
|
|
||||||
public void close(){}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Reduce implements Reducer<Text, IntWritable, Text, IntWritable> {
|
|
||||||
|
|
||||||
public void reduce( Text key, Iterator<IntWritable> values, OutputCollector<Text,IntWritable> output , Reporter reporter )
|
|
||||||
throws IOException {
|
|
||||||
|
|
||||||
int sum = 0;
|
|
||||||
while ( values.hasNext() ) {
|
|
||||||
sum += values.next().get();
|
|
||||||
}
|
|
||||||
output.collect( key , new IntWritable( sum ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
public void configure(JobConf job) {}
|
|
||||||
public void close(){}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class MySplit implements InputSplit , Writable {
|
|
||||||
|
|
||||||
public MySplit(){
|
|
||||||
}
|
|
||||||
|
|
||||||
MySplit( MongoSuite config , int length ) {
|
|
||||||
_config = config;
|
|
||||||
_length = length;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getLength() {
|
|
||||||
return _length;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String[] getLocations() {
|
|
||||||
return new String[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
public void readFields( DataInput in )
|
|
||||||
throws IOException {
|
|
||||||
_config = new MongoSuite();
|
|
||||||
_config.readFields( in );
|
|
||||||
_length = in.readInt();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void write( final DataOutput out )
|
|
||||||
throws IOException {
|
|
||||||
_config.write( out );
|
|
||||||
out.writeInt( _length );
|
|
||||||
}
|
|
||||||
|
|
||||||
MongoSuite _config;
|
|
||||||
int _length;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class InputMagic implements InputFormat<Text,MongoSuite> {
|
|
||||||
|
|
||||||
public RecordReader<Text,MongoSuite> getRecordReader( InputSplit split, JobConf job , Reporter reporter ){
|
|
||||||
final MySplit s = (MySplit)split;
|
|
||||||
return new RecordReader<Text,MongoSuite>() {
|
|
||||||
|
|
||||||
public void close(){}
|
|
||||||
|
|
||||||
public Text createKey() {
|
|
||||||
return new Text();
|
|
||||||
}
|
|
||||||
|
|
||||||
public MongoSuite createValue() {
|
|
||||||
return new MongoSuite();
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getPos() {
|
|
||||||
return _seen ? 1 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getProgress() {
|
|
||||||
return getPos();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean next( Text key , MongoSuite value ) {
|
|
||||||
key.set( s._config.suite );
|
|
||||||
value.copy( s._config );
|
|
||||||
|
|
||||||
|
|
||||||
boolean x = _seen;
|
|
||||||
_seen = true;
|
|
||||||
return !x;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean _seen = false;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public InputSplit[] getSplits( JobConf job , int numSplits ){
|
|
||||||
String[] pcs = job.get( "suites" ).split(",");
|
|
||||||
InputSplit[] splits = new InputSplit[pcs.length];
|
|
||||||
for ( int i=0; i<splits.length; i++ ) {
|
|
||||||
MongoSuite c = new MongoSuite();
|
|
||||||
c.suite = pcs[i];
|
|
||||||
|
|
||||||
c.mongo = job.get( "mongo" );
|
|
||||||
c.code = job.get( "code" );
|
|
||||||
c.workingDir = job.get( "workingDir" );
|
|
||||||
|
|
||||||
splits[i] = new MySplit( c , 100 /* XXX */);
|
|
||||||
}
|
|
||||||
return splits;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void validateInput(JobConf job){}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* args
|
|
||||||
* mongo tgz
|
|
||||||
* code tgz
|
|
||||||
* output path
|
|
||||||
* tests to run ?
|
|
||||||
*/
|
|
||||||
|
|
||||||
public static void main( String[] args ) throws Exception{
|
|
||||||
|
|
||||||
JobConf conf = new JobConf();
|
|
||||||
conf.setJarByClass(emr.class);
|
|
||||||
|
|
||||||
String workingDir = "/data/db/emr/";
|
|
||||||
|
|
||||||
|
|
||||||
// parse args
|
|
||||||
|
|
||||||
int pos = 0;
|
|
||||||
for ( ; pos < args.length; pos++ ) {
|
|
||||||
if ( ! args[pos].startsWith( "--" ) )
|
|
||||||
break;
|
|
||||||
|
|
||||||
String arg = args[pos].substring(2);
|
|
||||||
if ( arg.equals( "workingDir" ) ) {
|
|
||||||
workingDir = args[++pos];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
System.err.println( "unknown arg: " + arg );
|
|
||||||
throw new RuntimeException( "unknown arg: " + arg );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String mongo = args[pos++];
|
|
||||||
String code = args[pos++];
|
|
||||||
String output = args[pos++];
|
|
||||||
|
|
||||||
String suites = "";
|
|
||||||
for ( ; pos < args.length; pos++ ) {
|
|
||||||
if ( suites.length() > 0 )
|
|
||||||
suites += ",";
|
|
||||||
suites += args[pos];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( suites.length() == 0 )
|
|
||||||
throw new RuntimeException( "no suites" );
|
|
||||||
|
|
||||||
System.out.println( "workingDir:\t" + workingDir );
|
|
||||||
System.out.println( "mongo:\t" + mongo );
|
|
||||||
System.out.println( "code:\t " + code );
|
|
||||||
System.out.println( "output\t: " + output );
|
|
||||||
System.out.println( "suites\t: " + suites );
|
|
||||||
|
|
||||||
if ( false ) {
|
|
||||||
MongoSuite s = new MongoSuite();
|
|
||||||
s.mongo = mongo;
|
|
||||||
s.code = code;
|
|
||||||
s.workingDir = workingDir;
|
|
||||||
s.suite = suites;
|
|
||||||
s.runTest();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// main hadoop set
|
|
||||||
conf.set( "mongo" , mongo );
|
|
||||||
conf.set( "code" , code );
|
|
||||||
conf.set( "workingDir" , workingDir );
|
|
||||||
conf.set( "suites" , suites );
|
|
||||||
|
|
||||||
conf.set( "mapred.map.tasks" , "1" );
|
|
||||||
conf.setLong( "mapred.task.timeout" , 4 * 3600 * 1000 /* 4 hours */);
|
|
||||||
|
|
||||||
conf.setOutputKeyClass(Text.class);
|
|
||||||
conf.setOutputValueClass(IntWritable.class);
|
|
||||||
|
|
||||||
conf.setMapperClass(Map.class);
|
|
||||||
conf.setReducerClass(Reduce.class);
|
|
||||||
|
|
||||||
conf.setInputFormat(InputMagic.class);
|
|
||||||
conf.setOutputFormat(TextOutputFormat.class);
|
|
||||||
|
|
||||||
FileOutputFormat.setOutputPath(conf, new Path(output) );
|
|
||||||
|
|
||||||
// actually run
|
|
||||||
|
|
||||||
JobClient.runJob( conf );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,385 +0,0 @@
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import shutil
|
|
||||||
import datetime
|
|
||||||
import time
|
|
||||||
import subprocess
|
|
||||||
import urllib
|
|
||||||
import urllib2
|
|
||||||
import json
|
|
||||||
import pprint
|
|
||||||
|
|
||||||
import boto
|
|
||||||
import simples3
|
|
||||||
|
|
||||||
import pymongo
|
|
||||||
|
|
||||||
def findSettingsSetup():
|
|
||||||
sys.path.append( "./" )
|
|
||||||
sys.path.append( "../" )
|
|
||||||
sys.path.append( "../../" )
|
|
||||||
sys.path.append( "../../../" )
|
|
||||||
|
|
||||||
findSettingsSetup()
|
|
||||||
import settings
|
|
||||||
import buildscripts.utils as utils
|
|
||||||
import buildscripts.smoke as smoke
|
|
||||||
|
|
||||||
bucket = simples3.S3Bucket( settings.emr_bucket , settings.emr_id , settings.emr_key )
|
|
||||||
|
|
||||||
def _get_status():
|
|
||||||
|
|
||||||
def gh( cmds ):
|
|
||||||
txt = ""
|
|
||||||
for cmd in cmds:
|
|
||||||
res = utils.execsys( "git " + cmd )
|
|
||||||
txt = txt + res[0] + res[1]
|
|
||||||
return utils.md5string( txt )
|
|
||||||
|
|
||||||
return "%s-%s" % ( utils.execsys( "git describe" )[0].strip(), gh( [ "diff" , "status" ] ) )
|
|
||||||
|
|
||||||
def _get_most_recent_tgz( prefix ):
|
|
||||||
# this is icky, but works for now
|
|
||||||
all = []
|
|
||||||
for x in os.listdir( "." ):
|
|
||||||
if not x.startswith( prefix ) or not x.endswith( ".tgz" ):
|
|
||||||
continue
|
|
||||||
all.append( ( x , os.stat(x).st_mtime ) )
|
|
||||||
|
|
||||||
if len(all) == 0:
|
|
||||||
raise Exception( "can't find file with prefix: " + prefix )
|
|
||||||
|
|
||||||
all.sort( lambda x,y: int(y[1] - x[1]) )
|
|
||||||
|
|
||||||
return all[0][0]
|
|
||||||
|
|
||||||
def get_build_info():
|
|
||||||
return ( os.environ.get('MONGO_BUILDER_NAME') , os.environ.get('MONGO_BUILD_NUMBER') )
|
|
||||||
|
|
||||||
def make_tarball():
|
|
||||||
|
|
||||||
m = _get_most_recent_tgz( "mongodb-" )
|
|
||||||
|
|
||||||
c = "test-code-emr.tgz"
|
|
||||||
tar = "tar zcf %s src jstests buildscripts" % c
|
|
||||||
|
|
||||||
log_config = "log_config.py"
|
|
||||||
if os.path.exists( log_config ):
|
|
||||||
os.unlink( log_config )
|
|
||||||
|
|
||||||
credentials = do_credentials()
|
|
||||||
if credentials:
|
|
||||||
|
|
||||||
builder , buildnum = get_build_info()
|
|
||||||
|
|
||||||
if builder and buildnum:
|
|
||||||
|
|
||||||
file = open( log_config , "wb" )
|
|
||||||
file.write( 'username="%s"\npassword="%s"\n' % credentials )
|
|
||||||
file.write( 'name="%s"\nnumber=%s\n'% ( builder , buildnum ) )
|
|
||||||
|
|
||||||
file.close()
|
|
||||||
|
|
||||||
tar = tar + " " + log_config
|
|
||||||
|
|
||||||
utils.execsys( tar )
|
|
||||||
return ( m , c )
|
|
||||||
|
|
||||||
def _put_ine( bucket , local , remote ):
|
|
||||||
print( "going to put\n\t%s\n\thttp://%s.s3.amazonaws.com/%s" % ( local , settings.emr_bucket , remote ) )
|
|
||||||
|
|
||||||
for x in bucket.listdir( prefix=remote ):
|
|
||||||
print( "\talready existed" )
|
|
||||||
return remote
|
|
||||||
|
|
||||||
bucket.put( remote , open( local , "rb" ).read() , acl="public-read" )
|
|
||||||
return remote
|
|
||||||
|
|
||||||
def build_jar():
|
|
||||||
root = "build/emrjar"
|
|
||||||
src = "buildscripts/emr"
|
|
||||||
|
|
||||||
if os.path.exists( root ):
|
|
||||||
shutil.rmtree( root )
|
|
||||||
os.makedirs( root )
|
|
||||||
|
|
||||||
for x in os.listdir( src ):
|
|
||||||
if not x.endswith( ".java" ):
|
|
||||||
continue
|
|
||||||
shutil.copyfile( src + "/" + x , root + "/" + x )
|
|
||||||
shutil.copyfile( src + "/MANIFEST.MF" , root + "/MANIFEST.FM" )
|
|
||||||
|
|
||||||
classpath = os.listdir( src + "/lib" )
|
|
||||||
for x in classpath:
|
|
||||||
shutil.copyfile( src + "/lib/" + x , root + "/" + x )
|
|
||||||
classpath.append( "." )
|
|
||||||
classpath = ":".join(classpath)
|
|
||||||
|
|
||||||
for x in os.listdir( root ):
|
|
||||||
if x.endswith( ".java" ):
|
|
||||||
if subprocess.call( [ "javac" , "-cp" , classpath , x ] , cwd=root) != 0:
|
|
||||||
raise Exception( "compiled failed" )
|
|
||||||
|
|
||||||
args = [ "jar" , "-cfm" , "emr.jar" , "MANIFEST.FM" ]
|
|
||||||
for x in os.listdir( root ):
|
|
||||||
if x.endswith( ".class" ):
|
|
||||||
args.append( x )
|
|
||||||
subprocess.call( args , cwd=root )
|
|
||||||
|
|
||||||
shutil.copyfile( root + "/emr.jar" , "emr.jar" )
|
|
||||||
|
|
||||||
return "emr.jar"
|
|
||||||
|
|
||||||
def push():
|
|
||||||
mongo , test_code = make_tarball()
|
|
||||||
print( mongo )
|
|
||||||
print( test_code )
|
|
||||||
|
|
||||||
root = "emr/%s/%s" % ( datetime.date.today().strftime("%Y-%m-%d") , os.uname()[0].lower() )
|
|
||||||
|
|
||||||
def make_long_name(local,hash):
|
|
||||||
pcs = local.rpartition( "." )
|
|
||||||
h = _get_status()
|
|
||||||
if hash:
|
|
||||||
h = utils.md5sum( local )
|
|
||||||
return "%s/%s-%s.%s" % ( root , pcs[0] , h , pcs[2] )
|
|
||||||
|
|
||||||
mongo = _put_ine( bucket , mongo , make_long_name( mongo , False ) )
|
|
||||||
test_code = _put_ine( bucket , test_code , make_long_name( test_code , True ) )
|
|
||||||
|
|
||||||
jar = build_jar()
|
|
||||||
jar = _put_ine( bucket , jar , make_long_name( jar , False ) )
|
|
||||||
|
|
||||||
setup = "buildscripts/emr/emrnodesetup.sh"
|
|
||||||
setup = _put_ine( bucket , setup , make_long_name( setup , True ) )
|
|
||||||
|
|
||||||
return mongo , test_code , jar , setup
|
|
||||||
|
|
||||||
def run_tests( things , tests ):
|
|
||||||
if len(tests) == 0:
|
|
||||||
raise Exception( "no tests" )
|
|
||||||
oldNum = len(tests)
|
|
||||||
tests = fix_suites( tests )
|
|
||||||
print( "tests expanded from %d to %d" % ( oldNum , len(tests) ) )
|
|
||||||
|
|
||||||
print( "things:%s\ntests:%s\n" % ( things , tests ) )
|
|
||||||
|
|
||||||
emr = boto.connect_emr( settings.emr_id , settings.emr_key )
|
|
||||||
|
|
||||||
def http(path):
|
|
||||||
return "http://%s.s3.amazonaws.com/%s" % ( settings.emr_bucket , path )
|
|
||||||
|
|
||||||
run_s3_path = "emr/%s/%s/%s/" % ( os.getenv( "USER" ) ,
|
|
||||||
os.getenv( "HOST" ) ,
|
|
||||||
datetime.datetime.today().strftime( "%Y%m%d-%H%M" ) )
|
|
||||||
|
|
||||||
run_s3_root = "s3n://%s/%s/" % ( settings.emr_bucket , run_s3_path )
|
|
||||||
|
|
||||||
out = run_s3_root + "out"
|
|
||||||
logs = run_s3_root + "logs"
|
|
||||||
|
|
||||||
jar="s3n://%s/%s" % ( settings.emr_bucket , things[2] )
|
|
||||||
step_args=[ http(things[0]) , http(things[1]) , out , ",".join(tests) ]
|
|
||||||
|
|
||||||
step = boto.emr.step.JarStep( "emr main" , jar=jar,step_args=step_args )
|
|
||||||
print( "jar:%s\nargs:%s" % ( jar , step_args ) )
|
|
||||||
|
|
||||||
setup = boto.emr.BootstrapAction( "setup" , "s3n://%s/%s" % ( settings.emr_bucket , things[3] ) , [] )
|
|
||||||
|
|
||||||
jobid = emr.run_jobflow( name = "Mongo EMR for %s from %s" % ( os.getenv( "USER" ) , os.getenv( "HOST" ) ) ,
|
|
||||||
ec2_keyname = "emr1" ,
|
|
||||||
slave_instance_type = "m1.large" ,
|
|
||||||
ami_version = "latest" ,
|
|
||||||
num_instances=5 ,
|
|
||||||
log_uri = logs ,
|
|
||||||
bootstrap_actions = [ setup ] ,
|
|
||||||
steps = [ step ] )
|
|
||||||
|
|
||||||
|
|
||||||
print( "%s jobid: %s" % ( datetime.datetime.today() , jobid ) )
|
|
||||||
|
|
||||||
while ( True ):
|
|
||||||
flow = emr.describe_jobflow( jobid )
|
|
||||||
print( "%s status: %s" % ( datetime.datetime.today() , flow.state ) )
|
|
||||||
if flow.state == "COMPLETED" or flow.state == "FAILED":
|
|
||||||
break
|
|
||||||
time.sleep(30)
|
|
||||||
|
|
||||||
syncdir = "build/emrout/" + jobid + "/"
|
|
||||||
sync_s3( run_s3_path , syncdir )
|
|
||||||
|
|
||||||
final_out = "build/emrout/" + jobid + "/"
|
|
||||||
|
|
||||||
print("output in: " + final_out )
|
|
||||||
do_output( final_out )
|
|
||||||
|
|
||||||
def sync_s3( remote_dir , local_dir ):
|
|
||||||
for x in bucket.listdir( remote_dir ):
|
|
||||||
out = local_dir + "/" + x[0]
|
|
||||||
|
|
||||||
if os.path.exists( out ) and x[2].find( utils.md5sum( out ) ) >= 0:
|
|
||||||
continue
|
|
||||||
|
|
||||||
dir = out.rpartition( "/" )[0]
|
|
||||||
if not os.path.exists( dir ):
|
|
||||||
os.makedirs( dir )
|
|
||||||
|
|
||||||
thing = bucket.get( x[0] )
|
|
||||||
open( out , "wb" ).write( thing.read() )
|
|
||||||
|
|
||||||
def fix_suites( suites ):
|
|
||||||
fixed = []
|
|
||||||
for name,x in smoke.expand_suites( suites , False ):
|
|
||||||
idx = name.find( "/jstests" )
|
|
||||||
if idx >= 0:
|
|
||||||
name = name[idx+1:]
|
|
||||||
fixed.append( name )
|
|
||||||
return fixed
|
|
||||||
|
|
||||||
def do_credentials():
|
|
||||||
root = "buildbot.tac"
|
|
||||||
|
|
||||||
while len(root) < 40 :
|
|
||||||
if os.path.exists( root ):
|
|
||||||
break
|
|
||||||
root = "../" + root
|
|
||||||
|
|
||||||
if not os.path.exists( root ):
|
|
||||||
return None
|
|
||||||
|
|
||||||
credentials = {}
|
|
||||||
execfile(root, credentials, credentials)
|
|
||||||
|
|
||||||
if "slavename" not in credentials:
|
|
||||||
return None
|
|
||||||
|
|
||||||
if "passwd" not in credentials:
|
|
||||||
return None
|
|
||||||
|
|
||||||
return ( credentials["slavename"] , credentials["passwd"] )
|
|
||||||
|
|
||||||
|
|
||||||
def do_output( dir ):
|
|
||||||
|
|
||||||
def go_down( start ):
|
|
||||||
lst = os.listdir(dir)
|
|
||||||
if len(lst) != 1:
|
|
||||||
raise Exception( "sad: " + start )
|
|
||||||
return start + "/" + lst[0]
|
|
||||||
|
|
||||||
while "out" not in os.listdir( dir ):
|
|
||||||
dir = go_down( dir )
|
|
||||||
|
|
||||||
dir = dir + "/out"
|
|
||||||
|
|
||||||
pieces = os.listdir(dir)
|
|
||||||
pieces.sort()
|
|
||||||
|
|
||||||
passed = []
|
|
||||||
failed = []
|
|
||||||
times = {}
|
|
||||||
|
|
||||||
for x in pieces:
|
|
||||||
if not x.startswith( "part" ):
|
|
||||||
continue
|
|
||||||
full = dir + "/" + x
|
|
||||||
|
|
||||||
for line in open( full , "rb" ):
|
|
||||||
if line.find( "-passed" ) >= 0:
|
|
||||||
passed.append( line.partition( "-passed" )[0] )
|
|
||||||
continue
|
|
||||||
|
|
||||||
if line.find( "-failed" ) >= 0:
|
|
||||||
failed.append( line.partition( "-failed" )[0] )
|
|
||||||
continue
|
|
||||||
|
|
||||||
if line.find( "-time-seconds" ) >= 0:
|
|
||||||
p = line.partition( "-time-seconds" )
|
|
||||||
times[p[0]] = p[2].strip()
|
|
||||||
continue
|
|
||||||
|
|
||||||
print( "\t" + line.strip() )
|
|
||||||
|
|
||||||
def print_list(name,lst):
|
|
||||||
print( name )
|
|
||||||
for x in lst:
|
|
||||||
print( "\t%s\t%s" % ( x , times[x] ) )
|
|
||||||
|
|
||||||
print_list( "passed" , passed )
|
|
||||||
print_list( "failed" , failed )
|
|
||||||
|
|
||||||
if do_credentials():
|
|
||||||
builder , buildnum = get_build_info()
|
|
||||||
if builder and buildnum:
|
|
||||||
conn = pymongo.Connection( "bbout1.10gen.cc" )
|
|
||||||
db = conn.buildlogs
|
|
||||||
q = { "builder" : builder , "buildnum" : int(buildnum) }
|
|
||||||
doc = db.builds.find_one( q )
|
|
||||||
|
|
||||||
if doc:
|
|
||||||
print( "\nhttp://buildlogs.mongodb.org/build/%s" % doc["_id"] )
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
if len(sys.argv) == 1:
|
|
||||||
print( "need an arg" )
|
|
||||||
|
|
||||||
elif sys.argv[1] == "tarball":
|
|
||||||
make_tarball()
|
|
||||||
elif sys.argv[1] == "jar":
|
|
||||||
build_jar()
|
|
||||||
elif sys.argv[1] == "push":
|
|
||||||
print( push() )
|
|
||||||
|
|
||||||
elif sys.argv[1] == "sync":
|
|
||||||
sync_s3( sys.argv[2] , sys.argv[3] )
|
|
||||||
|
|
||||||
elif sys.argv[1] == "fix_suites":
|
|
||||||
for x in fix_suites( sys.argv[2:] ):
|
|
||||||
print(x)
|
|
||||||
|
|
||||||
elif sys.argv[1] == "credentials":
|
|
||||||
print( do_credentials() )
|
|
||||||
|
|
||||||
elif sys.argv[1] == "test":
|
|
||||||
m , c = make_tarball()
|
|
||||||
build_jar()
|
|
||||||
cmd = [ "java" , "-cp" , os.environ.get( "CLASSPATH" , "." ) + ":emr.jar" , "emr" ]
|
|
||||||
|
|
||||||
workingDir = "/data/emr/test"
|
|
||||||
cmd.append( "--workingDir" )
|
|
||||||
cmd.append( workingDir )
|
|
||||||
if os.path.exists( workingDir ):
|
|
||||||
shutil.rmtree( workingDir )
|
|
||||||
|
|
||||||
cmd.append( "file://" + os.getcwd() + "/" + m )
|
|
||||||
cmd.append( "file://" + os.getcwd() + "/" + c )
|
|
||||||
|
|
||||||
out = "/tmp/emrresults"
|
|
||||||
cmd.append( out )
|
|
||||||
if os.path.exists( out ):
|
|
||||||
shutil.rmtree( out )
|
|
||||||
|
|
||||||
cmd.append( "jstests/basic1.js" )
|
|
||||||
|
|
||||||
subprocess.call( cmd )
|
|
||||||
|
|
||||||
for x in os.listdir( out ):
|
|
||||||
if x.startswith( "." ):
|
|
||||||
continue
|
|
||||||
print( x )
|
|
||||||
for z in open( out + "/" + x ):
|
|
||||||
print( "\t" + z.strip() )
|
|
||||||
|
|
||||||
elif sys.argv[1] == "output":
|
|
||||||
do_output( sys.argv[2] )
|
|
||||||
|
|
||||||
elif sys.argv[1] == "full":
|
|
||||||
things = push()
|
|
||||||
run_tests( things , sys.argv[2:] )
|
|
||||||
|
|
||||||
else:
|
|
||||||
things = push()
|
|
||||||
run_tests( things , sys.argv[1:] )
|
|
||||||
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
sudo mkdir /mnt/data
|
|
||||||
sudo ln -s /mnt/data /data
|
|
||||||
sudo chown hadoop /mnt/data
|
|
||||||
|
|
||||||
sudo easy_install pymongo
|
|
||||||
|
|
@ -1,179 +0,0 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import re
|
|
||||||
import utils
|
|
||||||
|
|
||||||
|
|
||||||
assertNames = [ "uassert" , "massert", "fassert", "fassertFailed" ]
|
|
||||||
|
|
||||||
def assignErrorCodes():
|
|
||||||
cur = 10000
|
|
||||||
for root in assertNames:
|
|
||||||
for x in utils.getAllSourceFiles():
|
|
||||||
print( x )
|
|
||||||
didAnything = False
|
|
||||||
fixed = ""
|
|
||||||
for line in open( x ):
|
|
||||||
s = line.partition( root + "(" )
|
|
||||||
if s[1] == "" or line.startswith( "#define " + root):
|
|
||||||
fixed += line
|
|
||||||
continue
|
|
||||||
fixed += s[0] + root + "( " + str( cur ) + " , " + s[2]
|
|
||||||
cur = cur + 1
|
|
||||||
didAnything = True
|
|
||||||
if didAnything:
|
|
||||||
out = open( x , 'w' )
|
|
||||||
out.write( fixed )
|
|
||||||
out.close()
|
|
||||||
|
|
||||||
|
|
||||||
codes = []
|
|
||||||
|
|
||||||
def readErrorCodes( callback, replaceZero = False ):
|
|
||||||
|
|
||||||
quick = [ "assert" , "Exception"]
|
|
||||||
|
|
||||||
ps = [ re.compile( "(([umsgf]asser(t|ted))) *\(( *)(\d+)" ) ,
|
|
||||||
re.compile( "((User|Msg|MsgAssertion)Exceptio(n))\(( *)(\d+)" ),
|
|
||||||
re.compile( "((fassertFailed)()) *\(( *)(\d+)" )
|
|
||||||
]
|
|
||||||
|
|
||||||
bad = [ re.compile( "\sassert *\(" ) ]
|
|
||||||
|
|
||||||
for x in utils.getAllSourceFiles():
|
|
||||||
|
|
||||||
needReplace = [False]
|
|
||||||
lines = []
|
|
||||||
lastCodes = [0]
|
|
||||||
lineNum = 1
|
|
||||||
|
|
||||||
for line in open( x ):
|
|
||||||
|
|
||||||
found = False
|
|
||||||
for zz in quick:
|
|
||||||
if line.find( zz ) >= 0:
|
|
||||||
found = True
|
|
||||||
break
|
|
||||||
|
|
||||||
if found:
|
|
||||||
|
|
||||||
if x.find( "src/mongo/" ) >= 0:
|
|
||||||
for b in bad:
|
|
||||||
if len(b.findall( line )) > 0:
|
|
||||||
print( x )
|
|
||||||
print( line )
|
|
||||||
raise Exception( "you can't use a bare assert" )
|
|
||||||
|
|
||||||
for p in ps:
|
|
||||||
|
|
||||||
def repl( m ):
|
|
||||||
m = m.groups()
|
|
||||||
|
|
||||||
start = m[0]
|
|
||||||
spaces = m[3]
|
|
||||||
code = m[4]
|
|
||||||
if code == '0' and replaceZero :
|
|
||||||
code = getNextCode( lastCodes )
|
|
||||||
lastCodes.append( code )
|
|
||||||
code = str( code )
|
|
||||||
needReplace[0] = True
|
|
||||||
|
|
||||||
print( "Adding code " + code + " to line " + x + ":" + str( lineNum ) )
|
|
||||||
|
|
||||||
else :
|
|
||||||
codes.append( ( x , lineNum , line , code ) )
|
|
||||||
callback( x , lineNum , line , code )
|
|
||||||
|
|
||||||
return start + "(" + spaces + code
|
|
||||||
|
|
||||||
line = re.sub( p, repl, line )
|
|
||||||
# end if ps loop
|
|
||||||
|
|
||||||
if replaceZero : lines.append( line )
|
|
||||||
lineNum = lineNum + 1
|
|
||||||
|
|
||||||
if replaceZero and needReplace[0] :
|
|
||||||
print( "Replacing file " + x )
|
|
||||||
of = open( x + ".tmp", 'w' )
|
|
||||||
of.write( "".join( lines ) )
|
|
||||||
of.close()
|
|
||||||
os.remove(x)
|
|
||||||
os.rename( x + ".tmp", x )
|
|
||||||
|
|
||||||
|
|
||||||
def getNextCode( lastCodes = [0] ):
|
|
||||||
highest = [max(lastCodes)]
|
|
||||||
def check( fileName , lineNum , line , code ):
|
|
||||||
code = int( code )
|
|
||||||
if code > highest[0]:
|
|
||||||
highest[0] = code
|
|
||||||
readErrorCodes( check )
|
|
||||||
return highest[0] + 1
|
|
||||||
|
|
||||||
def checkErrorCodes():
|
|
||||||
seen = {}
|
|
||||||
errors = []
|
|
||||||
def checkDups( fileName , lineNum , line , code ):
|
|
||||||
if code in seen:
|
|
||||||
print( "DUPLICATE IDS" )
|
|
||||||
print( "%s:%d:%s %s" % ( fileName , lineNum , line.strip() , code ) )
|
|
||||||
print( "%s:%d:%s %s" % seen[code] )
|
|
||||||
errors.append( seen[code] )
|
|
||||||
seen[code] = ( fileName , lineNum , line , code )
|
|
||||||
readErrorCodes( checkDups, True )
|
|
||||||
return len( errors ) == 0
|
|
||||||
|
|
||||||
def getBestMessage( err , start ):
|
|
||||||
err = err.partition( start )[2]
|
|
||||||
if not err:
|
|
||||||
return ""
|
|
||||||
err = err.partition( "\"" )[2]
|
|
||||||
if not err:
|
|
||||||
return ""
|
|
||||||
err = err.rpartition( "\"" )[0]
|
|
||||||
if not err:
|
|
||||||
return ""
|
|
||||||
return err
|
|
||||||
|
|
||||||
def genErrorOutput():
|
|
||||||
|
|
||||||
if os.path.exists( "docs/errors.md" ):
|
|
||||||
i = open( "docs/errors.md" , "r" )
|
|
||||||
|
|
||||||
|
|
||||||
out = open( "docs/errors.md" , 'wb' )
|
|
||||||
out.write( "MongoDB Error Codes\n==========\n\n\n" )
|
|
||||||
|
|
||||||
prev = ""
|
|
||||||
seen = {}
|
|
||||||
|
|
||||||
codes.sort( key=lambda x: x[0]+"-"+x[3] )
|
|
||||||
for f,l,line,num in codes:
|
|
||||||
if num in seen:
|
|
||||||
continue
|
|
||||||
seen[num] = True
|
|
||||||
|
|
||||||
if f.startswith( "./" ):
|
|
||||||
f = f[2:]
|
|
||||||
|
|
||||||
if f != prev:
|
|
||||||
out.write( "\n\n" )
|
|
||||||
out.write( f + "\n----\n" )
|
|
||||||
prev = f
|
|
||||||
|
|
||||||
url = "http://github.com/mongodb/mongo/blob/master/" + f + "#L" + str(l)
|
|
||||||
|
|
||||||
out.write( "* " + str(num) + " [code](" + url + ") " + getBestMessage( line , str(num) ) + "\n" )
|
|
||||||
|
|
||||||
out.write( "\n" )
|
|
||||||
out.close()
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
ok = checkErrorCodes()
|
|
||||||
print( "ok:" + str( ok ) )
|
|
||||||
print( "next: " + str( getNextCode() ) )
|
|
||||||
if ok:
|
|
||||||
genErrorOutput()
|
|
||||||
|
|
||||||
|
|
@ -1,202 +0,0 @@
|
||||||
#!/bin/sh -e
|
|
||||||
#
|
|
||||||
# Copyright (c) 2005-2011 The OpenSSL Project.
|
|
||||||
#
|
|
||||||
# Depending on output file name, the script either embeds fingerprint
|
|
||||||
# into libcrypto.so or static application. "Static" refers to static
|
|
||||||
# libcrypto.a, not [necessarily] application per se.
|
|
||||||
#
|
|
||||||
# Even though this script is called fipsld, it expects C compiler
|
|
||||||
# command line syntax and $FIPSLD_CC or $CC environment variable set
|
|
||||||
# and can even be used to compile source files.
|
|
||||||
|
|
||||||
#set -x
|
|
||||||
|
|
||||||
# Note: edit this to point to your copy of g++ if this is not correct.
|
|
||||||
CC="/usr/bin/g++"
|
|
||||||
|
|
||||||
# Initially -c wasn't intended to be interpreted here, but it might
|
|
||||||
# make life easier for those who want to build FIPS-ified applications
|
|
||||||
# with minimal [if any] modifications to their Makefiles...
|
|
||||||
( while [ "x$1" != "x" -a "x$1" != "x-c" -a "x$1" != "x-E" ]; do shift; done;
|
|
||||||
[ $# -ge 1 ]
|
|
||||||
) && exec ${CC} "$@"
|
|
||||||
|
|
||||||
TARGET=`(while [ "x$1" != "x" -a "x$1" != "x-o" ]; do shift; done; echo $2)`
|
|
||||||
|
|
||||||
# If using an auto-tooled (autoconf/automake/libtool) project,
|
|
||||||
# configure will fail when testing the compiler or even performing
|
|
||||||
# simple checks. Pass-through to compiler directly if application is
|
|
||||||
# is not being linked with libcrypto, allowing auto-tooled applications
|
|
||||||
# to utilize fipsld (e.g. CC=/usr/local/ssl/bin/fipsld FIPSLD_CC=gcc
|
|
||||||
# ./configure && make). But keep in mind[!] that if certified code
|
|
||||||
# resides in a shared library, then fipsld *may not* be used and
|
|
||||||
# end-developer should not modify application configuration and build
|
|
||||||
# procedures. This is because in-core fingerprint and associated
|
|
||||||
# procedures are already embedded into and executed in shared library
|
|
||||||
# context.
|
|
||||||
case `basename "${TARGET}"` in
|
|
||||||
libcrypto*|libfips*|*.dll) ;;
|
|
||||||
*) case "$*" in
|
|
||||||
*libcrypto.a*|*-lcrypto*|*fipscanister.o*) ;;
|
|
||||||
*) exec ${CC} "$@" ;;
|
|
||||||
esac
|
|
||||||
esac
|
|
||||||
|
|
||||||
[ -n "${TARGET}" ] || { echo 'no -o specified'; exit 1; }
|
|
||||||
|
|
||||||
# Turn on debugging output?
|
|
||||||
( while [ "x$1" != "x" -a "x$1" != "x-DDEBUG_FINGERPRINT_PREMAIN" ]; do shift; done;
|
|
||||||
[ $# -ge 1 ]
|
|
||||||
) && set -x
|
|
||||||
|
|
||||||
THERE="`echo $0 | sed -e 's|[^/]*$||'`"..
|
|
||||||
|
|
||||||
# fipscanister.o can appear in command line
|
|
||||||
CANISTER_O=`(while [ "x$1" != "x" ]; do case "$1" in *fipscanister.o) echo $1; exit;; esac; shift; done)`
|
|
||||||
if [ -z "${CANISTER_O}" ]; then
|
|
||||||
# If set, FIPSLIBDIR is location of installed validated FIPS module
|
|
||||||
if [ -n "${FIPSLIBDIR}" ]; then
|
|
||||||
CANISTER_O="${FIPSLIBDIR}/fipscanister.o"
|
|
||||||
elif [ -f "${THERE}/fips/fipscanister.o" ]; then
|
|
||||||
CANISTER_O="${THERE}/fips/fipscanister.o"
|
|
||||||
elif [ -f "${THERE}/lib/fipscanister.o" ]; then
|
|
||||||
CANISTER_O="${THERE}/lib/fipscanister.o"
|
|
||||||
fi
|
|
||||||
CANISTER_O_CMD="${CANISTER_O}"
|
|
||||||
fi
|
|
||||||
[ -f ${CANISTER_O} ] || { echo "unable to find ${CANISTER_O}"; exit 1; }
|
|
||||||
|
|
||||||
PREMAIN_C=`dirname "${CANISTER_O}"`/fips_premain.c
|
|
||||||
PREMAIN_O=`dirname "${CANISTER_O}"`/fips_premain.o
|
|
||||||
|
|
||||||
HMAC_KEY="etaonrishdlcupfm"
|
|
||||||
|
|
||||||
case "`(uname -s) 2>/dev/null`" in
|
|
||||||
OSF1|IRIX*) _WL_PREMAIN="-Wl,-init,FINGERPRINT_premain" ;;
|
|
||||||
HP-UX) _WL_PREMAIN="-Wl,+init,FINGERPRINT_premain" ;;
|
|
||||||
AIX) _WL_PREMAIN="-Wl,-binitfini:FINGERPRINT_premain,-bnoobjreorder";;
|
|
||||||
Darwin) ( while [ "x$1" != "x" -a "x$1" != "x-dynamiclib" ]; do shift; done;
|
|
||||||
[ $# -ge 1 ]
|
|
||||||
) && _WL_PREMAIN="-Wl,-init,_FINGERPRINT_premain" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
case "${TARGET}" in
|
|
||||||
[!/]*) TARGET=./${TARGET} ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
case `basename "${TARGET}"` in
|
|
||||||
lib*|*.dll) # must be linking a shared lib...
|
|
||||||
# Shared lib creation can be taking place in the source
|
|
||||||
# directory only, but fipscanister.o can reside elsewhere...
|
|
||||||
|
|
||||||
if [ -x "${THERE}/fips/fips_standalone_sha1" ]; then
|
|
||||||
FINGERTYPE="${THERE}/fips/fips_standalone_sha1"
|
|
||||||
PREMAIN_DSO="${THERE}/fips/fips_premain_dso"
|
|
||||||
elif [ -x "${THERE}/bin/fips_standalone_sha1" ]; then
|
|
||||||
FINGERTYPE="${THERE}/bin/fips_standalone_sha1"
|
|
||||||
PREMAIN_DSO="./fips_premain_dso"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# verify fipspremain.c against its detached signature...
|
|
||||||
${FINGERTYPE} "${PREMAIN_C}" | sed "s/(.*\//(/" | \
|
|
||||||
diff -w "${PREMAIN_C}.sha1" - || \
|
|
||||||
{ echo "${PREMAIN_C} fingerprint mismatch"; exit 1; }
|
|
||||||
# verify fipscanister.o against its detached signature...
|
|
||||||
${FINGERTYPE} "${CANISTER_O}" | sed "s/(.*\//(/" | \
|
|
||||||
diff -w "${CANISTER_O}.sha1" - || \
|
|
||||||
{ echo "${CANISTER_O} fingerprint mismatch"; exit 1; }
|
|
||||||
|
|
||||||
[ -z "${FIPSLD_LIBCRYPTO}" -a -f "${THERE}/libcrypto.a" ] && \
|
|
||||||
FIPSLD_LIBCRYPTO="${THERE}/libcrypto.a"
|
|
||||||
|
|
||||||
|
|
||||||
# Temporarily remove fipscanister.o from libcrypto.a!
|
|
||||||
# We are required to use the standalone copy...
|
|
||||||
if [ -n "${FIPSLD_LIBCRYPTO}" ]; then
|
|
||||||
if ar d "${FIPSLD_LIBCRYPTO}" fipscanister.o; then
|
|
||||||
(ranlib "${FIPSLD_LIBCRYPTO}") 2>/dev/null || :
|
|
||||||
trap 'ar r "${FIPSLD_LIBCRYPTO}" "${CANISTER_O}";
|
|
||||||
(ranlib "${FIPSLD_LIBCRYPTO}") 2>/dev/null || :;
|
|
||||||
sleep 1;
|
|
||||||
touch -c "${TARGET}"' 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
/bin/rm -f "${TARGET}"
|
|
||||||
${CC} -x c "${PREMAIN_C}" -c -o "${PREMAIN_O}"
|
|
||||||
${CC} ${CANISTER_O_CMD:+"${CANISTER_O_CMD}"} \
|
|
||||||
"${PREMAIN_O}" \
|
|
||||||
${_WL_PREMAIN} "$@"
|
|
||||||
|
|
||||||
if [ "x${FIPS_SIG}" != "x" ]; then
|
|
||||||
# embed signature
|
|
||||||
"${FIPS_SIG}" "${TARGET}"
|
|
||||||
[ $? -ne 42 ] && exit $?
|
|
||||||
fi
|
|
||||||
|
|
||||||
# generate signature...
|
|
||||||
SIG=`"${PREMAIN_DSO}" "${TARGET}"`
|
|
||||||
|
|
||||||
/bin/rm -f "${TARGET}"
|
|
||||||
if [ -z "${SIG}" ]; then
|
|
||||||
echo "unable to collect signature"; exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# recompile with signature...
|
|
||||||
${CC} -x c -DHMAC_SHA1_SIG=\"${SIG}\" "${PREMAIN_C}" -c -o "${PREMAIN_O}"
|
|
||||||
${CC} ${CANISTER_O_CMD:+"${CANISTER_O_CMD}"} \
|
|
||||||
-DHMAC_SHA1_SIG=\"${SIG}\" "${PREMAIN_O}" \
|
|
||||||
${_WL_PREMAIN} "$@"
|
|
||||||
;;
|
|
||||||
|
|
||||||
*) # must be linking statically...
|
|
||||||
# Static linking can be taking place either in the source
|
|
||||||
# directory or off the installed binary target destination.
|
|
||||||
if [ -x "${THERE}/fips/fips_standalone_sha1" ]; then
|
|
||||||
FINGERTYPE="${THERE}/fips/fips_standalone_sha1"
|
|
||||||
elif [ -x "${THERE}/bin/fips_standalone_sha1" ]; then
|
|
||||||
FINGERTYPE="${THERE}/bin/fips_standalone_sha1"
|
|
||||||
else # Installed tree is expected to contain
|
|
||||||
# lib/fipscanister.o, lib/fipscanister.o.sha1 and
|
|
||||||
# lib/fips_premain.c [not to mention bin/openssl].
|
|
||||||
FINGERTYPE="openssl sha1 -hmac ${HMAC_KEY}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# verify fipscanister.o against its detached signature...
|
|
||||||
${FINGERTYPE} "${CANISTER_O}" | sed "s/(.*\//(/" | \
|
|
||||||
diff -w "${CANISTER_O}.sha1" - || \
|
|
||||||
{ echo "${CANISTER_O} fingerprint mismatch"; exit 1; }
|
|
||||||
|
|
||||||
# verify fips_premain.c against its detached signature...
|
|
||||||
${FINGERTYPE} "${PREMAIN_C}" | sed "s/(.*\//(/" | \
|
|
||||||
diff -w "${PREMAIN_C}.sha1" - || \
|
|
||||||
{ echo "${PREMAIN_C} fingerprint mismatch"; exit 1; }
|
|
||||||
|
|
||||||
/bin/rm -f "${TARGET}"
|
|
||||||
${CC} -x c "${PREMAIN_C}" -c -o "${PREMAIN_O}"
|
|
||||||
${CC} ${CANISTER_O_CMD:+"${CANISTER_O_CMD}"} \
|
|
||||||
"${PREMAIN_O}" \
|
|
||||||
${_WL_PREMAIN} "$@"
|
|
||||||
|
|
||||||
if [ "x${FIPS_SIG}" != "x" ]; then
|
|
||||||
# embed signature
|
|
||||||
"${FIPS_SIG}" "${TARGET}"
|
|
||||||
[ $? -ne 42 ] && exit $?
|
|
||||||
fi
|
|
||||||
|
|
||||||
# generate signature...
|
|
||||||
SIG=`"${TARGET}"`
|
|
||||||
|
|
||||||
/bin/rm -f "${TARGET}"
|
|
||||||
if [ -z "${SIG}" ]; then
|
|
||||||
echo "unable to collect signature"; exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# recompile with signature...
|
|
||||||
${CC} -x c -DHMAC_SHA1_SIG=\"${SIG}\" "${PREMAIN_C}" -c -o "${PREMAIN_O}"
|
|
||||||
${CC} ${CANISTER_O_CMD:+"${CANISTER_O_CMD}"} \
|
|
||||||
-DHMAC_SHA1_SIG=\"${SIG}\" "${PREMAIN_O}" \
|
|
||||||
${_WL_PREMAIN} "$@"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
@ -1,69 +0,0 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
from __future__ import with_statement
|
|
||||||
import tempfile
|
|
||||||
import sys
|
|
||||||
import re
|
|
||||||
import os
|
|
||||||
|
|
||||||
def opentemp(basename):
|
|
||||||
# The following doesn't work in python before 2.6
|
|
||||||
# return tempfile.NamedTemporaryFile('w', -1, ".XXXXXX", basename, '.', False)
|
|
||||||
fname = basename +".TMP"
|
|
||||||
if os.path.exists(fname):
|
|
||||||
raise "not clobbering file %s" % fname
|
|
||||||
return open(fname, 'w')
|
|
||||||
|
|
||||||
def frob_debian_changelog(version):
|
|
||||||
fname = 'debian/changelog'
|
|
||||||
with opentemp(fname) as o:
|
|
||||||
with open(fname) as i:
|
|
||||||
lineno = 0
|
|
||||||
for line in i:
|
|
||||||
if lineno == 0:
|
|
||||||
newline = re.sub(r'\([^)]*\)', '('+version+')', line)
|
|
||||||
o.write(newline)
|
|
||||||
else:
|
|
||||||
o.write(line)
|
|
||||||
os.rename(o.name, fname)
|
|
||||||
|
|
||||||
def frob_rpm_spec(version):
|
|
||||||
fname = 'rpm/mongo.spec'
|
|
||||||
with opentemp(fname) as o:
|
|
||||||
with open(fname) as i:
|
|
||||||
frobbed = False
|
|
||||||
for line in i:
|
|
||||||
if frobbed:
|
|
||||||
o.write(line)
|
|
||||||
else:
|
|
||||||
if line.find('Version:') == 0:
|
|
||||||
print >> o, 'Version: ' + version
|
|
||||||
frobbed = True
|
|
||||||
else:
|
|
||||||
o.write(line)
|
|
||||||
os.rename(o.name, fname)
|
|
||||||
|
|
||||||
def frob_stdafx_cpp(version):
|
|
||||||
fname = 'stdafx.cpp'
|
|
||||||
with opentemp(fname) as o:
|
|
||||||
with open(fname) as i:
|
|
||||||
frobbed = False
|
|
||||||
for line in i:
|
|
||||||
if frobbed:
|
|
||||||
o.write(line)
|
|
||||||
else:
|
|
||||||
if re.search(r'const.*char.*versionString\[\].*=', line):
|
|
||||||
o.write(' const char versionString[] = "%s";' % version)
|
|
||||||
else:
|
|
||||||
o.write(line)
|
|
||||||
os.rename(o.name, fname)
|
|
||||||
|
|
||||||
(progname, version) = sys.argv
|
|
||||||
if version is None:
|
|
||||||
print >> sys.stderr, 'usage: %s VERSION' % progname
|
|
||||||
sys.exit(1)
|
|
||||||
frob_debian_changelog(version)
|
|
||||||
frob_rpm_spec(version)
|
|
||||||
## I don't yet know what-all cares about the versionString inside the
|
|
||||||
## mongo code, so I'm not actually calling this yet.
|
|
||||||
# frob_stdafx_cpp(version)
|
|
||||||
|
|
@ -1,107 +0,0 @@
|
||||||
|
|
||||||
import sys
|
|
||||||
import codecs
|
|
||||||
|
|
||||||
import cpplint
|
|
||||||
import utils
|
|
||||||
|
|
||||||
|
|
||||||
def run_lint( paths, nudgeOn=False ):
|
|
||||||
# errors are as of 10/14
|
|
||||||
# idea is not to let it any new type of error
|
|
||||||
# as we knock one out, we should remove line
|
|
||||||
# note: not all of these are things we want, so please check first
|
|
||||||
|
|
||||||
nudge = [] # things we'd like to turn on sson, so don't make worse
|
|
||||||
later = [] # things that are unlikely anytime soon, so meh
|
|
||||||
never = [] # things we totally disagree with
|
|
||||||
|
|
||||||
never.append( '-build/header_guard' ) # errors found: 345
|
|
||||||
nudge.append( '-build/include' ) # errors found: 924
|
|
||||||
nudge.append( '-build/include_order' ) # errors found: 511
|
|
||||||
nudge.append( '-build/include_what_you_use' ) # errors found: 986
|
|
||||||
nudge.append( '-build/namespaces' ) # errors found: 131
|
|
||||||
never.append( '-readability/braces' ) # errors found: 880
|
|
||||||
later.append( '-readability/casting' ) # errors found: 748
|
|
||||||
nudge.append( '-readability/function' ) # errors found: 49
|
|
||||||
later.append( '-readability/streams' ) # errors found: 72
|
|
||||||
later.append( '-readability/todo' ) # errors found: 309
|
|
||||||
nudge.append( '-runtime/arrays' ) # errors found: 5
|
|
||||||
later.append( '-runtime/explicit' ) # errors found: 322
|
|
||||||
later.append( '-runtime/int' ) # errors found: 1420
|
|
||||||
later.append( '-runtime/printf' ) # errors found: 29
|
|
||||||
nudge.append( '-runtime/references' ) # errors found: 1338
|
|
||||||
nudge.append( '-runtime/rtti' ) # errors found: 36
|
|
||||||
nudge.append( '-runtime/sizeof' ) # errors found: 57
|
|
||||||
nudge.append( '-runtime/string' ) # errors found: 6
|
|
||||||
nudge.append( '-runtime/threadsafe_fn' ) # errors found: 46
|
|
||||||
never.append( '-whitespace/blank_line' ) # errors found: 2080
|
|
||||||
never.append( '-whitespace/braces' ) # errors found: 962
|
|
||||||
later.append( '-whitespace/comma' ) # errors found: 621
|
|
||||||
later.append( '-whitespace/comments' ) # errors found: 2189
|
|
||||||
later.append( '-whitespace/end_of_line' ) # errors found: 4340
|
|
||||||
later.append( '-whitespace/labels' ) # errors found: 58
|
|
||||||
later.append( '-whitespace/line_length' ) # errors found: 14500
|
|
||||||
later.append( '-whitespace/newline' ) # errors found: 1520
|
|
||||||
nudge.append( '-whitespace/operators' ) # errors found: 2297
|
|
||||||
never.append( '-whitespace/parens' ) # errors found: 49058
|
|
||||||
nudge.append( '-whitespace/semicolon' ) # errors found: 121
|
|
||||||
nudge.append( '-whitespace/tab' ) # errors found: 233
|
|
||||||
|
|
||||||
filters = later + never
|
|
||||||
if not nudgeOn:
|
|
||||||
filters = filters + nudge
|
|
||||||
|
|
||||||
|
|
||||||
sourceFiles = []
|
|
||||||
for x in paths:
|
|
||||||
utils.getAllSourceFiles( sourceFiles, x )
|
|
||||||
|
|
||||||
|
|
||||||
args = [ "--filter=" + ",".join( filters ) , "--counting=detailed" ] + sourceFiles
|
|
||||||
filenames = cpplint.ParseArguments( args )
|
|
||||||
|
|
||||||
def _ourIsTestFilename(fn):
|
|
||||||
if fn.find( "dbtests" ) >= 0:
|
|
||||||
return True
|
|
||||||
if fn.endswith( "_test.cpp" ):
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
cpplint._IsTestFilename = _ourIsTestFilename
|
|
||||||
|
|
||||||
# Change stderr to write with replacement characters so we don't die
|
|
||||||
# if we try to print something containing non-ASCII characters.
|
|
||||||
sys.stderr = codecs.StreamReaderWriter(sys.stderr,
|
|
||||||
codecs.getreader('utf8'),
|
|
||||||
codecs.getwriter('utf8'),
|
|
||||||
'replace')
|
|
||||||
|
|
||||||
cpplint._cpplint_state.ResetErrorCounts()
|
|
||||||
for filename in filenames:
|
|
||||||
cpplint.ProcessFile(filename, cpplint._cpplint_state.verbose_level)
|
|
||||||
cpplint._cpplint_state.PrintErrorCounts()
|
|
||||||
|
|
||||||
return cpplint._cpplint_state.error_count == 0
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
paths = []
|
|
||||||
nudge = False
|
|
||||||
|
|
||||||
for arg in sys.argv[1:]:
|
|
||||||
if arg.startswith( "--" ):
|
|
||||||
arg = arg[2:]
|
|
||||||
if arg == "nudge":
|
|
||||||
nudge = True
|
|
||||||
continue
|
|
||||||
else:
|
|
||||||
print( "unknown arg [%s]" % arg )
|
|
||||||
sys.exit(-1)
|
|
||||||
paths.append( arg )
|
|
||||||
|
|
||||||
if len(paths) == 0:
|
|
||||||
paths.append( "src/mongo/" )
|
|
||||||
|
|
||||||
if not run_lint( paths, nudge ):
|
|
||||||
sys.exit(-1)
|
|
||||||
|
|
@ -1,116 +0,0 @@
|
||||||
#!/usr/bin/python
|
|
||||||
|
|
||||||
'''Helper script for constructing an archive (zip or tar) from a list of files.
|
|
||||||
|
|
||||||
The output format (tar, tgz, zip) is determined from the file name, unless the user specifies
|
|
||||||
--format on the command line.
|
|
||||||
|
|
||||||
This script simplifies the specification of filename transformations, so that, e.g.,
|
|
||||||
src/mongo/foo.cpp and build/linux2/normal/buildinfo.cpp can get put into the same
|
|
||||||
directory in the archive, perhaps mongodb-2.0.2/src/mongo.
|
|
||||||
|
|
||||||
Usage:
|
|
||||||
|
|
||||||
make_archive.py -o <output-file> [--format (tar|tgz|zip)] \
|
|
||||||
[--transform match1=replacement1 [--transform match2=replacement2 [...]]] \
|
|
||||||
<input file 1> [...]
|
|
||||||
|
|
||||||
If the input file names start with "@", the file is expected to contain a list of
|
|
||||||
whitespace-separated file names to include in the archive. This helps get around the Windows
|
|
||||||
command line length limit.
|
|
||||||
|
|
||||||
Transformations are processed in command-line order and are short-circuiting. So, if a file matches
|
|
||||||
match1, it is never compared against match2 or later. Matches are just python startswith()
|
|
||||||
comparisons.
|
|
||||||
|
|
||||||
For a detailed usage example, see src/SConscript.client or src/mongo/SConscript.
|
|
||||||
'''
|
|
||||||
|
|
||||||
import optparse
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
def main(argv):
|
|
||||||
opts = parse_options(argv[1:])
|
|
||||||
archive = open_archive_for_write(opts.output_filename, opts.archive_format)
|
|
||||||
try:
|
|
||||||
for input_filename in opts.input_filenames:
|
|
||||||
archive.add(input_filename, arcname=get_preferred_filename(input_filename,
|
|
||||||
opts.transformations))
|
|
||||||
finally:
|
|
||||||
archive.close()
|
|
||||||
|
|
||||||
def parse_options(args):
|
|
||||||
parser = optparse.OptionParser()
|
|
||||||
parser.add_option('-o', dest='output_filename', default=None,
|
|
||||||
help='Name of the archive to output.', metavar='FILE')
|
|
||||||
parser.add_option('--format', dest='archive_format', default=None,
|
|
||||||
choices=('zip', 'tar', 'tgz'),
|
|
||||||
help='Format of archive to create. '
|
|
||||||
'If omitted, use the suffix of the output filename to decide.')
|
|
||||||
parser.add_option('--transform', action='append', dest='transformations', default=[])
|
|
||||||
|
|
||||||
(opts, input_filenames) = parser.parse_args(args)
|
|
||||||
opts.input_filenames = []
|
|
||||||
|
|
||||||
for input_filename in input_filenames:
|
|
||||||
if input_filename.startswith('@'):
|
|
||||||
opts.input_filenames.extend(open(input_filename[1:], 'r').read().split())
|
|
||||||
else:
|
|
||||||
opts.input_filenames.append(input_filename)
|
|
||||||
|
|
||||||
if opts.output_filename is None:
|
|
||||||
parser.error('-o switch is required')
|
|
||||||
|
|
||||||
if opts.archive_format is None:
|
|
||||||
if opts.output_filename.endswith('.zip'):
|
|
||||||
opts.archive_format = 'zip'
|
|
||||||
elif opts.output_filename.endswith('tar.gz') or opts.output_filename.endswith('.tgz'):
|
|
||||||
opts.archive_format = 'tgz'
|
|
||||||
elif opts.output_filename.endswith('.tar'):
|
|
||||||
opts.archive_format = 'tar'
|
|
||||||
else:
|
|
||||||
parser.error('Could not deduce archive format from output filename "%s"' %
|
|
||||||
opts.output_filename)
|
|
||||||
|
|
||||||
try:
|
|
||||||
opts.transformations = [
|
|
||||||
xform.replace(os.path.altsep or os.path.sep, os.path.sep).split('=', 1)
|
|
||||||
for xform in opts.transformations]
|
|
||||||
except Exception, e:
|
|
||||||
parser.error(e)
|
|
||||||
|
|
||||||
return opts
|
|
||||||
|
|
||||||
def open_archive_for_write(filename, archive_format):
|
|
||||||
'''Open a tar or zip archive for write, with the given format, and return it.
|
|
||||||
|
|
||||||
The type of archive is determined by the "archive_format" parameter, which should be
|
|
||||||
"tar", "tgz" (for gzipped tar) or "zip".
|
|
||||||
'''
|
|
||||||
|
|
||||||
if archive_format in ('tar', 'tgz'):
|
|
||||||
import tarfile
|
|
||||||
mode = 'w'
|
|
||||||
if archive_format is 'tgz':
|
|
||||||
mode += '|gz'
|
|
||||||
return tarfile.open(filename, mode)
|
|
||||||
if archive_format is 'zip':
|
|
||||||
import zipfile
|
|
||||||
# Infuriatingly, Zipfile calls the "add" method "write", but they're otherwise identical,
|
|
||||||
# for our purposes. WrappedZipFile is a minimal adapter class.
|
|
||||||
class WrappedZipFile(zipfile.ZipFile):
|
|
||||||
def add(self, filename, arcname):
|
|
||||||
return self.write(filename, arcname)
|
|
||||||
return WrappedZipFile(filename, 'w', zipfile.ZIP_DEFLATED)
|
|
||||||
raise ValueError('Unsupported archive format "%s"' % archive_format)
|
|
||||||
|
|
||||||
def get_preferred_filename(input_filename, transformations):
|
|
||||||
for match, replace in transformations:
|
|
||||||
if input_filename.startswith(match):
|
|
||||||
return replace + input_filename[len(match):]
|
|
||||||
return input_filename
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main(sys.argv)
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
@ -1,143 +0,0 @@
|
||||||
"""Utility functions for SCons to discover and configure MongoDB modules.
|
|
||||||
|
|
||||||
A MongoDB module is an organized collection of source code and build rules that can be provided at
|
|
||||||
compile-time to alter or extend the behavior of MongoDB. The files comprising a single MongoDB
|
|
||||||
module are arranged in a directory hierarchy, rooted in a directory whose name is by convention the
|
|
||||||
module name, and containing in that root directory at least two files: a build.py file and a
|
|
||||||
SConscript file.
|
|
||||||
|
|
||||||
MongoDB modules are discovered by a call to the discover_modules() function, whose sole parameter is
|
|
||||||
the directory which is the immediate parent of all module directories. The exact directory is
|
|
||||||
chosen by the SConstruct file, which is the direct consumer of this python module. The only rule is
|
|
||||||
that it must be a subdirectory of the src/ directory, to correctly work with the SCons variant
|
|
||||||
directory system that separates build products for source.
|
|
||||||
|
|
||||||
Once discovered, modules are configured by the configure_modules() function, and the build system
|
|
||||||
integrates their SConscript files into the rest of the build.
|
|
||||||
|
|
||||||
MongoDB module build.py files implement a single function, configure(conf, env), which they may use
|
|
||||||
to configure the supplied "env" object. The configure functions may add extra LIBDEPS to mongod,
|
|
||||||
mongos and the mongo shell (TODO: other mongo tools and the C++ client), and through those libraries
|
|
||||||
alter those programs' behavior.
|
|
||||||
|
|
||||||
MongoDB module SConscript files can describe libraries, programs and unit tests, just as other
|
|
||||||
MongoDB SConscript files do.
|
|
||||||
"""
|
|
||||||
|
|
||||||
__all__ = ('discover_modules', 'configure_modules', 'register_module_test')
|
|
||||||
|
|
||||||
import imp
|
|
||||||
import inspect
|
|
||||||
import os
|
|
||||||
|
|
||||||
def discover_modules(module_root):
|
|
||||||
"""Scans module_root for subdirectories that look like MongoDB modules.
|
|
||||||
|
|
||||||
Returns a list of imported build.py module objects.
|
|
||||||
"""
|
|
||||||
found_modules = []
|
|
||||||
|
|
||||||
if not os.path.isdir(module_root):
|
|
||||||
return found_modules
|
|
||||||
|
|
||||||
for name in os.listdir(module_root):
|
|
||||||
root = os.path.join(module_root, name)
|
|
||||||
if name.startswith('.') or not os.path.isdir(root):
|
|
||||||
continue
|
|
||||||
|
|
||||||
build_py = os.path.join(root, 'build.py')
|
|
||||||
module = None
|
|
||||||
|
|
||||||
if os.path.isfile(build_py):
|
|
||||||
print "adding module: %s" % name
|
|
||||||
fp = open(build_py, "r")
|
|
||||||
try:
|
|
||||||
module = imp.load_module("module_" + name, fp, build_py,
|
|
||||||
(".py", "r", imp.PY_SOURCE))
|
|
||||||
if getattr(module, "name", None) is None:
|
|
||||||
module.name = name
|
|
||||||
found_modules.append(module)
|
|
||||||
finally:
|
|
||||||
fp.close()
|
|
||||||
|
|
||||||
return found_modules
|
|
||||||
|
|
||||||
def configure_modules(modules, conf, env):
|
|
||||||
""" Run the configure() function in the build.py python modules for each module in "modules"
|
|
||||||
(as created by discover_modules).
|
|
||||||
|
|
||||||
The configure() function should prepare the Mongo build system for building the module.
|
|
||||||
"""
|
|
||||||
for module in modules:
|
|
||||||
name = module.name
|
|
||||||
print "configuring module: %s" % name
|
|
||||||
|
|
||||||
root = os.path.dirname(module.__file__)
|
|
||||||
module.configure(conf, env)
|
|
||||||
|
|
||||||
def get_module_sconscripts(modules):
|
|
||||||
sconscripts = []
|
|
||||||
for m in modules:
|
|
||||||
module_dir_path = __get_src_relative_path(os.path.join(os.path.dirname(m.__file__)))
|
|
||||||
sconscripts.append(os.path.join(module_dir_path, 'SConscript'))
|
|
||||||
return sconscripts
|
|
||||||
|
|
||||||
def __get_src_relative_path(path):
|
|
||||||
"""Return a path relative to ./src.
|
|
||||||
|
|
||||||
The src directory is important because of its relationship to BUILD_DIR,
|
|
||||||
established in the SConstruct file. For variant directories to work properly
|
|
||||||
in SCons, paths relative to the src or BUILD_DIR must often be generated.
|
|
||||||
"""
|
|
||||||
src_dir = os.path.abspath('src')
|
|
||||||
path = os.path.abspath(os.path.normpath(path))
|
|
||||||
if not path.startswith(src_dir):
|
|
||||||
raise ValueError('Path "%s" is not relative to the src directory "%s"' % (path, src_dir))
|
|
||||||
result = path[len(src_dir) + 1:]
|
|
||||||
return result
|
|
||||||
|
|
||||||
def __get_module_path(module_frame_depth):
|
|
||||||
"""Return the path to the MongoDB module whose build.py is executing "module_frame_depth" frames
|
|
||||||
above this function, relative to the "src" directory.
|
|
||||||
"""
|
|
||||||
module_filename = inspect.stack()[module_frame_depth + 1][1]
|
|
||||||
return os.path.dirname(__get_src_relative_path(module_filename))
|
|
||||||
|
|
||||||
def __get_module_src_path(module_frame_depth):
|
|
||||||
"""Return the path relative to the SConstruct file of the MongoDB module's source tree.
|
|
||||||
|
|
||||||
module_frame_depth is the number of frames above the current one in which one can find a
|
|
||||||
function from the MongoDB module's build.py function.
|
|
||||||
"""
|
|
||||||
return os.path.join('src', __get_module_path(module_frame_depth + 1))
|
|
||||||
|
|
||||||
def __get_module_build_path(module_frame_depth):
|
|
||||||
"""Return the path relative to the SConstruct file of the MongoDB module's build tree.
|
|
||||||
|
|
||||||
module_frame_depth is the number of frames above the current one in which one can find a
|
|
||||||
function from the MongoDB module's build.py function.
|
|
||||||
"""
|
|
||||||
return os.path.join('$BUILD_DIR', __get_module_path(module_frame_depth + 1))
|
|
||||||
|
|
||||||
def get_current_module_src_path():
|
|
||||||
"""Return the path relative to the SConstruct file of the current MongoDB module's source tree.
|
|
||||||
|
|
||||||
May only meaningfully be called from within build.py
|
|
||||||
"""
|
|
||||||
return __get_module_src_path(1)
|
|
||||||
|
|
||||||
def get_current_module_build_path():
|
|
||||||
"""Return the path relative to the SConstruct file of the current MongoDB module's build tree.
|
|
||||||
|
|
||||||
May only meaningfully be called from within build.py
|
|
||||||
"""
|
|
||||||
|
|
||||||
return __get_module_build_path(1)
|
|
||||||
|
|
||||||
def get_current_module_libdep_name(libdep_rel_path):
|
|
||||||
"""Return a $BUILD_DIR relative path to a "libdep_rel_path", where "libdep_rel_path"
|
|
||||||
is specified relative to the MongoDB module's build.py file.
|
|
||||||
|
|
||||||
May only meaningfully be called from within build.py
|
|
||||||
"""
|
|
||||||
return os.path.join(__get_module_build_path(1), libdep_rel_path)
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,55 +0,0 @@
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import time
|
|
||||||
|
|
||||||
sys.path.append( "." )
|
|
||||||
sys.path.append( ".." )
|
|
||||||
sys.path.append( "../../" )
|
|
||||||
sys.path.append( "../../../" )
|
|
||||||
|
|
||||||
import simples3
|
|
||||||
import settings
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
# check s3 for md5 hashes
|
|
||||||
|
|
||||||
def check_dir( bucket , prefix , todel ):
|
|
||||||
|
|
||||||
deleteAll = False
|
|
||||||
|
|
||||||
for ( key , modify , etag , size ) in bucket.listdir( prefix=prefix ):
|
|
||||||
if key.find( todel ) < 0:
|
|
||||||
continue
|
|
||||||
print( key )
|
|
||||||
|
|
||||||
if not deleteAll:
|
|
||||||
|
|
||||||
val = raw_input( "Delete (Y,y,n,N):" ).strip()
|
|
||||||
|
|
||||||
if val == "n":
|
|
||||||
print( "skipping this one" )
|
|
||||||
continue
|
|
||||||
elif val == "N":
|
|
||||||
break
|
|
||||||
|
|
||||||
if val == "Y":
|
|
||||||
val = "y"
|
|
||||||
deleteAll = True
|
|
||||||
|
|
||||||
if val != "y":
|
|
||||||
raise Exception( "invalid input :(" )
|
|
||||||
|
|
||||||
bucket.delete( key )
|
|
||||||
|
|
||||||
def clean( todel ):
|
|
||||||
|
|
||||||
|
|
||||||
bucket = simples3.S3Bucket( settings.bucket , settings.id , settings.key )
|
|
||||||
|
|
||||||
for x in [ "osx" , "linux" , "win32" , "sunos5" , "src" ]:
|
|
||||||
check_dir( bucket , x , todel )
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
clean( sys.argv[1] )
|
|
||||||
|
|
@ -1,48 +0,0 @@
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
sys.path.append( "." )
|
|
||||||
sys.path.append( ".." )
|
|
||||||
sys.path.append( "../../" )
|
|
||||||
sys.path.append( "../../../" )
|
|
||||||
|
|
||||||
import simples3
|
|
||||||
import settings
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
# check s3 for md5 hashes
|
|
||||||
|
|
||||||
def check_dir( bucket , prefix ):
|
|
||||||
|
|
||||||
zips = {}
|
|
||||||
md5s = {}
|
|
||||||
for ( key , modify , etag , size ) in bucket.listdir( prefix=prefix ):
|
|
||||||
if key.endswith( ".tgz" ) or key.endswith( ".zip" ) or key.endswith( ".tar.gz" ):
|
|
||||||
zips[key] = etag.replace( '"' , '' )
|
|
||||||
elif key.endswith( ".md5" ):
|
|
||||||
md5s[key] = True
|
|
||||||
elif key.find( "$folder$" ) > 0:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
print( "unknown file type: " + key )
|
|
||||||
|
|
||||||
for x in zips:
|
|
||||||
m = x + ".md5"
|
|
||||||
if m in md5s:
|
|
||||||
continue
|
|
||||||
|
|
||||||
print( "need to do: " + x + " " + zips[x] + " to " + m )
|
|
||||||
bucket.put( m , zips[x] , acl="public-read" )
|
|
||||||
|
|
||||||
|
|
||||||
def run():
|
|
||||||
|
|
||||||
bucket = simples3.S3Bucket( settings.bucket , settings.id , settings.key )
|
|
||||||
|
|
||||||
for x in [ "osx" , "linux" , "win32" , "sunos5" , "src" ]:
|
|
||||||
check_dir( bucket , x )
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
run()
|
|
||||||
|
|
@ -1,181 +0,0 @@
|
||||||
#!/usr/bin/python
|
|
||||||
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
import tempfile
|
|
||||||
import urllib2
|
|
||||||
import subprocess
|
|
||||||
import tarfile
|
|
||||||
import shutil
|
|
||||||
import errno
|
|
||||||
# To ensure it exists on the system
|
|
||||||
import gzip
|
|
||||||
|
|
||||||
#
|
|
||||||
# Useful script for installing multiple versions of MongoDB on a machine
|
|
||||||
# Only really tested/works on Linux.
|
|
||||||
#
|
|
||||||
|
|
||||||
class MultiVersionDownloader :
|
|
||||||
|
|
||||||
def __init__(self, install_dir, link_dir, platform):
|
|
||||||
self.install_dir = install_dir
|
|
||||||
self.link_dir = link_dir
|
|
||||||
match = re.compile("(.*)\/(.*)").match(platform)
|
|
||||||
self.platform = match.group(1)
|
|
||||||
self.arch = match.group(2)
|
|
||||||
self.links = self.download_links()
|
|
||||||
|
|
||||||
def download_links(self):
|
|
||||||
href = "http://dl.mongodb.org/dl/%s/%s" \
|
|
||||||
% (self.platform.lower(), self.arch)
|
|
||||||
|
|
||||||
html = urllib2.urlopen(href).read()
|
|
||||||
|
|
||||||
links = {}
|
|
||||||
for line in html.split():
|
|
||||||
match = re.compile("http:\/\/downloads\.mongodb\.org\/%s/mongodb-%s-%s-([^\"]*)\.tgz" \
|
|
||||||
% (self.platform.lower(), self.platform.lower(), self.arch)).search(line)
|
|
||||||
|
|
||||||
if match == None: continue
|
|
||||||
|
|
||||||
link = match.group(0)
|
|
||||||
version = match.group(1)
|
|
||||||
links[version] = link
|
|
||||||
|
|
||||||
return links
|
|
||||||
|
|
||||||
def download_version(self, version):
|
|
||||||
|
|
||||||
try:
|
|
||||||
os.makedirs(self.install_dir)
|
|
||||||
except OSError as exc:
|
|
||||||
if exc.errno == errno.EEXIST and os.path.isdir(self.install_dir):
|
|
||||||
pass
|
|
||||||
else: raise
|
|
||||||
|
|
||||||
urls = []
|
|
||||||
for link_version, link_url in self.links.iteritems():
|
|
||||||
if link_version.startswith(version):
|
|
||||||
# If we have a "-" in our version, exact match only
|
|
||||||
if version.find("-") >= 0:
|
|
||||||
if link_version != version: continue
|
|
||||||
elif link_version.find("-") >= 0:
|
|
||||||
continue
|
|
||||||
|
|
||||||
urls.append((link_version, link_url))
|
|
||||||
|
|
||||||
if len(urls) == 0:
|
|
||||||
raise Exception("Cannot find a link for version %s, versions %s found." \
|
|
||||||
% (version, self.links))
|
|
||||||
|
|
||||||
urls.sort()
|
|
||||||
full_version = urls[-1][0]
|
|
||||||
url = urls[-1][1]
|
|
||||||
|
|
||||||
temp_dir = tempfile.mkdtemp()
|
|
||||||
temp_file = tempfile.mktemp(suffix=".tgz")
|
|
||||||
|
|
||||||
data = urllib2.urlopen(url)
|
|
||||||
|
|
||||||
print "Downloading data for version %s (%s)..." % (version, full_version)
|
|
||||||
|
|
||||||
with open(temp_file, 'wb') as f:
|
|
||||||
f.write(data.read())
|
|
||||||
print "Uncompressing data for version %s (%s)..." % (version, full_version)
|
|
||||||
|
|
||||||
# Can't use cool with syntax b/c of python 2.6
|
|
||||||
tf = tarfile.open(temp_file, 'r:gz')
|
|
||||||
|
|
||||||
try:
|
|
||||||
tf.extractall(path=temp_dir)
|
|
||||||
except:
|
|
||||||
tf.close()
|
|
||||||
raise
|
|
||||||
|
|
||||||
tf.close()
|
|
||||||
|
|
||||||
extract_dir = os.listdir(temp_dir)[0]
|
|
||||||
temp_install_dir = os.path.join(temp_dir, extract_dir)
|
|
||||||
|
|
||||||
shutil.move(temp_install_dir, self.install_dir)
|
|
||||||
|
|
||||||
shutil.rmtree(temp_dir)
|
|
||||||
os.remove(temp_file)
|
|
||||||
|
|
||||||
self.symlink_version(version, os.path.abspath(os.path.join(self.install_dir, extract_dir)))
|
|
||||||
|
|
||||||
|
|
||||||
def symlink_version(self, version, installed_dir):
|
|
||||||
|
|
||||||
try:
|
|
||||||
os.makedirs(self.link_dir)
|
|
||||||
except OSError as exc:
|
|
||||||
if exc.errno == errno.EEXIST and os.path.isdir(self.link_dir):
|
|
||||||
pass
|
|
||||||
else: raise
|
|
||||||
|
|
||||||
for executable in os.listdir(os.path.join(installed_dir, "bin")):
|
|
||||||
|
|
||||||
link_name = "%s-%s" % (executable, version)
|
|
||||||
|
|
||||||
os.symlink(os.path.join(installed_dir, "bin", executable),\
|
|
||||||
os.path.join(self.link_dir, link_name))
|
|
||||||
|
|
||||||
|
|
||||||
CL_HELP_MESSAGE = \
|
|
||||||
"""
|
|
||||||
Downloads and installs particular mongodb versions into an install directory and symlinks the binaries with versions to
|
|
||||||
another directory.
|
|
||||||
|
|
||||||
Usage: install_multiversion_mongodb.sh INSTALL_DIR LINK_DIR PLATFORM_AND_ARCH VERSION1 [VERSION2 VERSION3 ...]
|
|
||||||
|
|
||||||
Ex: install_multiversion_mongodb.sh ./install ./link "Linux/x86_64" "2.0.6" "2.0.3-rc0" "2.0" "2.2" "2.3"
|
|
||||||
|
|
||||||
If "rc" is included in the version name, we'll use the exact rc, otherwise we'll pull the highest non-rc
|
|
||||||
version compatible with the version specified.
|
|
||||||
"""
|
|
||||||
|
|
||||||
def parse_cl_args(args):
|
|
||||||
|
|
||||||
def raise_exception(msg):
|
|
||||||
print CL_HELP_MESSAGE
|
|
||||||
raise Exception(msg)
|
|
||||||
|
|
||||||
if len(args) == 0: raise_exception("Missing INSTALL_DIR")
|
|
||||||
|
|
||||||
install_dir = args[0]
|
|
||||||
|
|
||||||
args = args[1:]
|
|
||||||
if len(args) == 0: raise_exception("Missing LINK_DIR")
|
|
||||||
|
|
||||||
link_dir = args[0]
|
|
||||||
|
|
||||||
args = args[1:]
|
|
||||||
if len(args) == 0: raise_exception("Missing PLATFORM_AND_ARCH")
|
|
||||||
|
|
||||||
platform = args[0]
|
|
||||||
|
|
||||||
args = args[1:]
|
|
||||||
if re.compile(".*\/.*").match(platform) == None:
|
|
||||||
raise_exception("PLATFORM_AND_ARCH isn't of the correct format")
|
|
||||||
|
|
||||||
if len(args) == 0: raise_exception("Missing VERSION1")
|
|
||||||
|
|
||||||
versions = args
|
|
||||||
|
|
||||||
return (MultiVersionDownloader(install_dir, link_dir, platform), versions)
|
|
||||||
|
|
||||||
def main():
|
|
||||||
|
|
||||||
downloader, versions = parse_cl_args(sys.argv[1:])
|
|
||||||
|
|
||||||
for version in versions:
|
|
||||||
downloader.download_version(version)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,77 +0,0 @@
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
sys.path.append( "." )
|
|
||||||
sys.path.append( ".." )
|
|
||||||
sys.path.append( "../../" )
|
|
||||||
sys.path.append( "../../../" )
|
|
||||||
|
|
||||||
import simples3
|
|
||||||
import settings
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
# this pushes all source balls as tgz and zip
|
|
||||||
|
|
||||||
def run_git( args ):
|
|
||||||
cmd = "git " + args
|
|
||||||
cmd = cmd.split( " " )
|
|
||||||
x = subprocess.Popen( ( "git " + args ).split( " " ) , stdout=subprocess.PIPE).communicate()
|
|
||||||
return x[0]
|
|
||||||
|
|
||||||
def push_tag( bucket , tag , extension , gzip=False ):
|
|
||||||
localName = "mongodb-src-" + tag + "." + extension
|
|
||||||
remoteName = "src/" + localName
|
|
||||||
if gzip:
|
|
||||||
remoteName += ".gz"
|
|
||||||
for ( key , modify , etag , size ) in bucket.listdir( prefix=remoteName ):
|
|
||||||
print( "found old: " + key + " uploaded on: " + str( modify ) )
|
|
||||||
return
|
|
||||||
|
|
||||||
if os.path.exists( localName ):
|
|
||||||
os.remove( localName )
|
|
||||||
|
|
||||||
print( "need to do: " + remoteName )
|
|
||||||
|
|
||||||
cmd = "archive --format %s --output %s --prefix mongodb-src-%s/ %s" % ( extension , localName , tag , tag )
|
|
||||||
run_git( cmd )
|
|
||||||
|
|
||||||
print( "\t" + cmd )
|
|
||||||
|
|
||||||
if not os.path.exists( localName ) or os.path.getsize(localName) == 0 :
|
|
||||||
raise( Exception( "creating archive failed: " + cmd ) )
|
|
||||||
|
|
||||||
if gzip:
|
|
||||||
newLocalName = localName + ".gz"
|
|
||||||
if ( os.path.exists( newLocalName ) ):
|
|
||||||
os.remove( newLocalName )
|
|
||||||
subprocess.call( [ "gzip" , localName ] )
|
|
||||||
localName = newLocalName
|
|
||||||
|
|
||||||
if not os.path.exists( localName ) or os.path.getsize(localName) == 0 :
|
|
||||||
raise( Exception( "gzipping failed" ) )
|
|
||||||
|
|
||||||
bucket.put( remoteName , open( localName , "rb" ).read() , acl="public-read" )
|
|
||||||
print( "\t uploaded to: http://s3.amazonaws.com/%s/%s" % ( bucket.name , remoteName ) )
|
|
||||||
|
|
||||||
os.remove( localName )
|
|
||||||
|
|
||||||
|
|
||||||
def push_all( filter=None):
|
|
||||||
tags = run_git("tag -l").strip().split( "\n" )
|
|
||||||
|
|
||||||
bucket = simples3.S3Bucket( settings.bucket , settings.id , settings.key )
|
|
||||||
|
|
||||||
for tag in tags:
|
|
||||||
if filter and tag.find( filter ) < 0:
|
|
||||||
print( "skipping %s because it doesn't match filter %s" % ( tag, filter ) )
|
|
||||||
continue
|
|
||||||
push_tag( bucket , tag , "tar" , True )
|
|
||||||
push_tag( bucket , tag , "zip" )
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
filter = None
|
|
||||||
if len(sys.argv) > 1:
|
|
||||||
filter = sys.argv[1]
|
|
||||||
print( "filter: %s" % filter )
|
|
||||||
push_all(filter)
|
|
||||||
|
|
@ -1,239 +0,0 @@
|
||||||
# Copyright 2009 10gen, Inc.
|
|
||||||
#
|
|
||||||
# This file is part of MongoDB.
|
|
||||||
#
|
|
||||||
# MongoDB is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU Affero General Public License as published by
|
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# MongoDB is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU Affero General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
|
||||||
# along with MongoDB. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
"""Tests for the MongoDB shell.
|
|
||||||
|
|
||||||
Right now these mostly just test that the shell handles command line arguments
|
|
||||||
appropriately.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import unittest
|
|
||||||
import sys
|
|
||||||
import subprocess
|
|
||||||
import os
|
|
||||||
|
|
||||||
"""Exit codes for MongoDB."""
|
|
||||||
BADOPTS = 2
|
|
||||||
NOCONNECT = 255
|
|
||||||
|
|
||||||
"""Path to the mongo shell executable to be tested."""
|
|
||||||
mongo_path = None
|
|
||||||
|
|
||||||
class TestShell(unittest.TestCase):
|
|
||||||
|
|
||||||
def open_mongo(self, args=[]):
|
|
||||||
"""Get a subprocess.Popen instance of the shell with the given args.
|
|
||||||
"""
|
|
||||||
return subprocess.Popen([mongo_path] + args,
|
|
||||||
stdin=subprocess.PIPE,
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr = subprocess.PIPE)
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
assert mongo_path
|
|
||||||
|
|
||||||
def test_help(self):
|
|
||||||
mongo_h = self.open_mongo(["-h"])
|
|
||||||
mongo_help = self.open_mongo(["--help"])
|
|
||||||
|
|
||||||
out = mongo_h.communicate()
|
|
||||||
self.assertEqual(out, mongo_help.communicate())
|
|
||||||
self.assert_("usage:" in out[0])
|
|
||||||
|
|
||||||
self.assertEqual(0, mongo_h.returncode)
|
|
||||||
self.assertEqual(0, mongo_help.returncode)
|
|
||||||
|
|
||||||
def test_nodb(self):
|
|
||||||
mongo = self.open_mongo([])
|
|
||||||
mongo_nodb = self.open_mongo(["--nodb"])
|
|
||||||
|
|
||||||
out = mongo_nodb.communicate()
|
|
||||||
self.assert_("MongoDB shell version" in out[0])
|
|
||||||
self.assert_("bye" in out[0])
|
|
||||||
self.assert_("couldn't connect" not in out[0])
|
|
||||||
self.assertEqual(0, mongo_nodb.returncode)
|
|
||||||
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assert_("MongoDB shell version" in out[0])
|
|
||||||
self.assert_("bye" not in out[0])
|
|
||||||
self.assert_("couldn't connect" in out[0])
|
|
||||||
self.assertEqual(NOCONNECT, mongo.returncode)
|
|
||||||
|
|
||||||
def test_eval(self):
|
|
||||||
mongo = self.open_mongo(["--nodb", "--eval", "print('hello world');"])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assert_("hello world" in out[0])
|
|
||||||
self.assert_("bye" not in out[0])
|
|
||||||
self.assertEqual(0, mongo.returncode)
|
|
||||||
|
|
||||||
mongo = self.open_mongo(["--eval"])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assert_("required parameter is missing" in out[0])
|
|
||||||
self.assertEqual(BADOPTS, mongo.returncode)
|
|
||||||
|
|
||||||
def test_shell(self):
|
|
||||||
mongo = self.open_mongo(["--nodb", "--shell", "--eval", "print('hello world');"])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assert_("hello world" in out[0])
|
|
||||||
self.assert_("bye" in out[0]) # the shell started and immediately exited because stdin was empty
|
|
||||||
self.assertEqual(0, mongo.returncode)
|
|
||||||
|
|
||||||
def test_host_port(self):
|
|
||||||
mongo = self.open_mongo([])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assert_("url: test" in out[0])
|
|
||||||
self.assert_("connecting to: test" in out[0])
|
|
||||||
self.assertEqual(NOCONNECT, mongo.returncode)
|
|
||||||
|
|
||||||
mongo = self.open_mongo(["--host", "localhost"])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assert_("url: test" in out[0])
|
|
||||||
self.assert_("connecting to: localhost/test" in out[0])
|
|
||||||
self.assertEqual(NOCONNECT, mongo.returncode)
|
|
||||||
|
|
||||||
mongo = self.open_mongo(["--port", "27018"])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assert_("url: test" in out[0])
|
|
||||||
self.assert_("connecting to: 127.0.0.1:27018" in out[0])
|
|
||||||
self.assertEqual(NOCONNECT, mongo.returncode)
|
|
||||||
|
|
||||||
mongo = self.open_mongo(["--host", "localhost", "--port", "27018"])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assert_("url: test" in out[0])
|
|
||||||
self.assert_("connecting to: localhost:27018/test" in out[0])
|
|
||||||
self.assertEqual(NOCONNECT, mongo.returncode)
|
|
||||||
|
|
||||||
mongo = self.open_mongo(["--host"])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assert_("required parameter is missing" in out[0])
|
|
||||||
self.assertEqual(BADOPTS, mongo.returncode)
|
|
||||||
|
|
||||||
mongo = self.open_mongo(["--port"])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assert_("required parameter is missing" in out[0])
|
|
||||||
self.assertEqual(BADOPTS, mongo.returncode)
|
|
||||||
|
|
||||||
def test_positionals(self):
|
|
||||||
dirname = os.path.dirname(__file__)
|
|
||||||
test_js = os.path.join(dirname, "testdata/test.js")
|
|
||||||
test_txt = os.path.join(dirname, "testdata/test.txt")
|
|
||||||
test = os.path.join(dirname, "testdata/test")
|
|
||||||
non_exist_js = os.path.join(dirname, "testdata/nonexist.js")
|
|
||||||
non_exist_txt = os.path.join(dirname, "testdata/nonexist.txt")
|
|
||||||
|
|
||||||
mongo = self.open_mongo(["--nodb", test_js])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assert_("hello world" in out[0])
|
|
||||||
self.assert_("bye" not in out[0])
|
|
||||||
self.assertEqual(0, mongo.returncode)
|
|
||||||
|
|
||||||
mongo = self.open_mongo(["--nodb", test_txt])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assert_("foobar" in out[0])
|
|
||||||
self.assert_("bye" not in out[0])
|
|
||||||
self.assertEqual(0, mongo.returncode)
|
|
||||||
|
|
||||||
mongo = self.open_mongo([test_js, test, test_txt])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assert_("url: test" in out[0])
|
|
||||||
self.assert_("connecting to: test" in out[0])
|
|
||||||
self.assertEqual(NOCONNECT, mongo.returncode)
|
|
||||||
|
|
||||||
mongo = self.open_mongo([test_txt, test, test_js])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assert_("url: test" in out[0])
|
|
||||||
self.assert_("connecting to: test" in out[0])
|
|
||||||
self.assertEqual(NOCONNECT, mongo.returncode)
|
|
||||||
|
|
||||||
mongo = self.open_mongo([test, test_js, test_txt])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assert_("url: " + test in out[0])
|
|
||||||
self.assert_("connecting to: " + test in out[0])
|
|
||||||
self.assertEqual(NOCONNECT, mongo.returncode)
|
|
||||||
|
|
||||||
mongo = self.open_mongo([non_exist_js, test, test_txt])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assert_("url: test" in out[0])
|
|
||||||
self.assert_("connecting to: test" in out[0])
|
|
||||||
self.assertEqual(NOCONNECT, mongo.returncode)
|
|
||||||
|
|
||||||
mongo = self.open_mongo([non_exist_txt, test_js, test_txt])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assert_("url: " + non_exist_txt in out[0])
|
|
||||||
self.assert_("connecting to: " + non_exist_txt in out[0])
|
|
||||||
self.assertEqual(NOCONNECT, mongo.returncode)
|
|
||||||
|
|
||||||
def test_multiple_files(self):
|
|
||||||
dirname = os.path.dirname(__file__)
|
|
||||||
test_js = os.path.join(dirname, "testdata/test.js")
|
|
||||||
test_txt = os.path.join(dirname, "testdata/test.txt")
|
|
||||||
|
|
||||||
mongo = self.open_mongo(["--nodb", test_js, test_txt])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assert_("hello world" in out[0])
|
|
||||||
self.assert_("foobar" in out[0])
|
|
||||||
self.assert_("bye" not in out[0])
|
|
||||||
self.assertEqual(0, mongo.returncode)
|
|
||||||
|
|
||||||
mongo = self.open_mongo(["--shell", "--nodb", test_js, test_txt])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assert_("hello world" in out[0])
|
|
||||||
self.assert_("foobar" in out[0])
|
|
||||||
self.assert_("bye" in out[0])
|
|
||||||
self.assertEqual(0, mongo.returncode)
|
|
||||||
|
|
||||||
# just testing that they don't blow up
|
|
||||||
def test_username_and_password(self):
|
|
||||||
mongo = self.open_mongo(["--username", "mike"])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assertEqual(NOCONNECT, mongo.returncode)
|
|
||||||
|
|
||||||
mongo = self.open_mongo(["-u", "mike"])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assertEqual(NOCONNECT, mongo.returncode)
|
|
||||||
|
|
||||||
mongo = self.open_mongo(["--password", "mike"])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assertEqual(NOCONNECT, mongo.returncode)
|
|
||||||
|
|
||||||
mongo = self.open_mongo(["-p", "mike"])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assertEqual(NOCONNECT, mongo.returncode)
|
|
||||||
|
|
||||||
mongo = self.open_mongo(["--username"])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assert_("required parameter is missing" in out[0])
|
|
||||||
self.assertEqual(BADOPTS, mongo.returncode)
|
|
||||||
|
|
||||||
mongo = self.open_mongo(["--password"])
|
|
||||||
out = mongo.communicate()
|
|
||||||
self.assert_("required parameter is missing" in out[0])
|
|
||||||
self.assertEqual(BADOPTS, mongo.returncode)
|
|
||||||
|
|
||||||
|
|
||||||
def run_tests():
|
|
||||||
suite = unittest.TestLoader().loadTestsFromTestCase(TestShell)
|
|
||||||
unittest.TextTestRunner(verbosity=1).run(suite)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
if len(sys.argv) != 2:
|
|
||||||
print "must give the path to shell executable to be tested"
|
|
||||||
sys.exit()
|
|
||||||
|
|
||||||
mongo_path = sys.argv[1]
|
|
||||||
run_tests()
|
|
||||||
1
buildscripts/testdata/test.js
vendored
1
buildscripts/testdata/test.js
vendored
|
|
@ -1 +0,0 @@
|
||||||
print("hello world");
|
|
||||||
1
buildscripts/testdata/test.txt
vendored
1
buildscripts/testdata/test.txt
vendored
|
|
@ -1 +0,0 @@
|
||||||
print("foobar");
|
|
||||||
|
|
@ -1,230 +0,0 @@
|
||||||
|
|
||||||
import codecs
|
|
||||||
import re
|
|
||||||
import socket
|
|
||||||
import time
|
|
||||||
import os
|
|
||||||
import os.path
|
|
||||||
import itertools
|
|
||||||
import subprocess
|
|
||||||
import sys
|
|
||||||
import hashlib
|
|
||||||
|
|
||||||
# various utilities that are handy
|
|
||||||
|
|
||||||
def getAllSourceFiles( arr=None , prefix="." ):
|
|
||||||
if arr is None:
|
|
||||||
arr = []
|
|
||||||
|
|
||||||
if not os.path.isdir( prefix ):
|
|
||||||
# assume a file
|
|
||||||
arr.append( prefix )
|
|
||||||
return arr
|
|
||||||
|
|
||||||
for x in os.listdir( prefix ):
|
|
||||||
if x.startswith( "." ) or x.startswith( "pcre-" ) or x.startswith( "32bit" ) or x.startswith( "mongodb-" ) or x.startswith("debian") or x.startswith( "mongo-cxx-driver" ):
|
|
||||||
continue
|
|
||||||
full = prefix + "/" + x
|
|
||||||
if os.path.isdir( full ) and not os.path.islink( full ):
|
|
||||||
getAllSourceFiles( arr , full )
|
|
||||||
else:
|
|
||||||
if full.endswith( ".cpp" ) or full.endswith( ".h" ) or full.endswith( ".c" ):
|
|
||||||
full = full.replace( "//" , "/" )
|
|
||||||
arr.append( full )
|
|
||||||
|
|
||||||
return arr
|
|
||||||
|
|
||||||
|
|
||||||
def getGitBranch():
|
|
||||||
if not os.path.exists( ".git" ):
|
|
||||||
return None
|
|
||||||
|
|
||||||
version = open( ".git/HEAD" ,'r' ).read().strip()
|
|
||||||
if not version.startswith( "ref: " ):
|
|
||||||
return version
|
|
||||||
version = version.split( "/" )
|
|
||||||
version = version[len(version)-1]
|
|
||||||
return version
|
|
||||||
|
|
||||||
def getGitBranchString( prefix="" , postfix="" ):
|
|
||||||
t = re.compile( '[/\\\]' ).split( os.getcwd() )
|
|
||||||
if len(t) > 2 and t[len(t)-1] == "mongo":
|
|
||||||
par = t[len(t)-2]
|
|
||||||
m = re.compile( ".*_([vV]\d+\.\d+)$" ).match( par )
|
|
||||||
if m is not None:
|
|
||||||
return prefix + m.group(1).lower() + postfix
|
|
||||||
if par.find("Nightly") > 0:
|
|
||||||
return ""
|
|
||||||
|
|
||||||
|
|
||||||
b = getGitBranch()
|
|
||||||
if b == None or b == "master":
|
|
||||||
return ""
|
|
||||||
return prefix + b + postfix
|
|
||||||
|
|
||||||
def getGitVersion():
|
|
||||||
if not os.path.exists( ".git" ):
|
|
||||||
return "nogitversion"
|
|
||||||
|
|
||||||
version = open( ".git/HEAD" ,'r' ).read().strip()
|
|
||||||
if not version.startswith( "ref: " ):
|
|
||||||
return version
|
|
||||||
version = version[5:]
|
|
||||||
f = ".git/" + version
|
|
||||||
if not os.path.exists( f ):
|
|
||||||
return version
|
|
||||||
return open( f , 'r' ).read().strip()
|
|
||||||
|
|
||||||
def execsys( args ):
|
|
||||||
import subprocess
|
|
||||||
if isinstance( args , str ):
|
|
||||||
r = re.compile( "\s+" )
|
|
||||||
args = r.split( args )
|
|
||||||
p = subprocess.Popen( args , stdout=subprocess.PIPE , stderr=subprocess.PIPE )
|
|
||||||
r = p.communicate()
|
|
||||||
return r;
|
|
||||||
|
|
||||||
def getprocesslist():
|
|
||||||
raw = ""
|
|
||||||
try:
|
|
||||||
raw = execsys( "/bin/ps -ax" )[0]
|
|
||||||
except Exception,e:
|
|
||||||
print( "can't get processlist: " + str( e ) )
|
|
||||||
|
|
||||||
r = re.compile( "[\r\n]+" )
|
|
||||||
return r.split( raw )
|
|
||||||
|
|
||||||
def removeIfInList( lst , thing ):
|
|
||||||
if thing in lst:
|
|
||||||
lst.remove( thing )
|
|
||||||
|
|
||||||
def findVersion( root , choices ):
|
|
||||||
for c in choices:
|
|
||||||
if ( os.path.exists( root + c ) ):
|
|
||||||
return root + c
|
|
||||||
raise "can't find a version of [" + root + "] choices: " + choices
|
|
||||||
|
|
||||||
def choosePathExist( choices , default=None):
|
|
||||||
for c in choices:
|
|
||||||
if c != None and os.path.exists( c ):
|
|
||||||
return c
|
|
||||||
return default
|
|
||||||
|
|
||||||
def filterExists(paths):
|
|
||||||
return filter(os.path.exists, paths)
|
|
||||||
|
|
||||||
def ensureDir( name ):
|
|
||||||
d = os.path.dirname( name )
|
|
||||||
if not os.path.exists( d ):
|
|
||||||
print( "Creating dir: " + name );
|
|
||||||
os.makedirs( d )
|
|
||||||
if not os.path.exists( d ):
|
|
||||||
raise "Failed to create dir: " + name
|
|
||||||
|
|
||||||
|
|
||||||
def distinctAsString( arr ):
|
|
||||||
s = set()
|
|
||||||
for x in arr:
|
|
||||||
s.add( str(x) )
|
|
||||||
return list(s)
|
|
||||||
|
|
||||||
def checkMongoPort( port=27017 ):
|
|
||||||
sock = socket.socket()
|
|
||||||
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
|
|
||||||
sock.settimeout(1)
|
|
||||||
sock.connect(("localhost", port))
|
|
||||||
sock.close()
|
|
||||||
|
|
||||||
|
|
||||||
def didMongodStart( port=27017 , timeout=20 ):
|
|
||||||
while timeout > 0:
|
|
||||||
time.sleep( 1 )
|
|
||||||
try:
|
|
||||||
checkMongoPort( port )
|
|
||||||
return True
|
|
||||||
except Exception,e:
|
|
||||||
print( e )
|
|
||||||
timeout = timeout - 1
|
|
||||||
return False
|
|
||||||
|
|
||||||
def which(executable):
|
|
||||||
if sys.platform == 'win32':
|
|
||||||
paths = os.environ.get('Path', '').split(';')
|
|
||||||
else:
|
|
||||||
paths = os.environ.get('PATH', '').split(':')
|
|
||||||
|
|
||||||
for path in paths:
|
|
||||||
path = os.path.expandvars(path)
|
|
||||||
path = os.path.expanduser(path)
|
|
||||||
path = os.path.abspath(path)
|
|
||||||
executable_path = os.path.join(path, executable)
|
|
||||||
if os.path.exists(executable_path):
|
|
||||||
return executable_path
|
|
||||||
|
|
||||||
return executable
|
|
||||||
|
|
||||||
def md5sum( file ):
|
|
||||||
#TODO error handling, etc..
|
|
||||||
return execsys( "md5sum " + file )[0].partition(" ")[0]
|
|
||||||
|
|
||||||
def md5string( a_string ):
|
|
||||||
return hashlib.md5(a_string).hexdigest()
|
|
||||||
|
|
||||||
def find_python(min_version=(2, 5)):
|
|
||||||
try:
|
|
||||||
if sys.version_info >= min_version:
|
|
||||||
return sys.executable
|
|
||||||
except AttributeError:
|
|
||||||
# In case the version of Python is somehow missing sys.version_info or sys.executable.
|
|
||||||
pass
|
|
||||||
|
|
||||||
version = re.compile(r'[Pp]ython ([\d\.]+)', re.MULTILINE)
|
|
||||||
binaries = ('python27', 'python2.7', 'python26', 'python2.6', 'python25', 'python2.5', 'python')
|
|
||||||
for binary in binaries:
|
|
||||||
try:
|
|
||||||
out, err = subprocess.Popen([binary, '-V'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
|
|
||||||
for stream in (out, err):
|
|
||||||
match = version.search(stream)
|
|
||||||
if match:
|
|
||||||
versiontuple = tuple(map(int, match.group(1).split('.')))
|
|
||||||
if versiontuple >= min_version:
|
|
||||||
return which(binary)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
raise Exception('could not find suitable Python (version >= %s)' % '.'.join(str(v) for v in min_version))
|
|
||||||
|
|
||||||
def smoke_command(*args):
|
|
||||||
# return a list of arguments that comprises a complete
|
|
||||||
# invocation of smoke.py
|
|
||||||
here = os.path.dirname(__file__)
|
|
||||||
smoke_py = os.path.abspath(os.path.join(here, 'smoke.py'))
|
|
||||||
# the --with-cleanbb argument causes smoke.py to run
|
|
||||||
# buildscripts/cleanbb.py before each test phase; this
|
|
||||||
# prevents us from running out of disk space on slaves
|
|
||||||
return [find_python(), smoke_py, '--with-cleanbb'] + list(args)
|
|
||||||
|
|
||||||
def run_smoke_command(*args):
|
|
||||||
# to run a command line script from a scons Alias (or any
|
|
||||||
# Action), the command sequence must be enclosed in a list,
|
|
||||||
# otherwise SCons treats it as a list of dependencies.
|
|
||||||
return [smoke_command(*args)]
|
|
||||||
|
|
||||||
# unicode is a pain. some strings cannot be unicode()'d
|
|
||||||
# but we want to just preserve the bytes in a human-readable
|
|
||||||
# fashion. this codec error handler will substitute the
|
|
||||||
# repr() of the offending bytes into the decoded string
|
|
||||||
# at the position they occurred
|
|
||||||
def replace_with_repr(unicode_error):
|
|
||||||
offender = unicode_error.object[unicode_error.start:unicode_error.end]
|
|
||||||
return (unicode(repr(offender).strip("'").strip('"')), unicode_error.end)
|
|
||||||
|
|
||||||
codecs.register_error('repr', replace_with_repr)
|
|
||||||
|
|
||||||
def unicode_dammit(string, encoding='utf8'):
|
|
||||||
# convert a string to a unicode, using the Python
|
|
||||||
# representation of non-ascii bytes when necessary
|
|
||||||
#
|
|
||||||
# name inpsired by BeautifulSoup's "UnicodeDammit"
|
|
||||||
return string.decode(encoding, 'repr')
|
|
||||||
|
|
||||||
17
debian/README.Debian
vendored
17
debian/README.Debian
vendored
|
|
@ -1,17 +0,0 @@
|
||||||
MongoDB for Debian
|
|
||||||
------------------
|
|
||||||
|
|
||||||
Binds only to localhost
|
|
||||||
|
|
||||||
As mongo needs some tuning to become secure, it binds to localhost by
|
|
||||||
default. You can change this behavior in /etc/mongodb.conf by
|
|
||||||
editing/removing/commenting out bind_ip line.
|
|
||||||
|
|
||||||
Why only for x86 and amd64?
|
|
||||||
|
|
||||||
The mongodb server depends on both little-endianness and unaligned memory
|
|
||||||
access, which I believe means it can only work on i386 and amd64. We believe
|
|
||||||
that the mongodb will be useful even it is not available for all Debian
|
|
||||||
supported platforms.
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz>, Fri, 12 Feb 2010 09:19, +0100
|
|
||||||
13
debian/README.source
vendored
13
debian/README.source
vendored
|
|
@ -1,13 +0,0 @@
|
||||||
gbp
|
|
||||||
===
|
|
||||||
|
|
||||||
Use of git-import-orig is highly encouraged.
|
|
||||||
|
|
||||||
|
|
||||||
debian/gbp.conf
|
|
||||||
===============
|
|
||||||
|
|
||||||
debian/* files from upstream tarball are filtered out because the merge is really
|
|
||||||
difficult to maintain.
|
|
||||||
It is up to the maintainer to check manually for upstream changes in debian dir,
|
|
||||||
especially man pages.
|
|
||||||
420
debian/changelog
vendored
420
debian/changelog
vendored
|
|
@ -1,420 +0,0 @@
|
||||||
mongodb (1:2.4.1-2) unstable; urgency=low
|
|
||||||
|
|
||||||
* set version of mongodb-server in mongodb metapackage
|
|
||||||
(Closes:#703580)
|
|
||||||
* [d041ec8] fixes parsing of parallel option, (Closes:#702797)
|
|
||||||
* [348ff81] update watch file, thanks Bart, (Closes:#688781)
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Sun, 24 Mar 2013 19:13:21 +0100
|
|
||||||
|
|
||||||
mongodb (1:2.4.1-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release 2.4.1
|
|
||||||
https://jira.mongodb.org/browse/SERVER/fixforversion/12402
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Sat, 23 Mar 2013 13:41:03 +0100
|
|
||||||
|
|
||||||
mongodb (1:2.2.2-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release 2.2.2
|
|
||||||
https://jira.mongodb.org/browse/SERVER/fixforversion/11886
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Wed, 28 Nov 2012 09:34:58 +0100
|
|
||||||
|
|
||||||
mongodb (1:2.2.0-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release 2.2.0
|
|
||||||
http://jira.mongodb.org/browse/SERVER/fixforversion/11496
|
|
||||||
http://blog.mongodb.org/post/30451575525/mongodb-2-2-released
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Wed, 29 Aug 2012 21:06:20 +0200
|
|
||||||
|
|
||||||
mongodb (1:2.0.7-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release 2.0.7
|
|
||||||
https://jira.mongodb.org/browse/SERVER/fixforversion/11201
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Fri, 10 Aug 2012 14:58:19 +0200
|
|
||||||
|
|
||||||
mongodb (1:2.0.6-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release 2.0.6
|
|
||||||
https://jira.mongodb.org/browse/SERVER/fixforversion/11165
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Tue, 05 Jun 2012 19:52:28 +0200
|
|
||||||
|
|
||||||
mongodb (1:2.0.5-2) unstable; urgency=low
|
|
||||||
|
|
||||||
* Removed mongodb-server as dependency of mongodb-dev (Closes:#672634)
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Sun, 27 May 2012 13:00:38 +0200
|
|
||||||
|
|
||||||
mongodb (1:2.0.5-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release 2.0.5
|
|
||||||
https://jira.mongodb.org/browse/SERVER/fixforversion/11137
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Thu, 10 May 2012 07:05:43 +0200
|
|
||||||
|
|
||||||
mongodb (1:2.0.4-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release 2.0.4
|
|
||||||
https://jira.mongodb.org/browse/SERVER/fixforversion/11107
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Fri, 30 Mar 2012 21:41:35 +0200
|
|
||||||
|
|
||||||
mongodb (1:2.0.3-2) unstable; urgency=low
|
|
||||||
|
|
||||||
* Enable journaling by default (Closes:#664080)
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Thu, 15 Mar 2012 16:48:06 +0100
|
|
||||||
|
|
||||||
mongodb (1:2.0.3-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release 2.0.3
|
|
||||||
https://jira.mongodb.org/browse/SERVER/fixforversion/11001
|
|
||||||
* added debian/copat
|
|
||||||
* added Replaces clause from Ubuntu patch
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Thu, 01 Mar 2012 14:14:34 +0100
|
|
||||||
|
|
||||||
mongodb (1:2.0.2-5) unstable; urgency=low
|
|
||||||
|
|
||||||
* Allow parallel build, patch courtesy of Andre Ferraz
|
|
||||||
<deferraz@terra.com.br> (Closes:#646759)
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Thu, 16 Feb 2012 10:25:06 +0100
|
|
||||||
|
|
||||||
mongodb (1:2.0.2-4) unstable; urgency=low
|
|
||||||
|
|
||||||
* Move socket from /tmp to /var/run/mongodb (Closes: #658177)
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Wed, 01 Feb 2012 14:53:12 +0100
|
|
||||||
|
|
||||||
mongodb (1:2.0.2-3) unstable; urgency=low
|
|
||||||
|
|
||||||
* Describe jsonArray option for mongoimport in manpage (Closes: 656444)
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Thu, 19 Jan 2012 14:11:14 +0100
|
|
||||||
|
|
||||||
mongodb (1:2.0.2-2) unstable; urgency=low
|
|
||||||
|
|
||||||
* added logrotate for mongodb-server (Closes: #656065)
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Mon, 16 Jan 2012 10:46:36 +0100
|
|
||||||
|
|
||||||
mongodb (1:2.0.2-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release 2.0.2
|
|
||||||
https://jira.mongodb.org/browse/SERVER/fixforversion/10991
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Thu, 15 Dec 2011 11:26:24 +0100
|
|
||||||
|
|
||||||
mongodb (1:2.0.0-2) unstable; urgency=low
|
|
||||||
|
|
||||||
* need to reupload package to get it build on i386 which failed because of
|
|
||||||
cdbs error
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Sun, 25 Sep 2011 20:22:08 +0200
|
|
||||||
|
|
||||||
mongodb (1:2.0.0-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release 2.0.0 (Closes: #641646)
|
|
||||||
http://blog.mongodb.org/post/10126837729/mongodb-2-0-released
|
|
||||||
* proper Spider Monkey is embedded (Closes: #637370, #572870, #631054)
|
|
||||||
* currently linking against system libpcre3
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Wed, 14 Sep 2011 17:09:16 +0200
|
|
||||||
|
|
||||||
mongodb (1:1.8.3-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release 1.8.3
|
|
||||||
https://jira.mongodb.org/browse/SERVER/fixforversion/10390
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Tue, 23 Aug 2011 08:48:57 +0200
|
|
||||||
|
|
||||||
mongodb (1:1.8.2-2) unstable; urgency=low
|
|
||||||
|
|
||||||
* [2e1c3ff] (Closes: #625401) ignore unused-but-set-{variable,parameter}
|
|
||||||
* [0e9611d] (Closes: #572870, #631054) switch to v8 as javascript engine
|
|
||||||
* [bbf5935] (Closes: #634484) use dbpath and logpath from config file
|
|
||||||
not forcing in init.d
|
|
||||||
* [bf8d466] update description
|
|
||||||
* [cbe2d99] Imported Upstream version 1.8.3
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Tue, 23 Aug 2011 08:48:17 +0200
|
|
||||||
|
|
||||||
mongodb (1:1.8.2-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release 1.8.2
|
|
||||||
https://jira.mongodb.org/browse/SERVER/fixforversion/10263
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Sat, 18 Jun 2011 21:25:25 +0200
|
|
||||||
|
|
||||||
mongodb (1:1.8.1-2) unstable; urgency=low
|
|
||||||
|
|
||||||
* Depend on libboost 1.46
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Tue, 31 May 2011 13:19:30 +0200
|
|
||||||
|
|
||||||
mongodb (1:1.8.1-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* Upstream 1.8.1
|
|
||||||
http://jira.mongodb.org/browse/SERVER/fixforversion/10260
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Thu, 07 Apr 2011 07:38:17 +0200
|
|
||||||
|
|
||||||
mongodb (1:1.8.0-2) unstable; urgency=low
|
|
||||||
|
|
||||||
* return empty TERM if not set (Closes: #620910)
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Tue, 05 Apr 2011 10:21:26 +0200
|
|
||||||
|
|
||||||
mongodb (1:1.8.0-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* Upstream 1.8.0
|
|
||||||
http://blog.mongodb.org/post/3903149313/mongodb-1-8-released
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Thu, 17 Mar 2011 00:10:27 +0100
|
|
||||||
|
|
||||||
mongodb (1:1.6.5-3) unstable; urgency=low
|
|
||||||
|
|
||||||
[ Jérémy Lal ]
|
|
||||||
* Switch to cdbs, cleanup.
|
|
||||||
* Use debian/gbp.conf to filter out debian/* files from upstream tarball.
|
|
||||||
|
|
||||||
[ Antonin Kral ]
|
|
||||||
* [ab13e0b] added Vcs-* to debian/control
|
|
||||||
* [eb35fc8] added Jeremy as co-maintainer
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Thu, 24 Feb 2011 08:36:10 +0100
|
|
||||||
|
|
||||||
mongodb (1:1.6.5-2) unstable; urgency=low
|
|
||||||
|
|
||||||
* Clean up Boost packages in Build-Depends
|
|
||||||
* Add libboost-dev to mongodb-dev Depends line
|
|
||||||
|
|
||||||
-- Roberto C. Sanchez <roberto@connexer.com> Mon, 24 Jan 2011 20:17:29 -0500
|
|
||||||
|
|
||||||
mongodb (1:1.6.5-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* Upstream 1.6.5
|
|
||||||
http://jira.mongodb.org/browse/SERVER/fixforversion/10207
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Fri, 10 Dec 2010 13:10:04 +0100
|
|
||||||
|
|
||||||
mongodb (1:1.6.3-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* [0ad0c09] Imported Upstream version 1.6.3
|
|
||||||
http://jira.mongodb.org/browse/SERVER/fixforversion/10190
|
|
||||||
* replica_sets slavedelay, rollback
|
|
||||||
* sharding optimization for larger than ram data sets
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Fri, 24 Sep 2010 19:04:25 +0200
|
|
||||||
|
|
||||||
mongodb (1:1.6.2-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* [90ef97f] Imported Upstream version 1.6.2
|
|
||||||
http://jira.mongodb.org/browse/SERVER/fixforversion/10187
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Thu, 02 Sep 2010 17:41:00 +0200
|
|
||||||
|
|
||||||
mongodb (1:1.6.1-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* [3b9581e] Imported Upstream version 1.6.1
|
|
||||||
http://jira.mongodb.org/browse/SERVER/fixforversion/10183
|
|
||||||
* [5866afb] updated watch file fot 1.6.x version
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Wed, 18 Aug 2010 09:33:36 +0200
|
|
||||||
|
|
||||||
mongodb (1:1.6.0-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* [7645618] Imported Upstream version 1.6.0
|
|
||||||
http://jira.mongodb.org/browse/SERVER/fixforversion/10182
|
|
||||||
* [7ae74af] install libs to /usr/lib not /usr/lib64
|
|
||||||
* [45c6766] use prefix and smokedbprefix
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Wed, 11 Aug 2010 13:19:25 +0200
|
|
||||||
|
|
||||||
mongodb (1:1.4.4-3) unstable; urgency=low
|
|
||||||
|
|
||||||
* [1576744] added libreadline-dev to build-deps (Closes: #589163)
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Thu, 15 Jul 2010 21:41:49 +0200
|
|
||||||
|
|
||||||
mongodb (1:1.4.4-2) unstable; urgency=low
|
|
||||||
|
|
||||||
* [3bd69dc] install libs to /usr/lib not /usr/lib64 (Closes: #588557)
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Fri, 09 Jul 2010 21:26:05 +0200
|
|
||||||
|
|
||||||
mongodb (1:1.4.4-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* [5c6a221] Imported Upstream version 1.4.4
|
|
||||||
* upstream change log is at
|
|
||||||
http://jira.mongodb.org/browse/SERVER/fixforversion/10166
|
|
||||||
* [68c73c3] removed not needed files from upstream
|
|
||||||
* [c1546df] debian policy to 3.9.0
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Wed, 30 Jun 2010 09:32:45 +0200
|
|
||||||
|
|
||||||
mongodb (1:1.4.3-2) unstable; urgency=low
|
|
||||||
|
|
||||||
* [64bca3c] Updated copyright information as requested by Richard
|
|
||||||
Kreuter
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Mon, 07 Jun 2010 08:27:36 +0200
|
|
||||||
|
|
||||||
mongodb (1:1.4.3-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream version 1.4.3
|
|
||||||
* Change log 1.4.3
|
|
||||||
http://jira.mongodb.org/browse/SERVER/fixforversion/10156
|
|
||||||
* added log to dirs to fix piuparts error
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Sun, 30 May 2010 10:14:05 +0200
|
|
||||||
|
|
||||||
mongodb (1:1.4.2-3) unstable; urgency=low
|
|
||||||
|
|
||||||
* Clean up debian/copyright
|
|
||||||
* Fix various typos
|
|
||||||
* Generally make lintian happy
|
|
||||||
* Change section of mongodb-dev from database to libdevel (now matches
|
|
||||||
archive override file)
|
|
||||||
* Properly express copyrights
|
|
||||||
* Fix typo in manpage
|
|
||||||
* Remove unused lintian override.
|
|
||||||
* Install usr/lib64 instead of usr/lib in mongodb-dev
|
|
||||||
* updated watch file to actually work and report available
|
|
||||||
stable releases
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Tue, 11 May 2010 22:21:13 +0200
|
|
||||||
|
|
||||||
mongodb (1:1.4.2-2) unstable; urgency=low
|
|
||||||
|
|
||||||
* Split single binary package into mongodb-server, mongodb-dev, and
|
|
||||||
mongodb-clients.
|
|
||||||
|
|
||||||
-- Roberto C. Sanchez <roberto@connexer.com> Thu, 06 May 2010 21:20:52 -0400
|
|
||||||
|
|
||||||
mongodb (1:1.4.2-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* [4770a09] New upstream version 1.4.2
|
|
||||||
* changelog for 1.4.1
|
|
||||||
http://jira.mongodb.org/browse/SERVER/fixforversion/10144
|
|
||||||
* changelog for 1.4.2
|
|
||||||
http://jira.mongodb.org/browse/SERVER/fixforversion/10155
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Tue, 27 Apr 2010 19:55:04 +0200
|
|
||||||
|
|
||||||
mongodb (1:1.4.0-2) unstable; urgency=low
|
|
||||||
|
|
||||||
* added Roberto C. Sanchez as co-maintainer
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Fri, 09 Apr 2010 21:40:49 +0200
|
|
||||||
|
|
||||||
mongodb (1:1.4.0-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* [0ca01a9] Imported Upstream version 1.4.0
|
|
||||||
* [76c18ea] removed not needed files for debian
|
|
||||||
* [c1578d9] merged changes from debianization from 1.2.4
|
|
||||||
* full upstream changelog
|
|
||||||
http://jira.mongodb.org/secure/IssueNavigator.jspa?requestId=10080
|
|
||||||
* upstream release notes
|
|
||||||
http://www.mongodb.org/display/DOCS/1.4+Release+Notes
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Thu, 25 Mar 2010 19:44:59 +0100
|
|
||||||
|
|
||||||
mongodb (1:1.2.4-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* [c3803a1] Imported Upstream version 1.2.4
|
|
||||||
* [ab4e0c8] removal of unnecessary files for Debian from upstream
|
|
||||||
source
|
|
||||||
* changelog for upstream at
|
|
||||||
http://jira.mongodb.org/browse/SERVER/fixforversion/10130
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Wed, 17 Mar 2010 10:18:01 +0100
|
|
||||||
|
|
||||||
mongodb (1:1.2.2-4) unstable; urgency=low
|
|
||||||
|
|
||||||
* ensure removal of upstart script as upload of repacked source is failing
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Wed, 10 Mar 2010 07:29:38 +0100
|
|
||||||
|
|
||||||
mongodb (1:1.2.2-3) unstable; urgency=low
|
|
||||||
|
|
||||||
* [aced2f4] removed unnecessary dependency (Closes: #572873)
|
|
||||||
* [ce78acd] Added call for tests to ensure correct build
|
|
||||||
(Closes: #570106)
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Sun, 07 Mar 2010 21:07:37 +0100
|
|
||||||
|
|
||||||
mongodb (1:1.2.2-2) unstable; urgency=low
|
|
||||||
|
|
||||||
* [49232f8] removed upstart, it is buggy + not supported in Debian
|
|
||||||
(Closes: #572812)
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Sat, 06 Mar 2010 22:55:17 +0100
|
|
||||||
|
|
||||||
mongodb (1:1.2.2-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* this commit introduces stable version of MongoDB to Debian, hopefully to
|
|
||||||
be included in upcoming stable (Closes: #570148)
|
|
||||||
* [2fede57] Upstream release 1.2.2, based on commit
|
|
||||||
fc3d3acafc253da085f7d0cdcd91059cc9bcd8e3
|
|
||||||
* [d21668d] versionString changed from "1.2.3-" to "1.2.2"
|
|
||||||
* [5a8e160] removed debian/files
|
|
||||||
* [26f3ec2] removed empty preinst
|
|
||||||
* [5d12fec] removed unnecessary jars
|
|
||||||
* [978f619] removed unused lib
|
|
||||||
* [7157b84] Changed maintainer of the package
|
|
||||||
* [0a939b5] mongo should build only on i386 and amd64
|
|
||||||
* [f3e7db5] generate list of manpages
|
|
||||||
* [bcd0d12] database section is probably more appropriate
|
|
||||||
* [7bec42f] clarification of licensing terms
|
|
||||||
* [c74fd7d] bumped standards version
|
|
||||||
* [357da67] merged the rest of debian changes from 1.3
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Wed, 17 Feb 2010 08:50:07 +0100
|
|
||||||
|
|
||||||
mongodb (1.3.1-3) unstable; urgency=low
|
|
||||||
|
|
||||||
* [ff792f5] Reordered Build-Depends to enable automated with buildd
|
|
||||||
(Closes: #570072)
|
|
||||||
* [4d5a2c1] Added support of nostrip and debug DEB_BUILD_OPTIONS
|
|
||||||
(Closes: #570077)
|
|
||||||
* [cbc4e8b] Describe why is mongodb available for some architectures
|
|
||||||
only (Closes: #570076)
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Tue, 16 Feb 2010 21:59:56 +0100
|
|
||||||
|
|
||||||
mongodb (1.3.1-2) unstable; urgency=low
|
|
||||||
|
|
||||||
* [efabc21] change order of build deps of xul-runner to fix sbuild
|
|
||||||
(Closes: #569417)
|
|
||||||
* [55e3c9b] added support for mongod config file
|
|
||||||
* [88a7135] added README.Debian with note about bind_ip set to
|
|
||||||
localhost
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Fri, 12 Feb 2010 09:37:23 +0100
|
|
||||||
|
|
||||||
mongodb (1.3.1-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* Initial release (Closes: #523937)
|
|
||||||
* [5cd4d87] rebuild original sources to remove debian/files
|
|
||||||
* [4a84263] Removed empty preinst
|
|
||||||
* [9698ffb] Changed maintainer of the package
|
|
||||||
* [4486a47] mongo should build only on i386 and amd64
|
|
||||||
* [5842c04] no need for creating home-dir for mongo user
|
|
||||||
* [f47e39e] Added missing manpages
|
|
||||||
* [987cd73] generate list of manpages
|
|
||||||
* [e3336d8] used more specific build-depeneds, thanks to Richard
|
|
||||||
Kreuter <richard@10gen.com>
|
|
||||||
* [ba8697c] removed unnecessary jars dir with its content
|
|
||||||
* [91fe1cf] cover licensing terms of used components
|
|
||||||
* [d59c02f] init.d cleanup
|
|
||||||
* [78d712b] cover licensing terms of utils/md5.[ch]
|
|
||||||
* [a696359] removed lib/ from upstream
|
|
||||||
|
|
||||||
-- Antonin Kral <A.Kral@sh.cvut.cz> Fri, 29 Jan 2010 19:48:45 +0100
|
|
||||||
|
|
||||||
1
debian/compat
vendored
1
debian/compat
vendored
|
|
@ -1 +0,0 @@
|
||||||
9
|
|
||||||
108
debian/control
vendored
108
debian/control
vendored
|
|
@ -1,108 +0,0 @@
|
||||||
Source: mongodb
|
|
||||||
Section: database
|
|
||||||
Priority: optional
|
|
||||||
Maintainer: Antonin Kral <A.Kral@sh.cvut.cz>
|
|
||||||
Uploaders: Roberto C. Sanchez <roberto@connexer.com>, Jérémy Lal <kapouer@melix.org>
|
|
||||||
Build-Depends: debhelper (>= 9), cdbs (>= 0.4.73~), libpcre3, libpcre3-dev, scons, libreadline-dev, libboost-dev, libboost-thread-dev, libboost-filesystem-dev, libboost-program-options-dev, libboost-date-time-dev, python-pymongo
|
|
||||||
Standards-Version: 3.9.3
|
|
||||||
Vcs-Git: git://github.com/bobek/mongo-debian.git
|
|
||||||
Vcs-Browser: https://github.com/bobek/mongo-debian
|
|
||||||
Homepage: http://www.mongodb.org
|
|
||||||
|
|
||||||
Package: mongodb
|
|
||||||
Architecture: i386 amd64
|
|
||||||
Depends: mongodb-server (>= 1:2.4.1-2), mongodb-dev, ${shlibs:Depends}, ${misc:Depends}
|
|
||||||
Description: object/document-oriented database (metapackage)
|
|
||||||
MongoDB is a high-performance, open source, schema-free
|
|
||||||
document-oriented data store that's easy to deploy, manage
|
|
||||||
and use. It's network accessible, written in C++ and offers
|
|
||||||
the following features :
|
|
||||||
.
|
|
||||||
* Collection oriented storage - easy storage of object-
|
|
||||||
style data
|
|
||||||
* Full index support, including on inner objects
|
|
||||||
* Query profiling
|
|
||||||
* Replication and fail-over support
|
|
||||||
* Efficient storage of binary data including large
|
|
||||||
objects (e.g. videos)
|
|
||||||
* Auto-sharding for cloud-level scalability
|
|
||||||
.
|
|
||||||
High performance, scalability, and reasonable depth of
|
|
||||||
functionality are the goals for the project.
|
|
||||||
.
|
|
||||||
This is a metapackage that depends on all the mongodb parts.
|
|
||||||
|
|
||||||
Package: mongodb-server
|
|
||||||
Architecture: i386 amd64
|
|
||||||
Depends: mongodb-clients, ${shlibs:Depends}, ${misc:Depends}, adduser
|
|
||||||
Replaces: mongodb (<= 1:1.4.2-2)
|
|
||||||
Description: object/document-oriented database (server package)
|
|
||||||
MongoDB is a high-performance, open source, schema-free
|
|
||||||
document-oriented data store that's easy to deploy, manage
|
|
||||||
and use. It's network accessible, written in C++ and offers
|
|
||||||
the following features :
|
|
||||||
.
|
|
||||||
* Collection oriented storage - easy storage of object-
|
|
||||||
style data
|
|
||||||
* Full index support, including on inner objects
|
|
||||||
* Query profiling
|
|
||||||
* Replication and fail-over support
|
|
||||||
* Efficient storage of binary data including large
|
|
||||||
objects (e.g. videos)
|
|
||||||
* Auto-sharding for cloud-level scalability
|
|
||||||
.
|
|
||||||
High performance, scalability, and reasonable depth of
|
|
||||||
functionality are the goals for the project.
|
|
||||||
.
|
|
||||||
This package contains the server itself.
|
|
||||||
|
|
||||||
Package: mongodb-clients
|
|
||||||
Architecture: i386 amd64
|
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
|
||||||
Replaces: mongodb (<= 1:1.4.2-2)
|
|
||||||
Description: object/document-oriented database (client apps)
|
|
||||||
MongoDB is a high-performance, open source, schema-free
|
|
||||||
document-oriented data store that's easy to deploy, manage
|
|
||||||
and use. It's network accessible, written in C++ and offers
|
|
||||||
the following features :
|
|
||||||
.
|
|
||||||
* Collection oriented storage - easy storage of object-
|
|
||||||
style data
|
|
||||||
* Full index support, including on inner objects
|
|
||||||
* Query profiling
|
|
||||||
* Replication and fail-over support
|
|
||||||
* Efficient storage of binary data including large
|
|
||||||
objects (e.g. videos)
|
|
||||||
* Auto-sharding for cloud-level scalability
|
|
||||||
.
|
|
||||||
High performance, scalability, and reasonable depth of
|
|
||||||
functionality are the goals for the project.
|
|
||||||
.
|
|
||||||
This package contains the various client applications.
|
|
||||||
|
|
||||||
Package: mongodb-dev
|
|
||||||
Section: libdevel
|
|
||||||
Architecture: i386 amd64
|
|
||||||
Depends: libboost-dev, ${shlibs:Depends}, ${misc:Depends}
|
|
||||||
Suggests: mongodb-server
|
|
||||||
Replaces: mongodb (<= 1:1.4.2-2)
|
|
||||||
Description: object/document-oriented database (development)
|
|
||||||
MongoDB is a high-performance, open source, schema-free
|
|
||||||
document-oriented data store that's easy to deploy, manage
|
|
||||||
and use. It's network accessible, written in C++ and offers
|
|
||||||
the following features :
|
|
||||||
.
|
|
||||||
* Collection oriented storage - easy storage of object-
|
|
||||||
style data
|
|
||||||
* Full index support, including on inner objects
|
|
||||||
* Query profiling
|
|
||||||
* Replication and fail-over support
|
|
||||||
* Efficient storage of binary data including large
|
|
||||||
objects (e.g. videos)
|
|
||||||
* Auto-sharding for cloud-level scalability
|
|
||||||
.
|
|
||||||
High performance, scalability, and reasonable depth of
|
|
||||||
functionality are the goals for the project.
|
|
||||||
.
|
|
||||||
Development headers and libraries.
|
|
||||||
|
|
||||||
230
debian/copyright
vendored
230
debian/copyright
vendored
|
|
@ -1,230 +0,0 @@
|
||||||
This package was debianized
|
|
||||||
by Kristina Chodorow <kristina@10gen.com>
|
|
||||||
and Antonin Kral <A.Kral@bobek.cz>
|
|
||||||
|
|
||||||
It was downloaded from http://www.mongodb.org
|
|
||||||
|
|
||||||
Upstream Authors:
|
|
||||||
|
|
||||||
Eliot Horowitz
|
|
||||||
Dwight Merriman
|
|
||||||
Aaron Staple
|
|
||||||
Michael Dirolf
|
|
||||||
Kristina Chodorow
|
|
||||||
|
|
||||||
Debian Maintainers:
|
|
||||||
|
|
||||||
Antonin Kral
|
|
||||||
Roberto C. Sanchez
|
|
||||||
|
|
||||||
Copyright:
|
|
||||||
|
|
||||||
Copyright (c) 2009 10gen
|
|
||||||
|
|
||||||
License:
|
|
||||||
|
|
||||||
Apache License 2.0
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
On a Debian system, the license can be found at
|
|
||||||
/usr/share/common-licenses/Apache-2.0
|
|
||||||
|
|
||||||
AGPL 3.0
|
|
||||||
http://www.fsf.org/licensing/licenses/agpl-3.0.html
|
|
||||||
|
|
||||||
The Debian packaging is Copyright (c) 2009, 2010, Kristina Chodorow <kristina@10gen.com>, Antonin Kral <A.Kral@bobek.cz> and Roberto C. Sanchez <roberto@connexer.com>. It is licensed under the AGPL, but will be relicensed under Apache License 2.0.
|
|
||||||
|
|
||||||
Some parts of MongoDB are licensed under the AGPL, others are Apache 2.0. Please see individual source files for details.
|
|
||||||
|
|
||||||
MongoDB uses third-party libraries or other resources that may be distributed under licenses different than the MongoDB software. Feel free to open a bug report if you find component which has different license and is not covered here. Your use of the source code for the these components is subject to the terms and conditions of the following licenses.
|
|
||||||
|
|
||||||
License Notice for SCONS
|
|
||||||
------------------------
|
|
||||||
|
|
||||||
/usr/share/common-licenses/GPL-2
|
|
||||||
|
|
||||||
SCONS and it components, generated code and utilities (e.g. gch.py) are
|
|
||||||
licensed under GPL 2.
|
|
||||||
|
|
||||||
|
|
||||||
License Notice for Boost
|
|
||||||
------------------------
|
|
||||||
|
|
||||||
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt
|
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person or organization
|
|
||||||
obtaining a copy of the software and accompanying documentation covered by
|
|
||||||
this license (the "Software") to use, reproduce, display, distribute,
|
|
||||||
execute, and transmit the Software, and to prepare derivative works of the
|
|
||||||
Software, and to permit third-parties to whom the Software is furnished to
|
|
||||||
do so, all subject to the following:
|
|
||||||
|
|
||||||
The copyright notices in the Software and this entire statement, including
|
|
||||||
the above license grant, this restriction and the following disclaimer,
|
|
||||||
must be included in all copies of the Software, in whole or in part, and
|
|
||||||
all derivative works of the Software, unless such copies or derivative
|
|
||||||
works are solely in the form of machine-executable object code generated by
|
|
||||||
a source language processor.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
|
||||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
|
||||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
|
||||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
||||||
DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
License Notice for V8
|
|
||||||
---------------------
|
|
||||||
|
|
||||||
http://code.google.com/p/v8/source/browse/trunk/LICENSE
|
|
||||||
|
|
||||||
This license applies to all parts of V8 that are not externally
|
|
||||||
maintained libraries. The externally maintained libraries used by V8
|
|
||||||
are:
|
|
||||||
|
|
||||||
- Jscre, located under third_party/jscre. This code is copyrighted
|
|
||||||
by the University of Cambridge and Apple Inc. and released under a
|
|
||||||
2-clause BSD license.
|
|
||||||
|
|
||||||
- Dtoa, located under third_party/dtoa. This code is copyrighted by
|
|
||||||
David M. Gay and released under an MIT license.
|
|
||||||
|
|
||||||
- Strongtalk assembler, the basis of the files assembler-arm-inl.h,
|
|
||||||
assembler-arm.cc, assembler-arm.h, assembler-ia32-inl.h,
|
|
||||||
assembler-ia32.cc, assembler-ia32.h, assembler.cc and assembler.h.
|
|
||||||
This code is copyrighted by Sun Microsystems Inc. and released
|
|
||||||
under a 3-clause BSD license.
|
|
||||||
|
|
||||||
These libraries have their own licenses; we recommend you read them,
|
|
||||||
as their terms may differ from the terms below.
|
|
||||||
|
|
||||||
Copyright 2006-2008, Google Inc. All rights reserved.
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are
|
|
||||||
met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above
|
|
||||||
copyright notice, this list of conditions and the following
|
|
||||||
disclaimer in the documentation and/or other materials provided
|
|
||||||
with the distribution.
|
|
||||||
* Neither the name of Google Inc. nor the names of its
|
|
||||||
contributors may be used to endorse or promote products derived
|
|
||||||
from this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
License Notice for PCRE
|
|
||||||
-----------------------
|
|
||||||
|
|
||||||
http://www.pcre.org/licence.txt
|
|
||||||
|
|
||||||
PCRE LICENCE
|
|
||||||
------------
|
|
||||||
|
|
||||||
PCRE is a library of functions to support regular expressions whose syntax
|
|
||||||
and semantics are as close as possible to those of the Perl 5 language.
|
|
||||||
|
|
||||||
Release 7 of PCRE is distributed under the terms of the "BSD" licence, as
|
|
||||||
specified below. The documentation for PCRE, supplied in the "doc"
|
|
||||||
directory, is distributed under the same terms as the software itself.
|
|
||||||
|
|
||||||
The basic library functions are written in C and are freestanding. Also
|
|
||||||
included in the distribution is a set of C++ wrapper functions.
|
|
||||||
|
|
||||||
|
|
||||||
THE BASIC LIBRARY FUNCTIONS
|
|
||||||
---------------------------
|
|
||||||
|
|
||||||
Written by: Philip Hazel
|
|
||||||
Email local part: ph10
|
|
||||||
Email domain: cam.ac.uk
|
|
||||||
|
|
||||||
University of Cambridge Computing Service,
|
|
||||||
Cambridge, England.
|
|
||||||
|
|
||||||
Copyright (c) 1997-2008 University of Cambridge
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
|
|
||||||
THE C++ WRAPPER FUNCTIONS
|
|
||||||
-------------------------
|
|
||||||
|
|
||||||
Contributed by: Google Inc.
|
|
||||||
|
|
||||||
Copyright (c) 2007-2008, Google Inc.
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
|
|
||||||
THE "BSD" LICENCE
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice,
|
|
||||||
this list of conditions and the following disclaimer.
|
|
||||||
|
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer in the
|
|
||||||
documentation and/or other materials provided with the distribution.
|
|
||||||
|
|
||||||
* Neither the name of the University of Cambridge nor the name of Google
|
|
||||||
Inc. nor the names of their contributors may be used to endorse or
|
|
||||||
promote products derived from this software without specific prior
|
|
||||||
written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
||||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
||||||
POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
|
|
||||||
License for md5 implementation
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
md5 algorithm implementation (utils/md5.[ch]) is licensed under modified BSD
|
|
||||||
License.
|
|
||||||
|
|
||||||
Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved.
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
|
|
||||||
L. Peter Deutsch
|
|
||||||
ghost@aladdin.com
|
|
||||||
6
debian/gbp.conf
vendored
6
debian/gbp.conf
vendored
|
|
@ -1,6 +0,0 @@
|
||||||
[DEFAULT]
|
|
||||||
pristine-tar = True
|
|
||||||
|
|
||||||
[git-import-orig]
|
|
||||||
filter = ['debian/*','lib/*']
|
|
||||||
filter-pristine-tar = True
|
|
||||||
77
debian/manpages/mongo.1
vendored
77
debian/manpages/mongo.1
vendored
|
|
@ -1,77 +0,0 @@
|
||||||
.\" Documentation for the MongoDB shell
|
|
||||||
.TH MONGO "1" "June 2009" "10gen" "Mongo Database"
|
|
||||||
.SH "NAME"
|
|
||||||
mongo \- the Mongo command\-line tool
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
\fBmongo [\fIOPTIONS\fR] [\fIDB_ADDRESS\fR] [\fIFILE+\fR]\fR
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
\fBmongo\fR
|
|
||||||
is a JavaScript shell (with GNU
|
|
||||||
readline
|
|
||||||
capabilities). It supports interactive and non\-interactive use. When used interactively, JavaScript can be used to query the database or perform any other function normally available with SpiderMonkey. Database output is displayed in JSON format.
|
|
||||||
.PP
|
|
||||||
If JavaScript files are specified on the command line, the shell will run non\-interactively, running each one in sequence and then exiting.
|
|
||||||
.SH "EXAMPLES"
|
|
||||||
.TP
|
|
||||||
.B mongo
|
|
||||||
start the shell, connecting to the server at localhost:27017 and using the test database
|
|
||||||
.TP
|
|
||||||
.B mongo foo
|
|
||||||
start the shell using the foo database at localhost:27017
|
|
||||||
.TP
|
|
||||||
.B mongo 192.169.0.5/foo
|
|
||||||
start the shell using the foo database at 192.169.0.5:27017
|
|
||||||
.TP
|
|
||||||
.B mongo 192.169.0.5:9999/foo
|
|
||||||
start the shell using the foo database at 192.169.0.5:9999
|
|
||||||
.TP
|
|
||||||
.B mongo script1.js script2.js script3.js
|
|
||||||
run three scripts and exit
|
|
||||||
.SH "OPTIONS"
|
|
||||||
.TP
|
|
||||||
.B \-\-shell
|
|
||||||
run the shell after executing files
|
|
||||||
.TP
|
|
||||||
.B \-\-help
|
|
||||||
show usage information
|
|
||||||
.TP
|
|
||||||
.B \-\-host HOST
|
|
||||||
server to connect to (default HOST=localhost)
|
|
||||||
.TP
|
|
||||||
.B \-\-port PORT
|
|
||||||
port to connect to (default PORT=27017)
|
|
||||||
.TP
|
|
||||||
.B \-\-nodb
|
|
||||||
do not connect to mongod
|
|
||||||
.TP
|
|
||||||
.B \-\-eval SCRIPT
|
|
||||||
evaluate JavaScript
|
|
||||||
.TP
|
|
||||||
.B \-\-shell
|
|
||||||
run the shell after executing files
|
|
||||||
.TP
|
|
||||||
.B \-\-quiet
|
|
||||||
be less chatty
|
|
||||||
.TP
|
|
||||||
.B \-\-version
|
|
||||||
show version information
|
|
||||||
.TP
|
|
||||||
.B \-\-verbose
|
|
||||||
increase verbosity
|
|
||||||
.TP
|
|
||||||
.B \-\-ipv6
|
|
||||||
enable IPv6 support (disabled by default)
|
|
||||||
.TP
|
|
||||||
.B \-u|\-\-username USERNAME
|
|
||||||
specify user to log in as
|
|
||||||
.TP
|
|
||||||
.B \-p|\-\-password PASSWORD
|
|
||||||
specify password of user (notice there is no space)
|
|
||||||
.SH "COPYRIGHT"
|
|
||||||
.PP
|
|
||||||
Copyright 2007\-2011 10gen
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
For more information, please refer to the MongoDB wiki, available at http://www.mongodb.org.
|
|
||||||
.SH "AUTHOR"
|
|
||||||
Kristina Chodorow
|
|
||||||
16
debian/manpages/mongod.1
vendored
16
debian/manpages/mongod.1
vendored
|
|
@ -1,16 +0,0 @@
|
||||||
.\" Documentation for the MongoDB shell
|
|
||||||
.TH MONGOD "1" "June 2009" "10gen" "Mongo Database"
|
|
||||||
.SH "NAME"
|
|
||||||
mongod \- the Mongo Daemon
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
\fBmongod\fR
|
|
||||||
is a core MongoDB daemon. You are not supposed to call it directly, please refer to the wiki if necessary.
|
|
||||||
.SH "COPYRIGHT"
|
|
||||||
.PP
|
|
||||||
Copyright 2007\-2009 10gen
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
For more information, please refer to the MongoDB wiki, available at http://www.mongodb.org.
|
|
||||||
.SH "AUTHOR"
|
|
||||||
Antonin Kral
|
|
||||||
63
debian/manpages/mongodump.1
vendored
63
debian/manpages/mongodump.1
vendored
|
|
@ -1,63 +0,0 @@
|
||||||
.\" Documentation for the MongoDB dump tool
|
|
||||||
.TH MONGODUMP "1" "June 2009" "10gen" "Mongo Database"
|
|
||||||
.SH "NAME"
|
|
||||||
mongodump \- the Mongo dump tool
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
\fBmongodump [\fIOPTIONS\fR]\fR
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
\fBmongodump\fR
|
|
||||||
is a tool to output a binary representation of a database. It is mostly used for doing hot backups of a database.
|
|
||||||
.SH "OPTIONS"
|
|
||||||
.TP
|
|
||||||
.B \-\-help
|
|
||||||
show usage information
|
|
||||||
.TP
|
|
||||||
.B \-\-version
|
|
||||||
show version information
|
|
||||||
.TP
|
|
||||||
.B \-h, \-\-host HOST
|
|
||||||
server to connect to (default HOST=localhost)
|
|
||||||
.TP
|
|
||||||
.B \-\-port arg
|
|
||||||
server port. Can also use \-\-host hostname:port
|
|
||||||
.TP
|
|
||||||
.B \-\-ipv6
|
|
||||||
enable IPv6 support (disabled by default)
|
|
||||||
.TP
|
|
||||||
.B \-u|\-\-username USERNAME
|
|
||||||
specify user to log in as
|
|
||||||
.TP
|
|
||||||
.B \-p|\-\-password PASSWORD
|
|
||||||
specify password of user (notice there is no space)
|
|
||||||
.TP
|
|
||||||
.B \-d, \-\-db DATABASE
|
|
||||||
database to use
|
|
||||||
.TP
|
|
||||||
.B \-c, \-\-c COLLECTION
|
|
||||||
collection to use
|
|
||||||
.TP
|
|
||||||
.B \-o, \-\-out DIRECTORY
|
|
||||||
output directory or - for stdout.
|
|
||||||
.TP
|
|
||||||
.B \-\-dbpath PATH
|
|
||||||
directly access mongod data files in this path, instead of connecting to a mongod instance
|
|
||||||
.TP
|
|
||||||
.B \-\-directoryperdb
|
|
||||||
if dbpath specified, each db is in a separate directory
|
|
||||||
.TP
|
|
||||||
.B \-\-query
|
|
||||||
JSON query filter
|
|
||||||
.TP
|
|
||||||
.B \-\-oplog
|
|
||||||
Use oplog for point-in-time snapshotting
|
|
||||||
.TP
|
|
||||||
.B \-\-repair
|
|
||||||
try to recover a crashed database (needs \-\-dbpath)
|
|
||||||
.SH "COPYRIGHT"
|
|
||||||
.PP
|
|
||||||
Copyright 2007\-2011 10gen
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
For more information, please refer to the MongoDB wiki, available at http://www.mongodb.org.
|
|
||||||
.SH "AUTHOR"
|
|
||||||
Kristina Chodorow
|
|
||||||
79
debian/manpages/mongoexport.1
vendored
79
debian/manpages/mongoexport.1
vendored
|
|
@ -1,79 +0,0 @@
|
||||||
.\" Documentation for the MongoDB shell
|
|
||||||
.TH MONGOEXPORT "1" "June 2009" "10gen" "Mongo Database"
|
|
||||||
.SH "NAME"
|
|
||||||
mongoexport \- the Mongo export tool
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
\fBmongoexport [\fIOPTIONS\fR]\fR
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
\fBmongoexport\fR
|
|
||||||
is a tool to export a MongoDB collection to either JSON or CSV. The query can be filtered or a list of fields to output can be given.
|
|
||||||
.PP
|
|
||||||
If the output is CSV, the fields must be specified in order.
|
|
||||||
.SH "EXAMPLES"
|
|
||||||
.TP
|
|
||||||
.B mongoexport -d test -c test1 --csv -f "name,num"
|
|
||||||
export documents from test.test1 in CSV format
|
|
||||||
.SH "OPTIONS"
|
|
||||||
.TP
|
|
||||||
.B \-\-help
|
|
||||||
show usage information
|
|
||||||
.TP
|
|
||||||
.B \-\-version
|
|
||||||
show version information
|
|
||||||
.TP
|
|
||||||
.B \-v, \-\-verbose
|
|
||||||
be more verbose (include multiple times for more verbosity
|
|
||||||
e.g. \-vvvvv)
|
|
||||||
.TP
|
|
||||||
.B \-h, \-\-host HOST
|
|
||||||
server to connect to (default HOST=localhost)
|
|
||||||
.TP
|
|
||||||
.B \-\-port arg
|
|
||||||
server port. Can also use \-\-host hostname:port
|
|
||||||
.TP
|
|
||||||
.B \-\-ipv6
|
|
||||||
enable IPv6 support (disabled by default)
|
|
||||||
.TP
|
|
||||||
.B \-u|\-\-username USERNAME
|
|
||||||
specify user to log in as
|
|
||||||
.TP
|
|
||||||
.B \-p|\-\-password PASSWORD
|
|
||||||
specify password of user
|
|
||||||
.TP
|
|
||||||
.B \-\-dbpath PATH
|
|
||||||
directly access mongod data files in this path, instead of connecting to a mongod instance
|
|
||||||
.TP
|
|
||||||
.B \-\-directoryperdb
|
|
||||||
if dbpath specified, each db is in a separate directory
|
|
||||||
.TP
|
|
||||||
.B \-d, \-\-db DATABASE
|
|
||||||
database to use
|
|
||||||
.TP
|
|
||||||
.B \-c, \-\-c COLLECTION
|
|
||||||
collection to use
|
|
||||||
.TP
|
|
||||||
.B \-f, \-\-fields FIELDS
|
|
||||||
comma\-separated list of field names
|
|
||||||
.TP
|
|
||||||
.B \-\-fieldFile FILE
|
|
||||||
file with fields names \- 1 per line
|
|
||||||
.TP
|
|
||||||
.B \-\-query
|
|
||||||
JSON query filter
|
|
||||||
.TP
|
|
||||||
.B \-\-csv
|
|
||||||
export to CSV instead of JSON
|
|
||||||
.TP
|
|
||||||
.B \-o, \-\-out FILE
|
|
||||||
output file, if not specified, stdout is used
|
|
||||||
.TP
|
|
||||||
.B \-\-dbpath PATH
|
|
||||||
directly access mongod data files in this path, instead of connecting to a mongod instance
|
|
||||||
.SH "COPYRIGHT"
|
|
||||||
.PP
|
|
||||||
Copyright 2007\-2011 10gen
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
For more information, please refer to the MongoDB wiki, available at http://www.mongodb.org.
|
|
||||||
.SH "AUTHOR"
|
|
||||||
Kristina Chodorow
|
|
||||||
97
debian/manpages/mongofiles.1
vendored
97
debian/manpages/mongofiles.1
vendored
|
|
@ -1,97 +0,0 @@
|
||||||
.\" Documentation for the MongoDB dump tool
|
|
||||||
.TH MONGOFILES "1" "June 2009" "10gen" "Mongo Database"
|
|
||||||
.SH "NAME"
|
|
||||||
mongofiles \- a simple GridFS interface
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
\fBmongofiles [\fIOPTIONS\fR]\fR
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
\fBmongofiles\fR
|
|
||||||
is used to list, get, and insert files in the database.
|
|
||||||
.TP
|
|
||||||
Commands:
|
|
||||||
.TP
|
|
||||||
.B list
|
|
||||||
list all files. FILENAME is an optional prefix which listed filenames
|
|
||||||
must begin with.
|
|
||||||
.TP
|
|
||||||
.B search
|
|
||||||
search all files. FILENAME is a substring which listed
|
|
||||||
filenames must contain.
|
|
||||||
.TP
|
|
||||||
.B put
|
|
||||||
add a file with filename FILENAME
|
|
||||||
.TP
|
|
||||||
.B get
|
|
||||||
get a file with filename FILENAME
|
|
||||||
.TP
|
|
||||||
.B delete
|
|
||||||
delete all files with filename FILENAME
|
|
||||||
|
|
||||||
.SH "EXAMPLES"
|
|
||||||
.TP
|
|
||||||
.B mongofiles list
|
|
||||||
lists files in test.fs.files
|
|
||||||
.TP
|
|
||||||
.B mongofiles put README.txt
|
|
||||||
inserts the file README.txt into the collection test.fs.files
|
|
||||||
.TP
|
|
||||||
.B mongofiles get photo.jpg
|
|
||||||
retrieves photo.jpg from test.fs.files and saves it locally
|
|
||||||
.SH "OPTIONS"
|
|
||||||
.TP
|
|
||||||
.B \-\-help
|
|
||||||
show usage information
|
|
||||||
.TP
|
|
||||||
.B \-\-version
|
|
||||||
show version information
|
|
||||||
.TP
|
|
||||||
.B \-v, \-\-verbose
|
|
||||||
be more verbose (include multiple times for more verbosity
|
|
||||||
e.g. \-vvvvv)
|
|
||||||
.TP
|
|
||||||
.B \-h, \-\-host HOST
|
|
||||||
server to connect to (default HOST=localhost)
|
|
||||||
.TP
|
|
||||||
.B \-\-port arg
|
|
||||||
server port. Can also use \-\-host hostname:port
|
|
||||||
.TP
|
|
||||||
.B \-\-ipv6
|
|
||||||
enable IPv6 support (disabled by default)
|
|
||||||
.TP
|
|
||||||
.B \-u|\-\-username USERNAME
|
|
||||||
specify user to log in as
|
|
||||||
.TP
|
|
||||||
.B \-p|\-\-password PASSWORD
|
|
||||||
specify password of user
|
|
||||||
.TP
|
|
||||||
.B \-\-dbpath PATH
|
|
||||||
directly access mongod data files in this path, instead of connecting to a mongod instance
|
|
||||||
.TP
|
|
||||||
.B \-\-directoryperdb
|
|
||||||
if dbpath specified, each db is in a separate directory
|
|
||||||
.TP
|
|
||||||
.B \-d, \-\-db DATABASE
|
|
||||||
database to use
|
|
||||||
.TP
|
|
||||||
.B \-c, \-\-collection COLLECTION (default COLLECTION=fs.files)
|
|
||||||
collection to use
|
|
||||||
.TP
|
|
||||||
.B \-\-command [list\||\|search\||\|put\||\|get]
|
|
||||||
execute a command
|
|
||||||
.TP
|
|
||||||
.B \-\-file FILE
|
|
||||||
filename for get or put
|
|
||||||
.TP
|
|
||||||
.B list
|
|
||||||
list all files. takes an optional filename. the file has to start with the filename
|
|
||||||
.TP
|
|
||||||
.B search
|
|
||||||
search all files for something that contains the string
|
|
||||||
.SH "COPYRIGHT"
|
|
||||||
.PP
|
|
||||||
Copyright 2007\-2011 10gen
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
For more information, please refer to the MongoDB wiki, available at http://www.mongodb.org.
|
|
||||||
.SH "AUTHOR"
|
|
||||||
Kristina Chodorow
|
|
||||||
104
debian/manpages/mongoimport.1
vendored
104
debian/manpages/mongoimport.1
vendored
|
|
@ -1,104 +0,0 @@
|
||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1.
|
|
||||||
.TH MONGOIMPORT "1" "January 2010" "10gen" "Mongo Database"
|
|
||||||
.SH "NAME"
|
|
||||||
mongoimport \- the Mongo import tool
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
\fBmongoimport [\fIOPTIONS\fR]\fR
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
\fBmongoimport\fR
|
|
||||||
is a tool to import a MongoDB collection from JSON, CSV, or TSV. The query can be filtered or a list of fields to input can be given.
|
|
||||||
.\".SH "EXAMPLES"
|
|
||||||
.\".TP
|
|
||||||
.\".B mongoimport -d test -c test1 --csv -f "name,num"
|
|
||||||
.\"import documents from test.test1 in CSV format
|
|
||||||
.SH "OPTIONS"
|
|
||||||
.TP
|
|
||||||
.B \-\-help
|
|
||||||
show usage information
|
|
||||||
.TP
|
|
||||||
.B \-\-version
|
|
||||||
show version information
|
|
||||||
.TP
|
|
||||||
.B \-v, \-\-verbose
|
|
||||||
be more verbose (include multiple times for more verbosity
|
|
||||||
e.g. \-vvvvv)
|
|
||||||
.TP
|
|
||||||
.B \-h, \-\-host HOST
|
|
||||||
server to connect to (default HOST=localhost)
|
|
||||||
.TP
|
|
||||||
.B \-\-port arg
|
|
||||||
server port. Can also use \-\-host hostname:port
|
|
||||||
.TP
|
|
||||||
.B \-\-ipv6
|
|
||||||
enable IPv6 support (disabled by default)
|
|
||||||
.TP
|
|
||||||
.B \-u|\-\-username USERNAME
|
|
||||||
specify user to log in as
|
|
||||||
.TP
|
|
||||||
.B \-p|\-\-password PASSWORD
|
|
||||||
specify password of user
|
|
||||||
.TP
|
|
||||||
.B \-\-dbpath PATH
|
|
||||||
directly access mongod data files in this path, instead of connecting to a mongod instance
|
|
||||||
.TP
|
|
||||||
.B \-\-directoryperdb
|
|
||||||
if dbpath specified, each db is in a separate directory
|
|
||||||
.TP
|
|
||||||
.B \-d, \-\-db DATABASE
|
|
||||||
database to use
|
|
||||||
.TP
|
|
||||||
.B \-c, \-\-c COLLECTION
|
|
||||||
collection to use
|
|
||||||
.TP
|
|
||||||
.B \-\-dbpath PATH
|
|
||||||
directly access mongod data files in this path,
|
|
||||||
instead of connecting to a mongod instance
|
|
||||||
.TP
|
|
||||||
.B \-v, \-\-verbose
|
|
||||||
be more verbose (include multiple times for more
|
|
||||||
verbosity e.g. \fB\-vvvvv\fR)
|
|
||||||
.TP
|
|
||||||
.B \-f, \-\-fields NAMES
|
|
||||||
comma separated list of field names e.g. \fB\-f\fR name,age
|
|
||||||
.TP
|
|
||||||
.B \-\-fieldFile FILE
|
|
||||||
file with fields names \- 1 per line
|
|
||||||
.TP
|
|
||||||
.B \-\-jsonArray
|
|
||||||
load a json array, not one item per line. Currently limited to 4MB.
|
|
||||||
.TP
|
|
||||||
.B \-\-ignoreBlanks
|
|
||||||
if given, empty fields in csv and tsv will be ignored
|
|
||||||
.TP
|
|
||||||
.B \-\-type TYPE
|
|
||||||
type of file to import. default: json (json,csv,tsv)
|
|
||||||
.TP
|
|
||||||
.B \-\-file FILE
|
|
||||||
file to import from; if not specified stdin is used
|
|
||||||
.TP
|
|
||||||
.B \-\-drop
|
|
||||||
drop collection first
|
|
||||||
.TP
|
|
||||||
.B \-\-headerline
|
|
||||||
CSV,TSV only \- use first line as headers
|
|
||||||
.TP
|
|
||||||
.B \-\-upsert
|
|
||||||
insert or update objects that already exist
|
|
||||||
.TP
|
|
||||||
.B \-\-upsertFields ARG
|
|
||||||
comma-separated fields for the query part of the upsert. You should
|
|
||||||
make sure this is indexed
|
|
||||||
.TP
|
|
||||||
.B \-\-stopOnError
|
|
||||||
stop importing at first error rather than continuing
|
|
||||||
.TP
|
|
||||||
.B \-\-jsonArray
|
|
||||||
load a json array, not one item per line. Currently limited to 16MB.
|
|
||||||
.SH "COPYRIGHT"
|
|
||||||
.PP
|
|
||||||
Copyright 2007\-2011 10gen
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
For more information, please refer to the MongoDB wiki, available at http://www.mongodb.org.
|
|
||||||
.SH "AUTHOR"
|
|
||||||
Kristina Chodorow
|
|
||||||
66
debian/manpages/mongorestore.1
vendored
66
debian/manpages/mongorestore.1
vendored
|
|
@ -1,66 +0,0 @@
|
||||||
.\" Documentation for the MongoDB dump tool
|
|
||||||
.TH MONGORESTORE "1" "June 2009" "10gen" "Mongo Database"
|
|
||||||
.SH "NAME"
|
|
||||||
mongorestore \- the Mongo restoration tool
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
\fBmongorestore [\fIOPTIONS\fR]\fR
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
\fBmongorestore\fR
|
|
||||||
is a tool to use the output from mongodump to restore a database.
|
|
||||||
.SH "OPTIONS"
|
|
||||||
.TP
|
|
||||||
.B \-\-help
|
|
||||||
show usage information
|
|
||||||
.TP
|
|
||||||
.B \-\-version
|
|
||||||
show version information
|
|
||||||
.TP
|
|
||||||
.B \-h, \-\-host HOST
|
|
||||||
server to connect to (default HOST=localhost)
|
|
||||||
.TP
|
|
||||||
.B \-\-port arg
|
|
||||||
server port. Can also use \-\-host hostname:port
|
|
||||||
.TP
|
|
||||||
.B \-\-ipv6
|
|
||||||
enable IPv6 support (disabled by default)
|
|
||||||
.TP
|
|
||||||
.B \-u|\-\-username USERNAME
|
|
||||||
specify user to log in as
|
|
||||||
.TP
|
|
||||||
.B \-p|\-\-password PASSWORD
|
|
||||||
specify password of user (notice there is no space)
|
|
||||||
.TP
|
|
||||||
.B \-d, \-\-db DATABASE
|
|
||||||
database to use
|
|
||||||
.TP
|
|
||||||
.B \-c, \-\-c COLLECTION
|
|
||||||
collection to use
|
|
||||||
.TP
|
|
||||||
.B \-\-dir PATH
|
|
||||||
directory from which to restore
|
|
||||||
.TP
|
|
||||||
.B \-\-dbpath PATH
|
|
||||||
directly access mongod data files in this path, instead of connecting to a mongod instance
|
|
||||||
.TP
|
|
||||||
.B \-\-directoryperdb
|
|
||||||
if dbpath specified, each db is in a separate directory
|
|
||||||
.TP
|
|
||||||
.B \-\-objcheck
|
|
||||||
validate object before inserting
|
|
||||||
.TP
|
|
||||||
.B \-\-filter arg
|
|
||||||
filter to apply before inserting
|
|
||||||
.TP
|
|
||||||
.B \-\-drop
|
|
||||||
drop each collection before import
|
|
||||||
.TP
|
|
||||||
.B \-\-oplogReplay
|
|
||||||
replay oplog for point-in-time restore
|
|
||||||
.SH "COPYRIGHT"
|
|
||||||
.PP
|
|
||||||
Copyright 2007\-2011 10gen
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
For more information, please refer to the MongoDB wiki, available at http://www.mongodb.org.
|
|
||||||
.SH "AUTHOR"
|
|
||||||
Kristina Chodorow
|
|
||||||
91
debian/manpages/mongos.1
vendored
91
debian/manpages/mongos.1
vendored
|
|
@ -1,91 +0,0 @@
|
||||||
.\" Documentation for the MongoDB dump tool
|
|
||||||
.TH MONGOS "1" "June 2009" "10gen" "Mongo Database"
|
|
||||||
.SH "NAME"
|
|
||||||
mongos \- the Mongo sharding server
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
\fBmongos [\fIOPTIONS\fR]\fR
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
\fBmongos\fR
|
|
||||||
is used to setup, configure, and get information about sharded databases.
|
|
||||||
.SH "EXAMPLES"
|
|
||||||
.PP
|
|
||||||
.B ./mongod --port 9999 --dbpath /data/db/a # first server
|
|
||||||
.PP
|
|
||||||
.B ./mongod --port 9998 --dbpath /data/db/b # second server
|
|
||||||
.PP
|
|
||||||
.B ./mongos --configdb localhost:9999 # mongos
|
|
||||||
.PP
|
|
||||||
starts three servers to set up sharding
|
|
||||||
.SH "OPTIONS"
|
|
||||||
.TP
|
|
||||||
.B \-\-help
|
|
||||||
show usage information
|
|
||||||
.TP
|
|
||||||
.B \-h, \-\-help
|
|
||||||
show this usage information
|
|
||||||
.TP
|
|
||||||
.B \-\-version
|
|
||||||
show version information
|
|
||||||
.TP
|
|
||||||
.B \-f, \-\-config arg
|
|
||||||
configuration file specifying additional options
|
|
||||||
.TP
|
|
||||||
.B \-v, \-\-verbose
|
|
||||||
be more verbose (include multiple times for more verbosity
|
|
||||||
e.g. -vvvvv)
|
|
||||||
.TP
|
|
||||||
.B \-\-quiet quieter output
|
|
||||||
.TP
|
|
||||||
.B \-\-port arg specify port number
|
|
||||||
.TP
|
|
||||||
.B \-\-bind_ip arg
|
|
||||||
comma separated list of ip addresses to listen on - all local ips by
|
|
||||||
default
|
|
||||||
.TP
|
|
||||||
.B \-\-logpath arg
|
|
||||||
log file to send write to instead of stdout - has to be a file, not
|
|
||||||
directory
|
|
||||||
.TP
|
|
||||||
.B \-\-logappend
|
|
||||||
append to logpath instead of over-writing
|
|
||||||
.TP
|
|
||||||
.B \-\-pidfilepath arg
|
|
||||||
full path to pidfile (if not set, no pidfile is created)
|
|
||||||
.TP
|
|
||||||
.B \-\-keyFile arg
|
|
||||||
private key for cluster authentication (only for replica sets)
|
|
||||||
.TP
|
|
||||||
.B \-\-unixSocketPrefix arg
|
|
||||||
alternative directory for UNIX domain sockets (defaults to /tmp)
|
|
||||||
.TP
|
|
||||||
.B \-\-fork
|
|
||||||
fork server process
|
|
||||||
|
|
||||||
.SH "SHARDING OPTIONS"
|
|
||||||
.TP
|
|
||||||
.B \-\-configdb arg
|
|
||||||
1 or 3 comma separated config servers
|
|
||||||
.TP
|
|
||||||
.B \-\-test
|
|
||||||
just run unit tests
|
|
||||||
.TP
|
|
||||||
.B \-\-upgrade
|
|
||||||
upgrade meta data version
|
|
||||||
.TP
|
|
||||||
.B \-\-chunkSize arg
|
|
||||||
maximum amount of data per chunk
|
|
||||||
.TP
|
|
||||||
.B \-\-ipv6
|
|
||||||
enable IPv6 support (disabled by default)
|
|
||||||
.TP
|
|
||||||
.B \-\-jsonp
|
|
||||||
allow JSONP access via http (has security implications)
|
|
||||||
.SH "COPYRIGHT"
|
|
||||||
.PP
|
|
||||||
Copyright 2007\-2011 10gen
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
For more information, please refer to the MongoDB wiki, available at
|
|
||||||
http://www.mongodb.org.
|
|
||||||
.SH "AUTHOR"
|
|
||||||
Kristina Chodorow
|
|
||||||
33
debian/manpages/mongosniff.1
vendored
33
debian/manpages/mongosniff.1
vendored
|
|
@ -1,33 +0,0 @@
|
||||||
.TH MONGOSNIFF "1" "Jan 2010" "10gen" "Mongo Database"
|
|
||||||
.SH "NAME"
|
|
||||||
mongosniff \- the Mongo packet analyzer
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
\fBmongosniff [\fIOPTIONS\fR] [\fI<port0> <port1> ...\fR]
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
\fBmongosniff\fR
|
|
||||||
is a analyzer tool for analyzing packets coming to your database.
|
|
||||||
.PP
|
|
||||||
.SH "OPTIONS"
|
|
||||||
.TP
|
|
||||||
.B \-\-forward
|
|
||||||
Forward all parsed request messages to mongod instance at specified host:port
|
|
||||||
.TP
|
|
||||||
.B \-\-source
|
|
||||||
Source of traffic to sniff, either a network interface or a file containing previously captured packets, in pcap format. If no source is specified, mongosniff will attempt to sniff from one of the machine's network interfaces.
|
|
||||||
.TP
|
|
||||||
.B \-\-help
|
|
||||||
print a short help message.
|
|
||||||
.TP
|
|
||||||
.B <port0>
|
|
||||||
These parameters are used to filter sniffing. By default, only port 27017 is sniffed.
|
|
||||||
.TP
|
|
||||||
.B \-\-help
|
|
||||||
show usage information
|
|
||||||
.SH "COPYRIGHT"
|
|
||||||
.PP
|
|
||||||
Copyright 2007\-2011 10gen
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
For more information, please refer to the MongoDB wiki, available at http://www.mongodb.org.
|
|
||||||
.SH "AUTHOR"
|
|
||||||
Antonin Kral
|
|
||||||
115
debian/manpages/mongostat.1
vendored
115
debian/manpages/mongostat.1
vendored
|
|
@ -1,115 +0,0 @@
|
||||||
.\" Documentation for the MongoDB shell
|
|
||||||
.TH MONGOSTAT "1" "March 2010" "10gen" "Mongo Database"
|
|
||||||
.SH "NAME"
|
|
||||||
mongostat \- view statistics on a running mongod instance
|
|
||||||
.SH "SYNOPSIS"
|
|
||||||
\fBmongostat [\fIOPTIONS\fR] [\fISLEEP TIME\fR]
|
|
||||||
.SH "DESCRIPTION"
|
|
||||||
.PP
|
|
||||||
\fBmongostat\fR
|
|
||||||
prints statistics on a running mongod instance. [\fISLEEP TIME\fR] is
|
|
||||||
time to wait (in seconds) between calls to servers
|
|
||||||
.SH "OPTIONS"
|
|
||||||
.TP
|
|
||||||
.B \-\-help
|
|
||||||
show usage information
|
|
||||||
.TP
|
|
||||||
.B \-\-version
|
|
||||||
show version information
|
|
||||||
.TP
|
|
||||||
.B \-v, \-\-verbose
|
|
||||||
be more verbose (include multiple times for more verbosity
|
|
||||||
e.g. \-vvvvv)
|
|
||||||
.TP
|
|
||||||
.B \-h, \-\-host arg
|
|
||||||
mongo host to connect to ( <set name>/s1,s2 for sets)
|
|
||||||
.TP
|
|
||||||
.B \-\-port arg
|
|
||||||
server port. Can also use \-\-host hostname:port
|
|
||||||
.TP
|
|
||||||
.B \-\-ipv6
|
|
||||||
enable IPv6 support (disabled by default)
|
|
||||||
.TP
|
|
||||||
.B \-u, \-\-username arg
|
|
||||||
username
|
|
||||||
.TP
|
|
||||||
.B \-p, \-\-password arg
|
|
||||||
password
|
|
||||||
.TP
|
|
||||||
.B \-\-noheaders
|
|
||||||
don't output column names
|
|
||||||
.TP
|
|
||||||
.B \-n, \-\-rowcount arg
|
|
||||||
number of stats lines to print (0 for indefinite)
|
|
||||||
.TP
|
|
||||||
.B \-\-http
|
|
||||||
use http instead of raw db connection
|
|
||||||
.TP
|
|
||||||
.B \-\-discover
|
|
||||||
discover nodes and display stats for all
|
|
||||||
.TP
|
|
||||||
.B \-\-all
|
|
||||||
all optional fields
|
|
||||||
.SH "FIELDS"
|
|
||||||
.TP
|
|
||||||
.B inserts
|
|
||||||
# of inserts per second
|
|
||||||
.TP
|
|
||||||
.B query
|
|
||||||
# of queries per second
|
|
||||||
.TP
|
|
||||||
.B update
|
|
||||||
# of updates per second
|
|
||||||
.TP
|
|
||||||
.B delete
|
|
||||||
# of deletes per second
|
|
||||||
.TP
|
|
||||||
.B getmore
|
|
||||||
# of get mores (cursor batch) per second
|
|
||||||
.TP
|
|
||||||
.B command
|
|
||||||
# of commands per second
|
|
||||||
.TP
|
|
||||||
.B flushes
|
|
||||||
# of fsync flushes per second
|
|
||||||
.TP
|
|
||||||
.B mapped
|
|
||||||
amount of data mmaped (total data size) megabytes
|
|
||||||
.TP
|
|
||||||
.B visze
|
|
||||||
virtual size of process in megabytes
|
|
||||||
.TP
|
|
||||||
.B res
|
|
||||||
resident size of process in megabytes
|
|
||||||
.TP
|
|
||||||
.B faults
|
|
||||||
# of pages faults per sec (linux only)
|
|
||||||
.TP
|
|
||||||
.B locked
|
|
||||||
percent of time in global write lock
|
|
||||||
.TP
|
|
||||||
.B idx
|
|
||||||
percent of btree page misses (sampled)
|
|
||||||
.TP
|
|
||||||
.B qr
|
|
||||||
queue lengths for clients waiting (read|write)
|
|
||||||
.TP
|
|
||||||
.B ar
|
|
||||||
active clients (read|write)
|
|
||||||
.TP
|
|
||||||
.B netIn
|
|
||||||
network traffic in - bits
|
|
||||||
.TP
|
|
||||||
.B netOut
|
|
||||||
network traffic out - bits
|
|
||||||
.TP
|
|
||||||
.B conn
|
|
||||||
number of open connections
|
|
||||||
.SH "COPYRIGHT"
|
|
||||||
.PP
|
|
||||||
Copyright 2011 10gen
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
For more information, please refer to the MongoDB wiki, available at
|
|
||||||
http://www.mongodb.org.
|
|
||||||
.SH "AUTHOR"
|
|
||||||
Eliot Horowitz
|
|
||||||
1
debian/mongodb-clients.dirs
vendored
1
debian/mongodb-clients.dirs
vendored
|
|
@ -1 +0,0 @@
|
||||||
usr/bin
|
|
||||||
7
debian/mongodb-clients.install
vendored
7
debian/mongodb-clients.install
vendored
|
|
@ -1,7 +0,0 @@
|
||||||
debian/tmp/usr/bin/mongo
|
|
||||||
debian/tmp/usr/bin/mongodump
|
|
||||||
debian/tmp/usr/bin/mongoexport
|
|
||||||
debian/tmp/usr/bin/mongofiles
|
|
||||||
debian/tmp/usr/bin/mongoimport
|
|
||||||
debian/tmp/usr/bin/mongorestore
|
|
||||||
debian/tmp/usr/bin/mongostat
|
|
||||||
30
debian/mongodb-clients.lintian-overrides
vendored
30
debian/mongodb-clients.lintian-overrides
vendored
|
|
@ -1,30 +0,0 @@
|
||||||
# Agreed with upstream, that redefining rpath is necessary as xulrunner used to
|
|
||||||
# change API without changing so-name
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath ./usr/bin/mongo /usr/lib/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath ./usr/bin/mongodump /usr/lib/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath ./usr/bin/mongoexport /usr/lib/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath ./usr/bin/mongofiles /usr/lib/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath ./usr/bin/mongoimport /usr/lib/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath ./usr/bin/mongorestore /usr/lib/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath ./usr/bin/mongostat /usr/lib/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath ./usr/bin/mongo /usr/lib64/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath ./usr/bin/mongodump /usr/lib64/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath ./usr/bin/mongoexport /usr/lib64/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath ./usr/bin/mongofiles /usr/lib64/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath ./usr/bin/mongoimport /usr/lib64/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath ./usr/bin/mongorestore /usr/lib64/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath ./usr/bin/mongostat /usr/lib64/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath usr/bin/mongo /usr/lib/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath usr/bin/mongodump /usr/lib/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath usr/bin/mongoexport /usr/lib/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath usr/bin/mongofiles /usr/lib/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath usr/bin/mongoimport /usr/lib/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath usr/bin/mongorestore /usr/lib/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath usr/bin/mongostat /usr/lib/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath usr/bin/mongo /usr/lib64/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath usr/bin/mongodump /usr/lib64/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath usr/bin/mongoexport /usr/lib64/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath usr/bin/mongofiles /usr/lib64/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath usr/bin/mongoimport /usr/lib64/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath usr/bin/mongorestore /usr/lib64/xulrunner-1.9.1
|
|
||||||
mongodb-clients: binary-or-shlib-defines-rpath usr/bin/mongostat /usr/lib64/xulrunner-1.9.1
|
|
||||||
8
debian/mongodb-clients.manpages
vendored
8
debian/mongodb-clients.manpages
vendored
|
|
@ -1,8 +0,0 @@
|
||||||
debian/manpages/mongo.1
|
|
||||||
debian/manpages/mongodump.1
|
|
||||||
debian/manpages/mongoexport.1
|
|
||||||
debian/manpages/mongofiles.1
|
|
||||||
debian/manpages/mongoimport.1
|
|
||||||
debian/manpages/mongorestore.1
|
|
||||||
debian/manpages/mongosniff.1
|
|
||||||
debian/manpages/mongostat.1
|
|
||||||
2
debian/mongodb-dev.dirs
vendored
2
debian/mongodb-dev.dirs
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
usr/include
|
|
||||||
usr/lib
|
|
||||||
2
debian/mongodb-dev.install
vendored
2
debian/mongodb-dev.install
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
debian/tmp/usr/include
|
|
||||||
debian/tmp/usr/lib
|
|
||||||
4
debian/mongodb-server.dirs
vendored
4
debian/mongodb-server.dirs
vendored
|
|
@ -1,4 +0,0 @@
|
||||||
etc
|
|
||||||
usr/bin
|
|
||||||
var/lib/mongodb
|
|
||||||
var/log/mongodb
|
|
||||||
3
debian/mongodb-server.install
vendored
3
debian/mongodb-server.install
vendored
|
|
@ -1,3 +0,0 @@
|
||||||
debian/mongodb.conf etc
|
|
||||||
debian/tmp/usr/bin/mongod
|
|
||||||
debian/tmp/usr/bin/mongos
|
|
||||||
10
debian/mongodb-server.lintian-overrides
vendored
10
debian/mongodb-server.lintian-overrides
vendored
|
|
@ -1,10 +0,0 @@
|
||||||
# Agreed with upstream, that redefining rpath is necessary as xulrunner used to
|
|
||||||
# change API without changing so-name
|
|
||||||
mongodb-server: binary-or-shlib-defines-rpath ./usr/bin/mongod /usr/lib/xulrunner-1.9.1
|
|
||||||
mongodb-server: binary-or-shlib-defines-rpath ./usr/bin/mongos /usr/lib/xulrunner-1.9.1
|
|
||||||
mongodb-server: binary-or-shlib-defines-rpath ./usr/bin/mongod /usr/lib64/xulrunner-1.9.1
|
|
||||||
mongodb-server: binary-or-shlib-defines-rpath ./usr/bin/mongos /usr/lib64/xulrunner-1.9.1
|
|
||||||
mongodb-server: binary-or-shlib-defines-rpath usr/bin/mongod /usr/lib/xulrunner-1.9.1
|
|
||||||
mongodb-server: binary-or-shlib-defines-rpath usr/bin/mongos /usr/lib/xulrunner-1.9.1
|
|
||||||
mongodb-server: binary-or-shlib-defines-rpath usr/bin/mongod /usr/lib64/xulrunner-1.9.1
|
|
||||||
mongodb-server: binary-or-shlib-defines-rpath usr/bin/mongos /usr/lib64/xulrunner-1.9.1
|
|
||||||
10
debian/mongodb-server.logrotate
vendored
10
debian/mongodb-server.logrotate
vendored
|
|
@ -1,10 +0,0 @@
|
||||||
/var/log/mongodb/*.log {
|
|
||||||
weekly
|
|
||||||
rotate 10
|
|
||||||
copytruncate
|
|
||||||
delaycompress
|
|
||||||
compress
|
|
||||||
notifempty
|
|
||||||
missingok
|
|
||||||
}
|
|
||||||
|
|
||||||
2
debian/mongodb-server.manpages
vendored
2
debian/mongodb-server.manpages
vendored
|
|
@ -1,2 +0,0 @@
|
||||||
debian/manpages/mongod.1
|
|
||||||
debian/manpages/mongos.1
|
|
||||||
239
debian/mongodb-server.mongodb.init
vendored
239
debian/mongodb-server.mongodb.init
vendored
|
|
@ -1,239 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# init.d script with LSB support.
|
|
||||||
#
|
|
||||||
# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org>
|
|
||||||
#
|
|
||||||
# This is free software; you may redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as
|
|
||||||
# published by the Free Software Foundation; either version 2,
|
|
||||||
# or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# This is distributed in the hope that it will be useful, but
|
|
||||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License with
|
|
||||||
# the Debian operating system, in /usr/share/common-licenses/GPL; if
|
|
||||||
# not, write to the Free Software Foundation, Inc., 59 Temple Place,
|
|
||||||
# Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
#
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: mongodb
|
|
||||||
# Required-Start: $network $local_fs $remote_fs
|
|
||||||
# Required-Stop: $network $local_fs $remote_fs
|
|
||||||
# Should-Start: $named
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start: 2 3 4 5
|
|
||||||
# Default-Stop: 0 1 6
|
|
||||||
# Short-Description: An object/document-oriented database
|
|
||||||
# Description: MongoDB is a high-performance, open source, schema-free
|
|
||||||
# document-oriented data store that's easy to deploy, manage
|
|
||||||
# and use. It's network accessible, written in C++ and offers
|
|
||||||
# the following features:
|
|
||||||
# .
|
|
||||||
# * Collection oriented storage - easy storage of object-
|
|
||||||
# style data
|
|
||||||
# * Full index support, including on inner objects
|
|
||||||
# * Query profiling
|
|
||||||
# * Replication and fail-over support
|
|
||||||
# * Efficient storage of binary data including large
|
|
||||||
# objects (e.g. videos)
|
|
||||||
# * Auto-sharding for cloud-level scalability (Q209)
|
|
||||||
# .
|
|
||||||
# This package is build with V8 JavaScript engine.
|
|
||||||
# .
|
|
||||||
# High performance, scalability, and reasonable depth of
|
|
||||||
# functionality are the goals for the project.
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|
||||||
DAEMON=/usr/bin/mongod
|
|
||||||
DESC=database
|
|
||||||
|
|
||||||
# Default defaults. Can be overridden by the /etc/default/$NAME
|
|
||||||
NAME=mongodb
|
|
||||||
CONF=/etc/mongodb.conf
|
|
||||||
RUNDIR=/var/run/mongodb
|
|
||||||
PIDFILE=$RUNDIR/$NAME.pid
|
|
||||||
ENABLE_MONGODB=yes
|
|
||||||
|
|
||||||
# Include mongodb defaults if available
|
|
||||||
if [ -f /etc/default/$NAME ] ; then
|
|
||||||
. /etc/default/$NAME
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test ! -x $DAEMON; then
|
|
||||||
echo "Could not find $DAEMON"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "x$ENABLE_MONGODB" != "xyes"; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
STARTTIME=1
|
|
||||||
DIETIME=10 # Time to wait for the server to die, in seconds
|
|
||||||
# If this value is set too low you might not
|
|
||||||
# let some servers to die gracefully and
|
|
||||||
# 'restart' will not work
|
|
||||||
|
|
||||||
DAEMONUSER=${DAEMONUSER:-mongodb}
|
|
||||||
DAEMON_OPTS=${DAEMON_OPTS:-"--unixSocketPrefix=$RUNDIR --config $CONF run"}
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
|
|
||||||
running_pid() {
|
|
||||||
# Check if a given process pid's cmdline matches a given name
|
|
||||||
pid=$1
|
|
||||||
name=$2
|
|
||||||
[ -z "$pid" ] && return 1
|
|
||||||
[ ! -d /proc/$pid ] && return 1
|
|
||||||
cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1`
|
|
||||||
# Is this the expected server
|
|
||||||
[ "$cmd" != "$name" ] && return 1
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
running() {
|
|
||||||
# Check if the process is running looking at /proc
|
|
||||||
# (works for all users)
|
|
||||||
|
|
||||||
# No pidfile, probably no daemon present
|
|
||||||
[ ! -f "$PIDFILE" ] && return 1
|
|
||||||
pid=`cat $PIDFILE`
|
|
||||||
running_pid $pid $DAEMON || return 1
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
start_server() {
|
|
||||||
test -e "$RUNDIR" || install -m 755 -o mongodb -g mongodb -d "$RUNDIR"
|
|
||||||
# Start the process using the wrapper
|
|
||||||
start-stop-daemon --background --start --quiet --pidfile $PIDFILE \
|
|
||||||
--make-pidfile --chuid $DAEMONUSER \
|
|
||||||
--exec $DAEMON -- $DAEMON_OPTS
|
|
||||||
errcode=$?
|
|
||||||
return $errcode
|
|
||||||
}
|
|
||||||
|
|
||||||
stop_server() {
|
|
||||||
# Stop the process using the wrapper
|
|
||||||
start-stop-daemon --stop --quiet --pidfile $PIDFILE \
|
|
||||||
--user $DAEMONUSER \
|
|
||||||
--exec $DAEMON
|
|
||||||
errcode=$?
|
|
||||||
return $errcode
|
|
||||||
}
|
|
||||||
|
|
||||||
force_stop() {
|
|
||||||
# Force the process to die killing it manually
|
|
||||||
[ ! -e "$PIDFILE" ] && return
|
|
||||||
if running ; then
|
|
||||||
kill -15 $pid
|
|
||||||
# Is it really dead?
|
|
||||||
sleep "$DIETIME"s
|
|
||||||
if running ; then
|
|
||||||
kill -9 $pid
|
|
||||||
sleep "$DIETIME"s
|
|
||||||
if running ; then
|
|
||||||
echo "Cannot kill $NAME (pid=$pid)!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
rm -f $PIDFILE
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
start)
|
|
||||||
log_daemon_msg "Starting $DESC" "$NAME"
|
|
||||||
# Check if it's running first
|
|
||||||
if running ; then
|
|
||||||
log_progress_msg "apparently already running"
|
|
||||||
log_end_msg 0
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
if start_server ; then
|
|
||||||
# NOTE: Some servers might die some time after they start,
|
|
||||||
# this code will detect this issue if STARTTIME is set
|
|
||||||
# to a reasonable value
|
|
||||||
[ -n "$STARTTIME" ] && sleep $STARTTIME # Wait some time
|
|
||||||
if running ; then
|
|
||||||
# It's ok, the server started and is running
|
|
||||||
log_end_msg 0
|
|
||||||
else
|
|
||||||
# It is not running after we did start
|
|
||||||
log_end_msg 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
# Either we could not start it
|
|
||||||
log_end_msg 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
log_daemon_msg "Stopping $DESC" "$NAME"
|
|
||||||
if running ; then
|
|
||||||
# Only stop the server if we see it running
|
|
||||||
errcode=0
|
|
||||||
stop_server || errcode=$?
|
|
||||||
log_end_msg $errcode
|
|
||||||
else
|
|
||||||
# If it's not running don't do anything
|
|
||||||
log_progress_msg "apparently not running"
|
|
||||||
log_end_msg 0
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
force-stop)
|
|
||||||
# First try to stop gracefully the program
|
|
||||||
$0 stop
|
|
||||||
if running; then
|
|
||||||
# If it's still running try to kill it more forcefully
|
|
||||||
log_daemon_msg "Stopping (force) $DESC" "$NAME"
|
|
||||||
errcode=0
|
|
||||||
force_stop || errcode=$?
|
|
||||||
log_end_msg $errcode
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
restart|force-reload)
|
|
||||||
log_daemon_msg "Restarting $DESC" "$NAME"
|
|
||||||
errcode=0
|
|
||||||
stop_server || errcode=$?
|
|
||||||
# Wait some sensible amount, some server need this
|
|
||||||
[ -n "$DIETIME" ] && sleep $DIETIME
|
|
||||||
start_server || errcode=$?
|
|
||||||
[ -n "$STARTTIME" ] && sleep $STARTTIME
|
|
||||||
running || errcode=$?
|
|
||||||
log_end_msg $errcode
|
|
||||||
;;
|
|
||||||
status)
|
|
||||||
|
|
||||||
log_daemon_msg "Checking status of $DESC" "$NAME"
|
|
||||||
if running ; then
|
|
||||||
log_progress_msg "running"
|
|
||||||
log_end_msg 0
|
|
||||||
else
|
|
||||||
log_progress_msg "apparently not running"
|
|
||||||
log_end_msg 1
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
# MongoDB can't reload its configuration.
|
|
||||||
reload)
|
|
||||||
log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon"
|
|
||||||
log_warning_msg "cannot re-read the config file (use restart)."
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
N=/etc/init.d/$NAME
|
|
||||||
echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
59
debian/mongodb-server.postinst
vendored
59
debian/mongodb-server.postinst
vendored
|
|
@ -1,59 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
# postinst script for mongodb
|
|
||||||
#
|
|
||||||
# see: dh_installdeb(1)
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# summary of how this script can be called:
|
|
||||||
# * <postinst> `configure' <most-recently-configured-version>
|
|
||||||
# * <old-postinst> `abort-upgrade' <new version>
|
|
||||||
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
|
|
||||||
# <new-version>
|
|
||||||
# * <postinst> `abort-remove'
|
|
||||||
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
|
|
||||||
# <failed-install-package> <version> `removing'
|
|
||||||
# <conflicting-package> <version>
|
|
||||||
# for details, see http://www.debian.org/doc/debian-policy/ or
|
|
||||||
# the debian-policy package
|
|
||||||
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
configure)
|
|
||||||
# create a mongodb group and user
|
|
||||||
if ! grep -q mongodb /etc/passwd; then
|
|
||||||
adduser --system --no-create-home mongodb
|
|
||||||
addgroup --system mongodb
|
|
||||||
adduser mongodb mongodb
|
|
||||||
fi
|
|
||||||
|
|
||||||
# create db -- note: this should agree with dbpath in mongodb.conf
|
|
||||||
mkdir -p /var/lib/mongodb
|
|
||||||
chown -R mongodb:mongodb /var/lib/mongodb
|
|
||||||
|
|
||||||
# create logdir -- note: this should agree with logpath in mongodb.conf
|
|
||||||
mkdir -p /var/log/mongodb
|
|
||||||
chown -R mongodb:mongodb /var/log/mongodb
|
|
||||||
|
|
||||||
# create rundir
|
|
||||||
mkdir -p /var/run/mongodb
|
|
||||||
chown -R mongodb:mongodb /var/run/mongodb
|
|
||||||
;;
|
|
||||||
|
|
||||||
abort-upgrade|abort-remove|abort-deconfigure)
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "postinst called with unknown argument \`$1'" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# dh_installdeb will replace this with shell code automatically
|
|
||||||
# generated by other debhelper scripts.
|
|
||||||
|
|
||||||
#DEBHELPER#
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
|
|
||||||
40
debian/mongodb-server.postrm
vendored
40
debian/mongodb-server.postrm
vendored
|
|
@ -1,40 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
# postrm script for mongodb
|
|
||||||
#
|
|
||||||
# see: dh_installdeb(1)
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# summary of how this script can be called:
|
|
||||||
# * <postrm> `remove'
|
|
||||||
# * <postrm> `purge'
|
|
||||||
# * <old-postrm> `upgrade' <new-version>
|
|
||||||
# * <new-postrm> `failed-upgrade' <old-version>
|
|
||||||
# * <new-postrm> `abort-install'
|
|
||||||
# * <new-postrm> `abort-install' <old-version>
|
|
||||||
# * <new-postrm> `abort-upgrade' <old-version>
|
|
||||||
# * <disappearer's-postrm> `disappear' <overwriter>
|
|
||||||
# <overwriter-version>
|
|
||||||
# for details, see http://www.debian.org/doc/debian-policy/ or
|
|
||||||
# the debian-policy package
|
|
||||||
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
|
||||||
rm -rf /var/run/mongodb
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "postrm called with unknown argument \`$1'" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# dh_installdeb will replace this with shell code automatically
|
|
||||||
# generated by other debhelper scripts.
|
|
||||||
|
|
||||||
#DEBHELPER#
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
|
|
||||||
41
debian/mongodb-server.prerm
vendored
41
debian/mongodb-server.prerm
vendored
|
|
@ -1,41 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
# prerm script for mongodb
|
|
||||||
#
|
|
||||||
# see: dh_installdeb(1)
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# summary of how this script can be called:
|
|
||||||
# * <prerm> `remove'
|
|
||||||
# * <old-prerm> `upgrade' <new-version>
|
|
||||||
# * <new-prerm> `failed-upgrade' <old-version>
|
|
||||||
# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
|
|
||||||
# * <deconfigured's-prerm> `deconfigure' `in-favour'
|
|
||||||
# <package-being-installed> <version> `removing'
|
|
||||||
# <conflicting-package> <version>
|
|
||||||
# for details, see http://www.debian.org/doc/debian-policy/ or
|
|
||||||
# the debian-policy package
|
|
||||||
|
|
||||||
echo "arg: $1"
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
remove|upgrade|deconfigure)
|
|
||||||
;;
|
|
||||||
|
|
||||||
failed-upgrade)
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "prerm called with unknown argument \`$1'" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# dh_installdeb will replace this with shell code automatically
|
|
||||||
# generated by other debhelper scripts.
|
|
||||||
|
|
||||||
#DEBHELPER#
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
|
|
||||||
93
debian/mongodb.conf
vendored
93
debian/mongodb.conf
vendored
|
|
@ -1,93 +0,0 @@
|
||||||
# mongodb.conf
|
|
||||||
|
|
||||||
# Where to store the data.
|
|
||||||
dbpath=/var/lib/mongodb
|
|
||||||
|
|
||||||
#where to log
|
|
||||||
logpath=/var/log/mongodb/mongodb.log
|
|
||||||
|
|
||||||
logappend=true
|
|
||||||
|
|
||||||
bind_ip = 127.0.0.1
|
|
||||||
#port = 27017
|
|
||||||
|
|
||||||
# Enable journaling, http://www.mongodb.org/display/DOCS/Journaling
|
|
||||||
journal=true
|
|
||||||
|
|
||||||
# Enables periodic logging of CPU utilization and I/O wait
|
|
||||||
#cpu = true
|
|
||||||
|
|
||||||
# Turn on/off security. Off is currently the default
|
|
||||||
#noauth = true
|
|
||||||
#auth = true
|
|
||||||
|
|
||||||
# Verbose logging output.
|
|
||||||
#verbose = true
|
|
||||||
|
|
||||||
# Inspect all client data for validity on receipt (useful for
|
|
||||||
# developing drivers)
|
|
||||||
#objcheck = true
|
|
||||||
|
|
||||||
# Enable db quota management
|
|
||||||
#quota = true
|
|
||||||
|
|
||||||
# Set oplogging level where n is
|
|
||||||
# 0=off (default)
|
|
||||||
# 1=W
|
|
||||||
# 2=R
|
|
||||||
# 3=both
|
|
||||||
# 7=W+some reads
|
|
||||||
#oplog = 0
|
|
||||||
|
|
||||||
# Diagnostic/debugging option
|
|
||||||
#nocursors = true
|
|
||||||
|
|
||||||
# Ignore query hints
|
|
||||||
#nohints = true
|
|
||||||
|
|
||||||
# Disable the HTTP interface (Defaults to localhost:27018).
|
|
||||||
#nohttpinterface = true
|
|
||||||
|
|
||||||
# Turns off server-side scripting. This will result in greatly limited
|
|
||||||
# functionality
|
|
||||||
#noscripting = true
|
|
||||||
|
|
||||||
# Turns off table scans. Any query that would do a table scan fails.
|
|
||||||
#notablescan = true
|
|
||||||
|
|
||||||
# Disable data file preallocation.
|
|
||||||
#noprealloc = true
|
|
||||||
|
|
||||||
# Specify .ns file size for new databases.
|
|
||||||
# nssize = <size>
|
|
||||||
|
|
||||||
# Accout token for Mongo monitoring server.
|
|
||||||
#mms-token = <token>
|
|
||||||
|
|
||||||
# Server name for Mongo monitoring server.
|
|
||||||
#mms-name = <server-name>
|
|
||||||
|
|
||||||
# Ping interval for Mongo monitoring server.
|
|
||||||
#mms-interval = <seconds>
|
|
||||||
|
|
||||||
# Replication Options
|
|
||||||
|
|
||||||
# in replicated mongo databases, specify here whether this is a slave or master
|
|
||||||
#slave = true
|
|
||||||
#source = master.example.com
|
|
||||||
# Slave only: specify a single database to replicate
|
|
||||||
#only = master.example.com
|
|
||||||
# or
|
|
||||||
#master = true
|
|
||||||
#source = slave.example.com
|
|
||||||
|
|
||||||
# Address of a server to pair with.
|
|
||||||
#pairwith = <server:port>
|
|
||||||
# Address of arbiter server.
|
|
||||||
#arbiter = <server:port>
|
|
||||||
# Automatically resync if slave data is stale
|
|
||||||
#autoresync
|
|
||||||
# Custom size for replication operation log.
|
|
||||||
#oplogSize = <MB>
|
|
||||||
# Size limit for in-memory storage of op ids.
|
|
||||||
#opIdMem = <bytes>
|
|
||||||
30
debian/rules
vendored
30
debian/rules
vendored
|
|
@ -1,30 +0,0 @@
|
||||||
#!/usr/bin/make -f
|
|
||||||
|
|
||||||
include /usr/share/cdbs/1/rules/utils.mk
|
|
||||||
include /usr/share/cdbs/1/class/scons.mk
|
|
||||||
include /usr/share/cdbs/1/rules/debhelper.mk
|
|
||||||
|
|
||||||
DEB_DH_INSTALLINIT_ARGS = --name=mongodb
|
|
||||||
|
|
||||||
DEB_SCONS_OPTIONS :=
|
|
||||||
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
|
|
||||||
DEB_SCONS_OPTIONS := --d=DEBUGBUILD
|
|
||||||
endif
|
|
||||||
ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
|
|
||||||
DEB_SCONS_OPTIONS := --d=DEBUGBUILD
|
|
||||||
endif
|
|
||||||
ifneq (,$(findstring parallel,$(DEB_BUILD_OPTIONS)))
|
|
||||||
PROCS=$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
|
|
||||||
DEB_SCONS_OPTIONS += -j$(PROCS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
DEB_SCONS_BUILD_TARGET = all
|
|
||||||
DEB_SCONS_INSTALL_OPTIONS += --prefix=$(CURDIR)/debian/tmp/usr --full
|
|
||||||
DEB_SCONS_CHECK_TARGET = --smokedbprefix=$(CURDIR)/debian/tmp-test smoke
|
|
||||||
|
|
||||||
clean::
|
|
||||||
find . -name "*.pyc" -delete
|
|
||||||
rm -f buildinfo.cpp
|
|
||||||
rm -rf debian/tmp-test
|
|
||||||
rm -rf .scons
|
|
||||||
|
|
||||||
1
debian/source/format
vendored
1
debian/source/format
vendored
|
|
@ -1 +0,0 @@
|
||||||
3.0 (quilt)
|
|
||||||
4
debian/watch
vendored
4
debian/watch
vendored
|
|
@ -1,4 +0,0 @@
|
||||||
version=3
|
|
||||||
opts=uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|BETA|beta|alpha|b|a)[\-\.]?\d*)$/$1~$2/ \
|
|
||||||
http://www.mongodb.org/downloads .*/mongodb-src-r(\d.*)\.(?:tgz|tar\.(?:gz|bz2|xz))
|
|
||||||
# Bart Martens <bartm@debian.org> Sun, 10 Feb 2013 07:18:34 +0000
|
|
||||||
|
|
@ -1,661 +0,0 @@
|
||||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 19 November 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU Affero General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works, specifically designed to ensure
|
|
||||||
cooperation with the community in the case of network server software.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
our General Public Licenses are intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
Developers that use our General Public Licenses protect your rights
|
|
||||||
with two steps: (1) assert copyright on the software, and (2) offer
|
|
||||||
you this License which gives you legal permission to copy, distribute
|
|
||||||
and/or modify the software.
|
|
||||||
|
|
||||||
A secondary benefit of defending all users' freedom is that
|
|
||||||
improvements made in alternate versions of the program, if they
|
|
||||||
receive widespread use, become available for other developers to
|
|
||||||
incorporate. Many developers of free software are heartened and
|
|
||||||
encouraged by the resulting cooperation. However, in the case of
|
|
||||||
software used on network servers, this result may fail to come about.
|
|
||||||
The GNU General Public License permits making a modified version and
|
|
||||||
letting the public access it on a server without ever releasing its
|
|
||||||
source code to the public.
|
|
||||||
|
|
||||||
The GNU Affero General Public License is designed specifically to
|
|
||||||
ensure that, in such cases, the modified source code becomes available
|
|
||||||
to the community. It requires the operator of a network server to
|
|
||||||
provide the source code of the modified version running there to the
|
|
||||||
users of that server. Therefore, public use of a modified version, on
|
|
||||||
a publicly accessible server, gives the public access to the source
|
|
||||||
code of the modified version.
|
|
||||||
|
|
||||||
An older license, called the Affero General Public License and
|
|
||||||
published by Affero, was designed to accomplish similar goals. This is
|
|
||||||
a different license, not a version of the Affero GPL, but Affero has
|
|
||||||
released a new version of the Affero GPL which permits relicensing under
|
|
||||||
this license.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, if you modify the
|
|
||||||
Program, your modified version must prominently offer all users
|
|
||||||
interacting with it remotely through a computer network (if your version
|
|
||||||
supports such interaction) an opportunity to receive the Corresponding
|
|
||||||
Source of your version by providing access to the Corresponding Source
|
|
||||||
from a network server at no charge, through some standard or customary
|
|
||||||
means of facilitating copying of software. This Corresponding Source
|
|
||||||
shall include the Corresponding Source for any work covered by version 3
|
|
||||||
of the GNU General Public License that is incorporated pursuant to the
|
|
||||||
following paragraph.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the work with which it is combined will remain governed by version
|
|
||||||
3 of the GNU General Public License.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU Affero General Public License from time to time. Such new versions
|
|
||||||
will be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU Affero General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU Affero General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU Affero General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Affero General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Affero General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If your software can interact with users remotely through a computer
|
|
||||||
network, you should also make sure that it provides a way for users to
|
|
||||||
get its source. For example, if your program is a web application, its
|
|
||||||
interface could display a "Source" link that leads users to an archive
|
|
||||||
of the code. There are many ways you could offer source, and different
|
|
||||||
solutions will be better for different programs; see section 13 for the
|
|
||||||
specific requirements.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
|
||||||
<http://www.gnu.org/licenses/>.
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
||||||
MongoDB README
|
|
||||||
|
|
||||||
Welcome to MongoDB!
|
|
||||||
|
|
||||||
COMPONENTS
|
|
||||||
|
|
||||||
bin/mongod - The database process.
|
|
||||||
bin/mongos - Sharding controller.
|
|
||||||
bin/mongo - The database shell (uses interactive javascript).
|
|
||||||
|
|
||||||
UTILITIES
|
|
||||||
|
|
||||||
bin/mongodump - MongoDB dump tool - for backups, snapshots, etc..
|
|
||||||
bin/mongorestore - MongoDB restore a dump
|
|
||||||
bin/mongoexport - Export a single collection to test (JSON, CSV)
|
|
||||||
bin/mongoimport - Import from JSON or CSV
|
|
||||||
bin/mongofiles - Utility for putting and getting files from MongoDB GridFS
|
|
||||||
bin/mongostat - Show performance statistics
|
|
||||||
|
|
||||||
RUNNING
|
|
||||||
|
|
||||||
For command line options invoke:
|
|
||||||
|
|
||||||
$ ./mongod --help
|
|
||||||
|
|
||||||
To run a single server database:
|
|
||||||
|
|
||||||
$ mkdir /data/db
|
|
||||||
$ ./mongod
|
|
||||||
$
|
|
||||||
$ # The mongo javascript shell connects to localhost and test database by default:
|
|
||||||
$ ./mongo
|
|
||||||
> help
|
|
||||||
|
|
||||||
DRIVERS
|
|
||||||
|
|
||||||
Client drivers for most programming languages are available at mongodb.org. Use the
|
|
||||||
shell ("mongo") for administrative tasks.
|
|
||||||
|
|
||||||
DOCUMENTATION
|
|
||||||
|
|
||||||
http://www.mongodb.org/
|
|
||||||
|
|
||||||
MAIL LISTS AND IRC
|
|
||||||
|
|
||||||
http://dochub.mongodb.org/core/community
|
|
||||||
|
|
||||||
32 BIT BUILD NOTES
|
|
||||||
|
|
||||||
MongoDB uses memory mapped files. If built as a 32 bit executable, you will
|
|
||||||
not be able to work with large (multi-gigabyte) databases. However, 32 bit
|
|
||||||
builds work fine with small development databases.
|
|
||||||
|
|
@ -1,412 +0,0 @@
|
||||||
MongoDB uses third-party libraries or other resources that may
|
|
||||||
be distributed under licenses different than the MongoDB software.
|
|
||||||
|
|
||||||
In the event that we accidentally failed to list a required notice,
|
|
||||||
please bring it to our attention through any of the ways detailed here :
|
|
||||||
|
|
||||||
mongodb-dev@googlegroups.com
|
|
||||||
|
|
||||||
The attached notices are provided for information only.
|
|
||||||
|
|
||||||
|
|
||||||
1) License Notice for Boost
|
|
||||||
---------------------------
|
|
||||||
|
|
||||||
http://www.boost.org/LICENSE_1_0.txt
|
|
||||||
|
|
||||||
Boost Software License - Version 1.0 - August 17th, 2003
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person or organization
|
|
||||||
obtaining a copy of the software and accompanying documentation covered by
|
|
||||||
this license (the "Software") to use, reproduce, display, distribute,
|
|
||||||
execute, and transmit the Software, and to prepare derivative works of the
|
|
||||||
Software, and to permit third-parties to whom the Software is furnished to
|
|
||||||
do so, all subject to the following:
|
|
||||||
|
|
||||||
The copyright notices in the Software and this entire statement, including
|
|
||||||
the above license grant, this restriction and the following disclaimer,
|
|
||||||
must be included in all copies of the Software, in whole or in part, and
|
|
||||||
all derivative works of the Software, unless such copies or derivative
|
|
||||||
works are solely in the form of machine-executable object code generated by
|
|
||||||
a source language processor.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
|
||||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
|
||||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
|
||||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
||||||
DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
2) License Notice for V8
|
|
||||||
-------------------------
|
|
||||||
|
|
||||||
http://code.google.com/p/v8/source/browse/trunk/LICENSE
|
|
||||||
|
|
||||||
This license applies to all parts of V8 that are not externally
|
|
||||||
maintained libraries. The externally maintained libraries used by V8
|
|
||||||
are:
|
|
||||||
|
|
||||||
- Jscre, located under third_party/jscre. This code is copyrighted
|
|
||||||
by the University of Cambridge and Apple Inc. and released under a
|
|
||||||
2-clause BSD license.
|
|
||||||
|
|
||||||
- Dtoa, located under third_party/dtoa. This code is copyrighted by
|
|
||||||
David M. Gay and released under an MIT license.
|
|
||||||
|
|
||||||
- Strongtalk assembler, the basis of the files assembler-arm-inl.h,
|
|
||||||
assembler-arm.cc, assembler-arm.h, assembler-ia32-inl.h,
|
|
||||||
assembler-ia32.cc, assembler-ia32.h, assembler.cc and assembler.h.
|
|
||||||
This code is copyrighted by Sun Microsystems Inc. and released
|
|
||||||
under a 3-clause BSD license.
|
|
||||||
|
|
||||||
These libraries have their own licenses; we recommend you read them,
|
|
||||||
as their terms may differ from the terms below.
|
|
||||||
|
|
||||||
Copyright 2006-2008, Google Inc. All rights reserved.
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are
|
|
||||||
met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above
|
|
||||||
copyright notice, this list of conditions and the following
|
|
||||||
disclaimer in the documentation and/or other materials provided
|
|
||||||
with the distribution.
|
|
||||||
* Neither the name of Google Inc. nor the names of its
|
|
||||||
contributors may be used to endorse or promote products derived
|
|
||||||
from this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
3) License Notice for PCRE
|
|
||||||
--------------------------
|
|
||||||
|
|
||||||
http://www.pcre.org/licence.txt
|
|
||||||
|
|
||||||
PCRE LICENCE
|
|
||||||
------------
|
|
||||||
|
|
||||||
PCRE is a library of functions to support regular expressions whose syntax
|
|
||||||
and semantics are as close as possible to those of the Perl 5 language.
|
|
||||||
|
|
||||||
Release 7 of PCRE is distributed under the terms of the "BSD" licence, as
|
|
||||||
specified below. The documentation for PCRE, supplied in the "doc"
|
|
||||||
directory, is distributed under the same terms as the software itself.
|
|
||||||
|
|
||||||
The basic library functions are written in C and are freestanding. Also
|
|
||||||
included in the distribution is a set of C++ wrapper functions.
|
|
||||||
|
|
||||||
|
|
||||||
THE BASIC LIBRARY FUNCTIONS
|
|
||||||
---------------------------
|
|
||||||
|
|
||||||
Written by: Philip Hazel
|
|
||||||
Email local part: ph10
|
|
||||||
Email domain: cam.ac.uk
|
|
||||||
|
|
||||||
University of Cambridge Computing Service,
|
|
||||||
Cambridge, England.
|
|
||||||
|
|
||||||
Copyright (c) 1997-2008 University of Cambridge
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
|
|
||||||
THE C++ WRAPPER FUNCTIONS
|
|
||||||
-------------------------
|
|
||||||
|
|
||||||
Contributed by: Google Inc.
|
|
||||||
|
|
||||||
Copyright (c) 2007-2008, Google Inc.
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
|
|
||||||
THE "BSD" LICENCE
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice,
|
|
||||||
this list of conditions and the following disclaimer.
|
|
||||||
|
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer in the
|
|
||||||
documentation and/or other materials provided with the distribution.
|
|
||||||
|
|
||||||
* Neither the name of the University of Cambridge nor the name of Google
|
|
||||||
Inc. nor the names of their contributors may be used to endorse or
|
|
||||||
promote products derived from this software without specific prior
|
|
||||||
written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
||||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
||||||
POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
|
|
||||||
4) License notice for Aladdin MD5
|
|
||||||
---------------------------------
|
|
||||||
|
|
||||||
Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved.
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
|
|
||||||
L. Peter Deutsch
|
|
||||||
ghost@aladdin.com
|
|
||||||
|
|
||||||
5) License notice for Snappy - http://code.google.com/p/snappy/
|
|
||||||
---------------------------------
|
|
||||||
Copyright 2005 and onwards Google Inc.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are
|
|
||||||
met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above
|
|
||||||
copyright notice, this list of conditions and the following disclaimer
|
|
||||||
in the documentation and/or other materials provided with the
|
|
||||||
distribution.
|
|
||||||
* Neither the name of Google Inc. nor the names of its
|
|
||||||
contributors may be used to endorse or promote products derived from
|
|
||||||
this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
A light-weight compression algorithm. It is designed for speed of
|
|
||||||
compression and decompression, rather than for the utmost in space
|
|
||||||
savings.
|
|
||||||
|
|
||||||
For getting better compression ratios when you are compressing data
|
|
||||||
with long repeated sequences or compressing data that is similar to
|
|
||||||
other data, while still compressing fast, you might look at first
|
|
||||||
using BMDiff and then compressing the output of BMDiff with
|
|
||||||
Snappy.
|
|
||||||
|
|
||||||
6) License notice for Google Perftools (TCMalloc utility)
|
|
||||||
---------------------------------
|
|
||||||
New BSD License
|
|
||||||
|
|
||||||
Copyright (c) 1998-2006, Google Inc.
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or
|
|
||||||
without modification, are permitted provided that the following
|
|
||||||
conditions are met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above
|
|
||||||
copyright notice, this list of conditions and the following
|
|
||||||
disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above
|
|
||||||
copyright notice, this list of conditions and the following
|
|
||||||
disclaimer in the documentation and/or other materials provided
|
|
||||||
with the distribution.
|
|
||||||
* Neither the name of Google Inc. nor the names of its
|
|
||||||
contributors may be used to endorse or promote products
|
|
||||||
derived from this software without specific prior written
|
|
||||||
permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
|
|
||||||
6) License notice for SpiderMonkey 1.7
|
|
||||||
---------------------------------
|
|
||||||
For applicable files:
|
|
||||||
|
|
||||||
Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
||||||
|
|
||||||
The contents of this file are subject to the Mozilla Public License Version
|
|
||||||
1.1 (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.mozilla.org/MPL/
|
|
||||||
|
|
||||||
Software distributed under the License is distributed on an "AS IS" basis,
|
|
||||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
||||||
for the specific language governing rights and limitations under the
|
|
||||||
License.
|
|
||||||
|
|
||||||
The Original Code is Mozilla Communicator client code, released
|
|
||||||
March 31, 1998.
|
|
||||||
|
|
||||||
The Initial Developer of the Original Code is
|
|
||||||
Netscape Communications Corporation.
|
|
||||||
Portions created by the Initial Developer are Copyright (C) 1998
|
|
||||||
the Initial Developer. All Rights Reserved.
|
|
||||||
|
|
||||||
Contributor(s):
|
|
||||||
|
|
||||||
Alternatively, the contents of this file may be used under the terms of
|
|
||||||
either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
||||||
or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
||||||
in which case the provisions of the GPL or the LGPL are applicable instead
|
|
||||||
of those above. If you wish to allow use of your version of this file only
|
|
||||||
under the terms of either the GPL or the LGPL, and not to allow others to
|
|
||||||
use your version of this file under the terms of the MPL, indicate your
|
|
||||||
decision by deleting the provisions above and replace them with the notice
|
|
||||||
and other provisions required by the GPL or the LGPL. If you do not delete
|
|
||||||
the provisions above, a recipient may use your version of this file under
|
|
||||||
the terms of any one of the MPL, the GPL or the LGPL.
|
|
||||||
|
|
||||||
7) License notice for Linenoise
|
|
||||||
-------------------------------
|
|
||||||
|
|
||||||
Copyright (c) 2010, Salvatore Sanfilippo <antirez at gmail dot com>
|
|
||||||
Copyright (c) 2010, Pieter Noordhuis <pcnoordhuis at gmail dot com>
|
|
||||||
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice,
|
|
||||||
this list of conditions and the following disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer in the
|
|
||||||
documentation and/or other materials provided with the distribution.
|
|
||||||
* Neither the name of Redis nor the names of its contributors may be used
|
|
||||||
to endorse or promote products derived from this software without
|
|
||||||
specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
||||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
||||||
POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
8) License notice for S2 Geometry Library
|
|
||||||
-----------------------------------------
|
|
||||||
Copyright 2005 Google Inc. All Rights Reserved.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
9) License notice for MurmurHash
|
|
||||||
--------------------------------
|
|
||||||
|
|
||||||
Copyright (c) 2010-2012 Austin Appleby
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
||||||
10) License notice for Snowball
|
|
||||||
Copyright (c) 2001, Dr Martin Porter
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
THE "BSD" LICENCE
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice,
|
|
||||||
this list of conditions and the following disclaimer.
|
|
||||||
|
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer in the
|
|
||||||
documentation and/or other materials provided with the distribution.
|
|
||||||
|
|
||||||
* Neither the name of the University of Cambridge nor the name of Google
|
|
||||||
Inc. nor the names of their contributors may be used to endorse or
|
|
||||||
promote products derived from this software without specific prior
|
|
||||||
written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
||||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
||||||
POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End
|
|
||||||
|
|
@ -1,203 +0,0 @@
|
||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright [yyyy] [name of copyright owner]
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,93 +0,0 @@
|
||||||
# -*- mode: python -*-
|
|
||||||
|
|
||||||
# scons file for MongoDB c++ client library and examples
|
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
# options
|
|
||||||
AddOption("--extrapath",
|
|
||||||
dest="extrapath",
|
|
||||||
type="string",
|
|
||||||
nargs=1,
|
|
||||||
action="store",
|
|
||||||
help="comma separated list of add'l paths (--extrapath /opt/foo/,/foo) static linking")
|
|
||||||
|
|
||||||
AddOption("--prefix",
|
|
||||||
dest="prefix",
|
|
||||||
type="string",
|
|
||||||
nargs=1,
|
|
||||||
action="store",
|
|
||||||
default="/usr/local",
|
|
||||||
help="installation root")
|
|
||||||
|
|
||||||
|
|
||||||
env = Environment(BUILD_DIR='#build',
|
|
||||||
CLIENT_ARCHIVE='${CLIENT_DIST_BASENAME}${DIST_ARCHIVE_SUFFIX}',
|
|
||||||
CLIENT_DIST_BASENAME='mongo-cxx-driver',
|
|
||||||
CLIENT_LICENSE='#LICENSE.txt',
|
|
||||||
CLIENT_SCONSTRUCT='#SConstruct',
|
|
||||||
MSVS_ARCH=None,
|
|
||||||
PYTHON=sys.executable)
|
|
||||||
|
|
||||||
def addExtraLibs(s):
|
|
||||||
for x in s.split(","):
|
|
||||||
if os.path.exists(x):
|
|
||||||
env.Append(CPPPATH=[x + "/include", x],
|
|
||||||
LIBPATH=[x + "/lib", x + "/lib64"])
|
|
||||||
|
|
||||||
if GetOption( "extrapath" ) is not None:
|
|
||||||
addExtraLibs( GetOption( "extrapath" ) )
|
|
||||||
|
|
||||||
env.Prepend(CPPPATH=["$BUILD_DIR", "$BUILD_DIR/mongo"])
|
|
||||||
env.Append(CPPDEFINES=[ "_SCONS", "MONGO_EXPOSE_MACROS" ])
|
|
||||||
|
|
||||||
nix = False
|
|
||||||
linux = False
|
|
||||||
win = False
|
|
||||||
|
|
||||||
if "darwin" == sys.platform:
|
|
||||||
addExtraLibs( "/opt/local/" )
|
|
||||||
nix = True
|
|
||||||
elif sys.platform in ("linux2", "linux3"):
|
|
||||||
nix = True
|
|
||||||
linux = True
|
|
||||||
elif sys.platform == 'win32':
|
|
||||||
win = True
|
|
||||||
|
|
||||||
if win:
|
|
||||||
env['DIST_ARCHIVE_SUFFIX'] = '.zip'
|
|
||||||
env.Append(CCFLAGS=['/EHsc', '/O2'])
|
|
||||||
else:
|
|
||||||
env['DIST_ARCHIVE_SUFFIX'] = '.tgz'
|
|
||||||
|
|
||||||
if nix:
|
|
||||||
env.Append(CCFLAGS=["-O3", "-pthread"])
|
|
||||||
if linux:
|
|
||||||
env.Append(LINKFLAGS=["-Wl,--as-needed", "-Wl,-zdefs", "-pthread"])
|
|
||||||
|
|
||||||
boostLibs = ["thread", "filesystem", "system"]
|
|
||||||
conf = Configure(env)
|
|
||||||
for lib in boostLibs:
|
|
||||||
if not conf.CheckLib(["boost_%s-mt" % lib, "boost_%s" % lib],
|
|
||||||
language="C++"):
|
|
||||||
if not win:
|
|
||||||
Exit(1)
|
|
||||||
|
|
||||||
env['MONGO_BUILD_SASL_CLIENT'] = conf.CheckLibWithHeader(
|
|
||||||
"gsasl", "gsasl.h", "C", "gsasl_check_version(GSASL_VERSION);", autoadd=False)
|
|
||||||
|
|
||||||
conf.Finish()
|
|
||||||
|
|
||||||
clientEnv = env.Clone()
|
|
||||||
clientEnv['CPPDEFINES'].remove('MONGO_EXPOSE_MACROS')
|
|
||||||
|
|
||||||
Export("env clientEnv")
|
|
||||||
env.SConscript('src/SConscript.client', variant_dir='$BUILD_DIR', duplicate=False)
|
|
||||||
|
|
||||||
mongoclient = env.Alias('mongoclient', ['${LIBPREFIX}mongoclient${LIBSUFFIX}'])
|
|
||||||
env.Default(mongoclient)
|
|
||||||
|
|
||||||
|
|
||||||
# install
|
|
||||||
env.Alias("install", GetOption('prefix'))
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
# Building on Debian etch on Amazon EC2
|
|
||||||
|
|
||||||
ami-f2f6159b
|
|
||||||
|
|
||||||
apt-get update
|
|
||||||
apt-get install git-core "g++-4.1"
|
|
||||||
apt-get install python-setuptools libpcre3-dev
|
|
||||||
apt-get install libboost-filesystem-dev libboost-dev libboost-thread-dev libboost-program-options-dev libboost-date-time-dev
|
|
||||||
|
|
||||||
See: http://dochub.mongodb.org/core/buildingspidermonkey
|
|
||||||
|
|
||||||
ln -s /usr/bin/g++-4.1 /usr/bin/g++
|
|
||||||
ln -s /usr/bin/gcc-4.1 /usr/bin/gcc
|
|
||||||
|
|
||||||
easy_install scons
|
|
||||||
|
|
||||||
git clone git://github.com/mongodb/mongo.git
|
|
||||||
cd mongo
|
|
||||||
scons all
|
|
||||||
|
|
@ -1,92 +0,0 @@
|
||||||
|
|
||||||
Building MongoDB
|
|
||||||
================
|
|
||||||
|
|
||||||
SCONS
|
|
||||||
---------------
|
|
||||||
|
|
||||||
For detail information about building, please see [the manual](http://dochub.mongodb.org/core/building).
|
|
||||||
|
|
||||||
If you want to build everything (mongod, mongo, tools, etc):
|
|
||||||
|
|
||||||
$ scons all
|
|
||||||
|
|
||||||
If you only want to build the database:
|
|
||||||
|
|
||||||
$ scons
|
|
||||||
|
|
||||||
To install
|
|
||||||
|
|
||||||
$ scons --prefix=/opt/mongo install
|
|
||||||
|
|
||||||
Please note that prebuilt binaries are available on [mongodb.org](http://www.mongodb.org/downloads) and may be the easiest way to get started.
|
|
||||||
|
|
||||||
SCONS TARGETS
|
|
||||||
--------------
|
|
||||||
|
|
||||||
* mongod
|
|
||||||
* mongos
|
|
||||||
* mongo
|
|
||||||
* mongoclient
|
|
||||||
* all
|
|
||||||
|
|
||||||
COMPILER VERSIONS
|
|
||||||
--------------
|
|
||||||
|
|
||||||
Mongo has been tested with GCC 4.x and Visual Studio 2008 and 2010. Older versions
|
|
||||||
of GCC may not be happy.
|
|
||||||
|
|
||||||
WINDOWS
|
|
||||||
--------------
|
|
||||||
|
|
||||||
See http://dochub.mongodb.org/core/buildingforwindows
|
|
||||||
|
|
||||||
Build requirements:
|
|
||||||
* vc++ express or visual studio
|
|
||||||
* python 2.5 (for scons - 2.6 might be needed for some regression tests)
|
|
||||||
* scons
|
|
||||||
* boost 1.35 (or higher)
|
|
||||||
|
|
||||||
Or download a prebuilt binary for Windows at www.mongodb.org.
|
|
||||||
|
|
||||||
UBUNTU
|
|
||||||
--------------
|
|
||||||
|
|
||||||
To install dependencies on Ubuntu systems:
|
|
||||||
|
|
||||||
# aptitude install scons build-essential
|
|
||||||
# aptitude install libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-thread-dev
|
|
||||||
|
|
||||||
To run tests as well, you will need PyMongo:
|
|
||||||
|
|
||||||
# aptitude install python-pymongo
|
|
||||||
|
|
||||||
Then build as usual with `scons`:
|
|
||||||
|
|
||||||
$ scons all
|
|
||||||
|
|
||||||
|
|
||||||
OS X
|
|
||||||
--------------
|
|
||||||
|
|
||||||
Try [Homebrew](http://mxcl.github.com/homebrew/):
|
|
||||||
|
|
||||||
$ brew install mongodb
|
|
||||||
|
|
||||||
|
|
||||||
FREEBSD
|
|
||||||
--------------
|
|
||||||
|
|
||||||
Install the following ports:
|
|
||||||
|
|
||||||
* devel/boost
|
|
||||||
* devel/libexecinfo
|
|
||||||
* devel/pcre
|
|
||||||
* lang/spidermonkey
|
|
||||||
|
|
||||||
|
|
||||||
Special Build Notes
|
|
||||||
--------------
|
|
||||||
* [debian etch on ec2](building.debian.etch.ec2.html)
|
|
||||||
* [open solaris on ec2](building.opensolaris.ec2.html)
|
|
||||||
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
# Building on open solaris on ec2
|
|
||||||
|
|
||||||
This assumes you are using ami-4133d528 (which is 32bit).
|
|
||||||
|
|
||||||
|
|
||||||
pkg install SUNWgcc
|
|
||||||
pkg install SUNWgit
|
|
||||||
pkg install SUNWpython-setuptools
|
|
||||||
easy_install-2.4 scons
|
|
||||||
git clone git://github.com/mongodb/mongo.git
|
|
||||||
cd mongo
|
|
||||||
scons
|
|
||||||
1847
docs/errors.md
1847
docs/errors.md
File diff suppressed because it is too large
Load diff
|
|
@ -1,9 +0,0 @@
|
||||||
|
|
||||||
MongoDB Server Documentation
|
|
||||||
============
|
|
||||||
|
|
||||||
This is just some internal documentation.
|
|
||||||
|
|
||||||
For the full MongoDB docs, please see [mongodb.org](http://www.mongodb.org/)
|
|
||||||
|
|
||||||
* [building](building.html)
|
|
||||||
316
doxygenConfig
316
doxygenConfig
|
|
@ -1,316 +0,0 @@
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Project related configuration options
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
DOXYFILE_ENCODING = UTF-8
|
|
||||||
PROJECT_NAME = MongoDB
|
|
||||||
PROJECT_NUMBER = 2.4.1
|
|
||||||
OUTPUT_DIRECTORY = docs/doxygen
|
|
||||||
CREATE_SUBDIRS = NO
|
|
||||||
OUTPUT_LANGUAGE = English
|
|
||||||
BRIEF_MEMBER_DESC = YES
|
|
||||||
REPEAT_BRIEF = YES
|
|
||||||
ABBREVIATE_BRIEF = "The $name class" \
|
|
||||||
"The $name widget" \
|
|
||||||
"The $name file" \
|
|
||||||
is \
|
|
||||||
provides \
|
|
||||||
specifies \
|
|
||||||
contains \
|
|
||||||
represents \
|
|
||||||
a \
|
|
||||||
an \
|
|
||||||
the
|
|
||||||
ALWAYS_DETAILED_SEC = NO
|
|
||||||
INLINE_INHERITED_MEMB = NO
|
|
||||||
FULL_PATH_NAMES = NO
|
|
||||||
STRIP_FROM_PATH =
|
|
||||||
STRIP_FROM_INC_PATH =
|
|
||||||
SHORT_NAMES = NO
|
|
||||||
JAVADOC_AUTOBRIEF = YES
|
|
||||||
QT_AUTOBRIEF = NO
|
|
||||||
MULTILINE_CPP_IS_BRIEF = NO
|
|
||||||
INHERIT_DOCS = YES
|
|
||||||
SEPARATE_MEMBER_PAGES = NO
|
|
||||||
TAB_SIZE = 8
|
|
||||||
ALIASES =
|
|
||||||
OPTIMIZE_OUTPUT_FOR_C = NO
|
|
||||||
OPTIMIZE_OUTPUT_JAVA = NO
|
|
||||||
OPTIMIZE_FOR_FORTRAN = NO
|
|
||||||
OPTIMIZE_OUTPUT_VHDL = NO
|
|
||||||
EXTENSION_MAPPING =
|
|
||||||
BUILTIN_STL_SUPPORT = NO
|
|
||||||
CPP_CLI_SUPPORT = NO
|
|
||||||
SIP_SUPPORT = NO
|
|
||||||
IDL_PROPERTY_SUPPORT = YES
|
|
||||||
DISTRIBUTE_GROUP_DOC = NO
|
|
||||||
SUBGROUPING = YES
|
|
||||||
TYPEDEF_HIDES_STRUCT = NO
|
|
||||||
SYMBOL_CACHE_SIZE = 0
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Build related configuration options
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# ***
|
|
||||||
# ERH - this controls whether all classes in files are documented or just the ones with tags
|
|
||||||
# ***
|
|
||||||
EXTRACT_ALL = NO
|
|
||||||
|
|
||||||
EXTRACT_PRIVATE = NO
|
|
||||||
EXTRACT_STATIC = NO
|
|
||||||
EXTRACT_LOCAL_CLASSES = NO
|
|
||||||
EXTRACT_LOCAL_METHODS = NO
|
|
||||||
EXTRACT_ANON_NSPACES = NO
|
|
||||||
HIDE_UNDOC_MEMBERS = NO
|
|
||||||
HIDE_UNDOC_CLASSES = NO
|
|
||||||
HIDE_FRIEND_COMPOUNDS = NO
|
|
||||||
HIDE_IN_BODY_DOCS = NO
|
|
||||||
INTERNAL_DOCS = NO
|
|
||||||
CASE_SENSE_NAMES = NO
|
|
||||||
HIDE_SCOPE_NAMES = NO
|
|
||||||
SHOW_INCLUDE_FILES = YES
|
|
||||||
INLINE_INFO = YES
|
|
||||||
SORT_MEMBER_DOCS = YES
|
|
||||||
SORT_BRIEF_DOCS = NO
|
|
||||||
SORT_GROUP_NAMES = NO
|
|
||||||
SORT_BY_SCOPE_NAME = NO
|
|
||||||
GENERATE_TODOLIST = YES
|
|
||||||
GENERATE_TESTLIST = YES
|
|
||||||
GENERATE_BUGLIST = YES
|
|
||||||
GENERATE_DEPRECATEDLIST= YES
|
|
||||||
ENABLED_SECTIONS =
|
|
||||||
MAX_INITIALIZER_LINES = 30
|
|
||||||
SHOW_USED_FILES = YES
|
|
||||||
SHOW_DIRECTORIES = NO
|
|
||||||
SHOW_FILES = YES
|
|
||||||
SHOW_NAMESPACES = YES
|
|
||||||
FILE_VERSION_FILTER =
|
|
||||||
LAYOUT_FILE =
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to warning and progress messages
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
QUIET = NO
|
|
||||||
WARNINGS = YES
|
|
||||||
WARN_IF_UNDOCUMENTED = YES
|
|
||||||
WARN_IF_DOC_ERROR = YES
|
|
||||||
WARN_NO_PARAMDOC = NO
|
|
||||||
WARN_FORMAT = "$file:$line: $text"
|
|
||||||
WARN_LOGFILE =
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the input files
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
INPUT = src/mongo/client src/mongo/db/jsobj.h src/mongo/db/json.h src/mongo/bson src/mongo/util
|
|
||||||
INPUT_ENCODING = UTF-8
|
|
||||||
FILE_PATTERNS = *.c \
|
|
||||||
*.cc \
|
|
||||||
*.cxx \
|
|
||||||
*.cpp \
|
|
||||||
*.c++ \
|
|
||||||
*.d \
|
|
||||||
*.java \
|
|
||||||
*.ii \
|
|
||||||
*.ixx \
|
|
||||||
*.ipp \
|
|
||||||
*.i++ \
|
|
||||||
*.inl \
|
|
||||||
*.h \
|
|
||||||
*.hh \
|
|
||||||
*.hxx \
|
|
||||||
*.hpp \
|
|
||||||
*.h++ \
|
|
||||||
*.idl \
|
|
||||||
*.odl \
|
|
||||||
*.cs \
|
|
||||||
*.php \
|
|
||||||
*.php3 \
|
|
||||||
*.inc \
|
|
||||||
*.m \
|
|
||||||
*.mm \
|
|
||||||
*.dox \
|
|
||||||
*.py \
|
|
||||||
*.f90 \
|
|
||||||
*.f \
|
|
||||||
*.vhd \
|
|
||||||
*.vhdl
|
|
||||||
RECURSIVE = YES
|
|
||||||
EXCLUDE =
|
|
||||||
EXCLUDE_SYMLINKS = NO
|
|
||||||
EXCLUDE_PATTERNS =
|
|
||||||
EXCLUDE_SYMBOLS =
|
|
||||||
EXAMPLE_PATH =
|
|
||||||
EXAMPLE_PATTERNS = *
|
|
||||||
EXAMPLE_RECURSIVE = NO
|
|
||||||
IMAGE_PATH =
|
|
||||||
INPUT_FILTER =
|
|
||||||
FILTER_PATTERNS =
|
|
||||||
FILTER_SOURCE_FILES = NO
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to source browsing
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
SOURCE_BROWSER = NO
|
|
||||||
INLINE_SOURCES = NO
|
|
||||||
STRIP_CODE_COMMENTS = YES
|
|
||||||
REFERENCED_BY_RELATION = NO
|
|
||||||
REFERENCES_RELATION = NO
|
|
||||||
REFERENCES_LINK_SOURCE = YES
|
|
||||||
USE_HTAGS = NO
|
|
||||||
VERBATIM_HEADERS = YES
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the alphabetical class index
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
ALPHABETICAL_INDEX = NO
|
|
||||||
COLS_IN_ALPHA_INDEX = 5
|
|
||||||
IGNORE_PREFIX =
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the HTML output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_HTML = YES
|
|
||||||
HTML_OUTPUT = html
|
|
||||||
HTML_FILE_EXTENSION = .html
|
|
||||||
HTML_HEADER =
|
|
||||||
HTML_FOOTER =
|
|
||||||
HTML_STYLESHEET =
|
|
||||||
HTML_ALIGN_MEMBERS = YES
|
|
||||||
HTML_DYNAMIC_SECTIONS = NO
|
|
||||||
GENERATE_DOCSET = NO
|
|
||||||
DOCSET_FEEDNAME = "Doxygen generated docs"
|
|
||||||
DOCSET_BUNDLE_ID = org.doxygen.Project
|
|
||||||
GENERATE_HTMLHELP = NO
|
|
||||||
CHM_FILE =
|
|
||||||
HHC_LOCATION =
|
|
||||||
GENERATE_CHI = NO
|
|
||||||
CHM_INDEX_ENCODING =
|
|
||||||
BINARY_TOC = NO
|
|
||||||
TOC_EXPAND = NO
|
|
||||||
GENERATE_QHP = NO
|
|
||||||
QCH_FILE =
|
|
||||||
QHP_NAMESPACE =
|
|
||||||
QHP_VIRTUAL_FOLDER = doc
|
|
||||||
QHP_CUST_FILTER_NAME =
|
|
||||||
QHP_CUST_FILTER_ATTRS =
|
|
||||||
QHP_SECT_FILTER_ATTRS =
|
|
||||||
QHG_LOCATION =
|
|
||||||
DISABLE_INDEX = NO
|
|
||||||
ENUM_VALUES_PER_LINE = 4
|
|
||||||
GENERATE_TREEVIEW = NONE
|
|
||||||
TREEVIEW_WIDTH = 250
|
|
||||||
FORMULA_FONTSIZE = 10
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the LaTeX output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_LATEX = YES
|
|
||||||
LATEX_OUTPUT = latex
|
|
||||||
LATEX_CMD_NAME = latex
|
|
||||||
MAKEINDEX_CMD_NAME = makeindex
|
|
||||||
COMPACT_LATEX = NO
|
|
||||||
PAPER_TYPE = a4wide
|
|
||||||
EXTRA_PACKAGES =
|
|
||||||
LATEX_HEADER =
|
|
||||||
PDF_HYPERLINKS = YES
|
|
||||||
USE_PDFLATEX = YES
|
|
||||||
LATEX_BATCHMODE = NO
|
|
||||||
LATEX_HIDE_INDICES = NO
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the RTF output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_RTF = NO
|
|
||||||
RTF_OUTPUT = rtf
|
|
||||||
COMPACT_RTF = NO
|
|
||||||
RTF_HYPERLINKS = NO
|
|
||||||
RTF_STYLESHEET_FILE =
|
|
||||||
RTF_EXTENSIONS_FILE =
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the man page output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_MAN = NO
|
|
||||||
MAN_OUTPUT = man
|
|
||||||
MAN_EXTENSION = .3
|
|
||||||
MAN_LINKS = NO
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the XML output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_XML = NO
|
|
||||||
XML_OUTPUT = xml
|
|
||||||
XML_SCHEMA =
|
|
||||||
XML_DTD =
|
|
||||||
XML_PROGRAMLISTING = YES
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options for the AutoGen Definitions output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_AUTOGEN_DEF = NO
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# configuration options related to the Perl module output
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
GENERATE_PERLMOD = NO
|
|
||||||
PERLMOD_LATEX = NO
|
|
||||||
PERLMOD_PRETTY = YES
|
|
||||||
PERLMOD_MAKEVAR_PREFIX =
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Configuration options related to the preprocessor
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
ENABLE_PREPROCESSING = YES
|
|
||||||
MACRO_EXPANSION = NO
|
|
||||||
EXPAND_ONLY_PREDEF = NO
|
|
||||||
SEARCH_INCLUDES = YES
|
|
||||||
INCLUDE_PATH =
|
|
||||||
INCLUDE_FILE_PATTERNS =
|
|
||||||
PREDEFINED =
|
|
||||||
EXPAND_AS_DEFINED =
|
|
||||||
SKIP_FUNCTION_MACROS = YES
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Configuration::additions related to external references
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
TAGFILES =
|
|
||||||
GENERATE_TAGFILE =
|
|
||||||
ALLEXTERNALS = NO
|
|
||||||
EXTERNAL_GROUPS = YES
|
|
||||||
PERL_PATH = /usr/bin/perl
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Configuration options related to the dot tool
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
CLASS_DIAGRAMS = YES
|
|
||||||
MSCGEN_PATH =
|
|
||||||
HIDE_UNDOC_RELATIONS = YES
|
|
||||||
HAVE_DOT = NO
|
|
||||||
DOT_FONTNAME = FreeSans
|
|
||||||
DOT_FONTSIZE = 10
|
|
||||||
DOT_FONTPATH =
|
|
||||||
CLASS_GRAPH = YES
|
|
||||||
COLLABORATION_GRAPH = YES
|
|
||||||
GROUP_GRAPHS = YES
|
|
||||||
UML_LOOK = NO
|
|
||||||
TEMPLATE_RELATIONS = NO
|
|
||||||
INCLUDE_GRAPH = YES
|
|
||||||
INCLUDED_BY_GRAPH = YES
|
|
||||||
CALL_GRAPH = NO
|
|
||||||
CALLER_GRAPH = NO
|
|
||||||
GRAPHICAL_HIERARCHY = YES
|
|
||||||
DIRECTORY_GRAPH = YES
|
|
||||||
DOT_IMAGE_FORMAT = png
|
|
||||||
DOT_PATH =
|
|
||||||
DOTFILE_DIRS =
|
|
||||||
DOT_GRAPH_MAX_NODES = 50
|
|
||||||
MAX_DOT_GRAPH_DEPTH = 0
|
|
||||||
DOT_TRANSPARENT = NO
|
|
||||||
DOT_MULTI_TARGETS = NO
|
|
||||||
GENERATE_LEGEND = YES
|
|
||||||
DOT_CLEANUP = YES
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# Options related to the search engine
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
SEARCHENGINE = NO
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
// For testing the test runner.
|
|
||||||
assert.eq(1, 2, "fail1")
|
|
||||||
|
|
||||||
print("you should not see this")
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
// Start mongod and run jstests/_runner.js
|
|
||||||
|
|
||||||
db = startMongod( "--port", "27018", "--dbpath", "/data/db/jstests" ).getDB( "test" );
|
|
||||||
load( "jstests/_runner.js" );
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
//
|
|
||||||
// simple runner to run toplevel tests in jstests
|
|
||||||
//
|
|
||||||
var files = listFiles("jstests");
|
|
||||||
|
|
||||||
var runnerStart = new Date()
|
|
||||||
|
|
||||||
files.forEach(
|
|
||||||
function(x) {
|
|
||||||
|
|
||||||
if ( /[\/\\]_/.test(x.name) ||
|
|
||||||
! /\.js$/.test(x.name ) ){
|
|
||||||
print(" >>>>>>>>>>>>>>> skipping " + x.name);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
print(" *******************************************");
|
|
||||||
print(" Test : " + x.name + " ...");
|
|
||||||
print(" " + Date.timeFunc( function() { load(x.name); }, 1) + "ms");
|
|
||||||
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
var runnerEnd = new Date()
|
|
||||||
|
|
||||||
print( "total runner time: " + ( ( runnerEnd.getTime() - runnerStart.getTime() ) / 1000 ) + "secs" )
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
//
|
|
||||||
// simple runner to run toplevel tests in jstests
|
|
||||||
//
|
|
||||||
var files = listFiles("jstests");
|
|
||||||
|
|
||||||
var dummyDb = db.getSisterDB( "dummyDBdummydummy" );
|
|
||||||
|
|
||||||
dummyDb.getSisterDB( "admin" ).runCommand( "closeAllDatabases" );
|
|
||||||
prev = dummyDb.serverStatus();
|
|
||||||
|
|
||||||
print( "START : " + tojson( prev ) );
|
|
||||||
|
|
||||||
files.forEach(
|
|
||||||
function(x) {
|
|
||||||
|
|
||||||
if ( /_runner/.test(x.name) ||
|
|
||||||
/_lodeRunner/.test(x.name) ||
|
|
||||||
! /\.js$/.test(x.name ) ){
|
|
||||||
print(" >>>>>>>>>>>>>>> skipping " + x.name);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
print(" *******************************************");
|
|
||||||
print(" Test : " + x.name + " ...");
|
|
||||||
print(" " + Date.timeFunc( function() { load(x.name); }, 1) + "ms");
|
|
||||||
|
|
||||||
assert( dummyDb.getSisterDB( "admin" ).runCommand( "closeAllDatabases" ).ok == 1 , "closeAllDatabases failed" );
|
|
||||||
var now = dummyDb.serverStatus();
|
|
||||||
var leaked = now.mem.virtual - prev.mem.virtual;
|
|
||||||
if ( leaked > 0 ){
|
|
||||||
print( " LEAK : " + prev.mem.virtual + " -->> " + now.mem.virtual );
|
|
||||||
printjson( now );
|
|
||||||
if ( leaked > 20 )
|
|
||||||
throw -1;
|
|
||||||
}
|
|
||||||
prev = now;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dummyDb.getSisterDB( "admin" ).runCommand( "closeAllDatabases" );
|
|
||||||
print( "END : " + tojson( dummyDb.serverStatus() ) );
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
||||||
//
|
|
||||||
// simple runner to run toplevel tests in jstests
|
|
||||||
//
|
|
||||||
var files = listFiles("jstests");
|
|
||||||
|
|
||||||
var dummyDb = db.getSisterDB( "dummyDBdummydummy" );
|
|
||||||
|
|
||||||
dummyDb.getSisterDB( "admin" ).runCommand( "closeAllDatabases" );
|
|
||||||
prev = dummyDb.runCommand( "meminfo" );
|
|
||||||
|
|
||||||
print( "START : " + tojson( prev ) );
|
|
||||||
|
|
||||||
files.forEach(
|
|
||||||
function(x) {
|
|
||||||
|
|
||||||
if ( /_runner/.test(x.name) ||
|
|
||||||
/_lodeRunner/.test(x.name) ||
|
|
||||||
/jni/.test(x.name) ||
|
|
||||||
/eval/.test(x.name) ||
|
|
||||||
/where/.test(x.name) ||
|
|
||||||
! /\.js$/.test(x.name ) ){
|
|
||||||
print(" >>>>>>>>>>>>>>> skipping " + x.name);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
print(" *******************************************");
|
|
||||||
print(" Test : " + x.name + " ...");
|
|
||||||
print(" " + Date.timeFunc( function() { load(x.name); }, 1) + "ms");
|
|
||||||
|
|
||||||
assert( dummyDb.getSisterDB( "admin" ).runCommand( "closeAllDatabases" ).ok == 1 , "closeAllDatabases failed" );
|
|
||||||
var now = dummyDb.runCommand( "meminfo" );
|
|
||||||
if ( now.virtual > prev.virtual )
|
|
||||||
print( " LEAK : " + prev.virtual + " -->> " + now.virtual );
|
|
||||||
prev = now;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dummyDb.getSisterDB( "admin" ).runCommand( "closeAllDatabases" );
|
|
||||||
print( "END : " + tojson( dummyDb.runCommand( "meminfo" ) ) );
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
//
|
|
||||||
// simple runner to run toplevel tests in jstests
|
|
||||||
//
|
|
||||||
var files = listFiles("jstests/sharding");
|
|
||||||
|
|
||||||
var num = 0;
|
|
||||||
|
|
||||||
files.forEach(
|
|
||||||
function(x) {
|
|
||||||
|
|
||||||
if ( /_runner/.test(x.name) ||
|
|
||||||
/_lodeRunner/.test(x.name) ||
|
|
||||||
! /\.js$/.test(x.name ) ){
|
|
||||||
print(" >>>>>>>>>>>>>>> skipping " + x.name);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( num++ > 0 ){
|
|
||||||
sleep( 1000 ); // let things fully come down
|
|
||||||
}
|
|
||||||
|
|
||||||
print(" *******************************************");
|
|
||||||
print(" Test : " + x.name + " ...");
|
|
||||||
try {
|
|
||||||
print(" " + Date.timeFunc( function() { load(x.name); }, 1) + "ms");
|
|
||||||
}
|
|
||||||
catch ( e ){
|
|
||||||
print( " ERROR on " + x.name + "!! " + e );
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
/* a general testing framework (helpers) for us in the jstests/
|
|
||||||
|
|
||||||
to use, from your test file:
|
|
||||||
testname="mytestname";
|
|
||||||
load("jstests/_tst.js");
|
|
||||||
*/
|
|
||||||
|
|
||||||
if( typeof tst == "undefined" ) {
|
|
||||||
tst = {}
|
|
||||||
|
|
||||||
tst.log = function (optional_msg) {
|
|
||||||
print("\n\nstep " + ++this._step + " " + (optional_msg || ""));
|
|
||||||
}
|
|
||||||
|
|
||||||
tst.success = function () {
|
|
||||||
print(testname + " SUCCESS");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* diff files a and b, returning the difference (empty str if no difference) */
|
|
||||||
tst.diff = function(a, b) {
|
|
||||||
function reSlash(s) {
|
|
||||||
var x = s;
|
|
||||||
if (_isWindows()) {
|
|
||||||
while (1) {
|
|
||||||
var y = x.replace('/', '\\');
|
|
||||||
if (y == x)
|
|
||||||
break;
|
|
||||||
x = y;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
a = reSlash(a);
|
|
||||||
b = reSlash(b);
|
|
||||||
print("diff " + a + " " + b);
|
|
||||||
return run("diff", a, b);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
print(testname + " BEGIN");
|
|
||||||
tst._step = 0;
|
|
||||||
|
|
@ -1,62 +0,0 @@
|
||||||
// $cond returns the evaluated second argument if the first evaluates to true but the evaluated
|
|
||||||
// third argument if the first evaluates to false.
|
|
||||||
load('jstests/aggregation/extras/utils.js');
|
|
||||||
|
|
||||||
t = db.jstests_aggregation_cond;
|
|
||||||
t.drop();
|
|
||||||
|
|
||||||
t.save( {} );
|
|
||||||
|
|
||||||
function assertError( expectedErrorCode, condSpec ) {
|
|
||||||
assertErrorCode(t, {$project: {a: {$cond: condSpec}}}, expectedErrorCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
function assertResult( expectedResult, arg0, arg1, arg2 ) {
|
|
||||||
assert.eq( expectedResult,
|
|
||||||
t.aggregate( { $project:{ a:{ $cond:[ arg0, arg1, arg2 ] } } } ).result[ 0 ].a );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Wrong number of args.
|
|
||||||
assertError( 16020, [] );
|
|
||||||
assertError( 16020, [1] );
|
|
||||||
assertError( 16020, [false] );
|
|
||||||
assertError( 16020, [1,1] );
|
|
||||||
assertError( 16020, [1,1,null,1] );
|
|
||||||
assertError( 16020, [1,1,1,undefined] );
|
|
||||||
|
|
||||||
// Literal expressions.
|
|
||||||
assertResult( 1, true, 1, 2 );
|
|
||||||
assertResult( 2, false, 1, 2 );
|
|
||||||
|
|
||||||
// Computed expressions.
|
|
||||||
assertResult( 1, { $and:[] }, { $add:[ 1 ] }, { $add:[ 1, 1 ] } );
|
|
||||||
assertResult( 2, { $or:[] }, { $add:[ 1 ] }, { $add:[ 1, 1 ] } );
|
|
||||||
|
|
||||||
t.drop();
|
|
||||||
t.save( { t:true, f:false, x:'foo', y:'bar' } );
|
|
||||||
|
|
||||||
// Field path expressions.
|
|
||||||
assertResult( 'foo', '$t', '$x', '$y' );
|
|
||||||
assertResult( 'bar', '$f', '$x', '$y' );
|
|
||||||
|
|
||||||
t.drop();
|
|
||||||
t.save( {} );
|
|
||||||
|
|
||||||
// Coerce to bool.
|
|
||||||
assertResult( 'a', 1, 'a', 'b' );
|
|
||||||
assertResult( 'a', '', 'a', 'b' );
|
|
||||||
assertResult( 'b', 0, 'a', 'b' );
|
|
||||||
|
|
||||||
// Nested.
|
|
||||||
t.drop();
|
|
||||||
t.save( { noonSense:'am', mealCombined:'no' } );
|
|
||||||
t.save( { noonSense:'am', mealCombined:'yes' } );
|
|
||||||
t.save( { noonSense:'pm', mealCombined:'yes' } );
|
|
||||||
t.save( { noonSense:'pm', mealCombined:'no' } );
|
|
||||||
assert.eq( [ 'breakfast', 'brunch', 'linner', 'dinner' ],
|
|
||||||
t.aggregate( { $project:{ a:{ $cond:[ { $eq:[ '$noonSense', 'am' ] },
|
|
||||||
{ $cond:[ { $eq:[ '$mealCombined', 'yes' ] },
|
|
||||||
'brunch', 'breakfast' ] },
|
|
||||||
{ $cond:[ { $eq:[ '$mealCombined', 'yes' ] },
|
|
||||||
'linner', 'dinner' ] } ] } } } ).result
|
|
||||||
.map( function( x ) { return x.a; } ) );
|
|
||||||
|
|
@ -1,110 +0,0 @@
|
||||||
// Check $first/$last group accumulators. SERVER-3862
|
|
||||||
// $first/$last select first/last value for a group key from the previous pipeline.
|
|
||||||
|
|
||||||
t = db.jstests_aggregation_firstlast;
|
|
||||||
t.drop();
|
|
||||||
|
|
||||||
/** Check expected $first and $last result values. */
|
|
||||||
function assertFirstLast( expectedFirst, expectedLast, pipeline, expression ) {
|
|
||||||
pipeline = pipeline || [];
|
|
||||||
expression = expression || '$b'
|
|
||||||
pipeline.push( { $group:{ _id:'$a',
|
|
||||||
first:{ $first:expression },
|
|
||||||
last:{ $last:expression } } } );
|
|
||||||
result = t.aggregate( pipeline ).result;
|
|
||||||
for( var i = 0; i < result.length; ++i ) {
|
|
||||||
if ( result[ i ]._id == 1 ) {
|
|
||||||
// Check results for group _id 1.
|
|
||||||
assert.eq( expectedFirst, result[ i ].first );
|
|
||||||
assert.eq( expectedLast, result[ i ].last );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
assert( false, "Expected group _id '1' missing." );
|
|
||||||
}
|
|
||||||
|
|
||||||
// One document.
|
|
||||||
t.save( { a:1, b:1 } );
|
|
||||||
assertFirstLast( 1, 1 );
|
|
||||||
|
|
||||||
// Two documents.
|
|
||||||
t.save( { a:1, b:2 } );
|
|
||||||
assertFirstLast( 1, 2 );
|
|
||||||
|
|
||||||
// Three documents.
|
|
||||||
t.save( { a:1, b:3 } );
|
|
||||||
assertFirstLast( 1, 3 );
|
|
||||||
|
|
||||||
// Another 'a' key value does not affect outcome.
|
|
||||||
t.drop();
|
|
||||||
t.save( { a:3, b:0 } );
|
|
||||||
t.save( { a:1, b:1 } );
|
|
||||||
t.save( { a:1, b:2 } );
|
|
||||||
t.save( { a:1, b:3 } );
|
|
||||||
t.save( { a:2, b:0 } );
|
|
||||||
assertFirstLast( 1, 3 );
|
|
||||||
|
|
||||||
// Additional pipeline stages do not affect outcome if order is maintained.
|
|
||||||
assertFirstLast( 1, 3, [ { $project:{ x:'$a', y:'$b' } }, { $project:{ a:'$x', b:'$y' } } ] );
|
|
||||||
|
|
||||||
// Additional pipeline stages affect outcome if order is modified.
|
|
||||||
assertFirstLast( 3, 1, [ { $sort:{ b:-1 } } ] );
|
|
||||||
|
|
||||||
// Skip and limit affect the results seen.
|
|
||||||
t.drop();
|
|
||||||
t.save( { a:1, b:1 } );
|
|
||||||
t.save( { a:1, b:2 } );
|
|
||||||
t.save( { a:1, b:3 } );
|
|
||||||
assertFirstLast( 1, 2, [ { $limit:2 } ] );
|
|
||||||
assertFirstLast( 2, 3, [ { $skip:1 }, { $limit:2 } ] );
|
|
||||||
assertFirstLast( 2, 2, [ { $skip:1 }, { $limit:1 } ] );
|
|
||||||
|
|
||||||
// Mixed type values.
|
|
||||||
t.save( { a:1, b:'foo' } );
|
|
||||||
assertFirstLast( 1, 'foo' );
|
|
||||||
|
|
||||||
t.drop();
|
|
||||||
t.save( { a:1, b:'bar' } );
|
|
||||||
t.save( { a:1, b:true } );
|
|
||||||
assertFirstLast( 'bar', true );
|
|
||||||
|
|
||||||
// Value null.
|
|
||||||
t.drop();
|
|
||||||
t.save( { a:1, b:null } );
|
|
||||||
t.save( { a:1, b:2 } );
|
|
||||||
assertFirstLast( null, 2 );
|
|
||||||
t.drop();
|
|
||||||
t.save( { a:1, b:2 } );
|
|
||||||
t.save( { a:1, b:null } );
|
|
||||||
assertFirstLast( 2, null );
|
|
||||||
t.drop();
|
|
||||||
t.save( { a:1, b:null } );
|
|
||||||
t.save( { a:1, b:null } );
|
|
||||||
assertFirstLast( null, null );
|
|
||||||
|
|
||||||
// Value missing.
|
|
||||||
t.drop();
|
|
||||||
t.save( { a:1 } );
|
|
||||||
t.save( { a:1, b:2 } );
|
|
||||||
assertFirstLast( undefined, 2 );
|
|
||||||
t.drop();
|
|
||||||
t.save( { a:1, b:2 } );
|
|
||||||
t.save( { a:1 } );
|
|
||||||
assertFirstLast( 2, undefined );
|
|
||||||
t.drop();
|
|
||||||
t.save( { a:1 } );
|
|
||||||
t.save( { a:1 } );
|
|
||||||
assertFirstLast( undefined, undefined );
|
|
||||||
|
|
||||||
// Dotted field.
|
|
||||||
t.drop();
|
|
||||||
t.save( { a:1, b:[ { c:1 }, { c:2 } ] } );
|
|
||||||
t.save( { a:1, b:[ { c:6 }, {} ] } );
|
|
||||||
assertFirstLast( [ 1, 2 ], [ 6 ], [], '$b.c' );
|
|
||||||
|
|
||||||
// Computed expressions.
|
|
||||||
t.drop();
|
|
||||||
t.save( { a:1, b:1 } );
|
|
||||||
t.save( { a:1, b:2 } );
|
|
||||||
assertFirstLast( 1, 0, [], { $mod:[ '$b', 2 ] } );
|
|
||||||
assertFirstLast( 0, 1, [], { $mod:[ { $add:[ '$b', 1 ] }, 2 ] } );
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
||||||
// $ifNull returns the result of the first expression if not null or undefined, otherwise of the
|
|
||||||
// second expression.
|
|
||||||
load('jstests/aggregation/extras/utils.js');
|
|
||||||
|
|
||||||
t = db.jstests_aggregation_ifnull;
|
|
||||||
t.drop();
|
|
||||||
|
|
||||||
t.save( {} );
|
|
||||||
|
|
||||||
function assertError( expectedErrorCode, ifNullSpec ) {
|
|
||||||
assertErrorCode(t, {$project: {a: {$ifNull: ifNullSpec}}}, expectedErrorCode)
|
|
||||||
}
|
|
||||||
|
|
||||||
function assertResult( expectedResult, arg0, arg1 ) {
|
|
||||||
var res = t.aggregate( { $project:{ a:{ $ifNull:[ arg0, arg1 ] } } } );
|
|
||||||
assert.commandWorked(res);
|
|
||||||
assert.eq( expectedResult, res.result[ 0 ].a );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Wrong number of args.
|
|
||||||
assertError( 16020, [] );
|
|
||||||
assertError( 16020, [1] );
|
|
||||||
assertError( 16020, [null] );
|
|
||||||
assertError( 16020, [1,1,1] );
|
|
||||||
assertError( 16020, [1,1,null] );
|
|
||||||
assertError( 16020, [1,1,undefined] );
|
|
||||||
|
|
||||||
// First arg non null.
|
|
||||||
assertResult( 1, 1, 2 );
|
|
||||||
assertResult( 2, 2, 1 );
|
|
||||||
assertResult( false, false, 1 );
|
|
||||||
assertResult( '', '', 1 );
|
|
||||||
assertResult( [], [], 1 );
|
|
||||||
assertResult( {}, {}, 1 );
|
|
||||||
assertResult( 1, 1, null );
|
|
||||||
assertResult( 2, 2, undefined );
|
|
||||||
|
|
||||||
// First arg null.
|
|
||||||
assertResult( 2, null, 2 );
|
|
||||||
assertResult( 1, null, 1 );
|
|
||||||
assertResult( null, null, null );
|
|
||||||
assertResult( undefined, null, undefined );
|
|
||||||
|
|
||||||
// First arg undefined.
|
|
||||||
assertResult( 2, undefined, 2 );
|
|
||||||
assertResult( 1, undefined, 1 );
|
|
||||||
assertResult( null, undefined, null );
|
|
||||||
assertResult( undefined, undefined, undefined );
|
|
||||||
|
|
||||||
// Computed expression.
|
|
||||||
assertResult( 3, { $add:[ 1, 2 ] }, 5 );
|
|
||||||
assertResult( 20, '$missingField', { $multiply:[ 4, 5 ] } );
|
|
||||||
|
|
||||||
// Divide/mod by 0.
|
|
||||||
assertError(16608 , [{$divide: [1, 0]}, 0]);
|
|
||||||
assertError(16610 , [{$mod: [1, 0]}, 0]);
|
|
||||||
|
|
||||||
// Nested.
|
|
||||||
t.drop();
|
|
||||||
t.save( { d:'foo' } );
|
|
||||||
assertResult( 'foo', '$a', { $ifNull:[ '$b', { $ifNull:[ '$c', '$d' ] } ] } );
|
|
||||||
t.update( {}, { $set:{ b:'bar' } } );
|
|
||||||
assertResult( 'bar', '$a', { $ifNull:[ '$b', { $ifNull:[ '$c', '$d' ] } ] } );
|
|
||||||
|
|
@ -1,190 +0,0 @@
|
||||||
// Check $match pipeline stage.
|
|
||||||
// - Filtering behavior equivalent to a mongo query.
|
|
||||||
// - $where and geo operators are not allowed
|
|
||||||
load('jstests/aggregation/extras/utils.js');
|
|
||||||
|
|
||||||
t = db.jstests_aggregation_match;
|
|
||||||
t.drop();
|
|
||||||
|
|
||||||
identityProjection = { _id:'$_id', a:'$a' };
|
|
||||||
|
|
||||||
/** Assert that an aggregation generated the expected error. */
|
|
||||||
function assertError( expectedCode, matchSpec ) {
|
|
||||||
matchStage = { $match:matchSpec };
|
|
||||||
// Check where matching is folded in to DocumentSourceCursor.
|
|
||||||
assertErrorCode(t, [matchStage], expectedCode)
|
|
||||||
// Check where matching is not folded in to DocumentSourceCursor.
|
|
||||||
assertErrorCode(t, [{$project: identityProjection}, matchStage], expectedCode)
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Assert that the contents of two arrays are equal, ignoring element ordering. */
|
|
||||||
function assertEqualResultsUnordered( one, two ) {
|
|
||||||
oneStr = one.map( function( x ) { return tojson( x ); } );
|
|
||||||
twoStr = two.map( function( x ) { return tojson( x ); } );
|
|
||||||
oneStr.sort();
|
|
||||||
twoStr.sort();
|
|
||||||
assert.eq( oneStr, twoStr );
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Assert that an aggregation result is as expected. */
|
|
||||||
function assertResults( expectedResults, matchSpec ) {
|
|
||||||
findResults = t.find( matchSpec ).toArray();
|
|
||||||
if ( expectedResults ) {
|
|
||||||
assertEqualResultsUnordered( expectedResults, findResults );
|
|
||||||
}
|
|
||||||
matchStage = { $match:matchSpec };
|
|
||||||
// Check where matching is folded in to DocumentSourceCursor.
|
|
||||||
assertEqualResultsUnordered( findResults, t.aggregate( matchStage ).result );
|
|
||||||
// Check where matching is not folded in to DocumentSourceCursor.
|
|
||||||
assertEqualResultsUnordered( findResults,
|
|
||||||
t.aggregate( { $project:identityProjection },
|
|
||||||
matchStage ).result );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Invalid matcher syntax.
|
|
||||||
assertError( 10073, { a:{ $mod:[ 0 /* invalid */, 0 ] } } );
|
|
||||||
|
|
||||||
// $where not allowed.
|
|
||||||
assertError( 16395, { $where:'true' } );
|
|
||||||
|
|
||||||
// Geo not allowed.
|
|
||||||
assertError( 16424, { $match:{ a:{ $near:[ 0, 0 ] } } } );
|
|
||||||
|
|
||||||
// Update modifier not allowed.
|
|
||||||
if ( 0 ) { // SERVER-6650
|
|
||||||
assertError( 0, { a:1, $inc:{ b:1 } } );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Aggregation expression not allowed.
|
|
||||||
if ( 0 ) { // SERVER-6650
|
|
||||||
assertError( 0, { a:1, b:{ $gt:{ $add:[ 1, 1 ] } } } );
|
|
||||||
}
|
|
||||||
|
|
||||||
function checkMatchResults( indexed ) {
|
|
||||||
|
|
||||||
// No results.
|
|
||||||
t.remove();
|
|
||||||
assertResults( [], {} );
|
|
||||||
|
|
||||||
t.save( { _id:0, a:1 } );
|
|
||||||
t.save( { _id:1, a:2 } );
|
|
||||||
t.save( { _id:2, a:3 } );
|
|
||||||
|
|
||||||
// Empty query.
|
|
||||||
assertResults( [ { _id:0, a:1 }, { _id:1, a:2 }, { _id:2, a:3 } ], {} );
|
|
||||||
|
|
||||||
// Simple queries.
|
|
||||||
assertResults( [ { _id:0, a:1 } ], { a:1 } );
|
|
||||||
assertResults( [ { _id:1, a:2 } ], { a:2 } );
|
|
||||||
assertResults( [ { _id:1, a:2 }, { _id:2, a:3 } ], { a:{ $gt:1 } } );
|
|
||||||
assertResults( [ { _id:0, a:1 }, { _id:1, a:2 } ], { a:{ $lte:2 } } );
|
|
||||||
assertResults( [ { _id:0, a:1 }, { _id:2, a:3 } ], { a:{ $in:[ 1, 3 ] } } );
|
|
||||||
|
|
||||||
// Regular expression.
|
|
||||||
t.remove();
|
|
||||||
t.save( { _id:0, a:'x' } );
|
|
||||||
t.save( { _id:1, a:'yx' } );
|
|
||||||
assertResults( [ { _id:0, a:'x' } ], { a:/^x/ } );
|
|
||||||
assertResults( [ { _id:0, a:'x' }, { _id:1, a:'yx' } ], { a:/x/ } );
|
|
||||||
|
|
||||||
// Dotted field.
|
|
||||||
t.remove();
|
|
||||||
t.save( { _id:0, a:{ b:4 } } );
|
|
||||||
t.save( { _id:1, a:2 } );
|
|
||||||
assertResults( [ { _id:0, a:{ b:4 } } ], { 'a.b':4 } );
|
|
||||||
|
|
||||||
// Value within an array.
|
|
||||||
t.remove();
|
|
||||||
t.save( { _id:0, a:[ 1, 2, 3 ] } );
|
|
||||||
t.save( { _id:1, a:[ 2, 2, 3 ] } );
|
|
||||||
t.save( { _id:2, a:[ 2, 2, 2 ] } );
|
|
||||||
assertResults( [ { _id:0, a:[ 1, 2, 3 ] }, { _id:1, a:[ 2, 2, 3 ] } ], { a:3 } );
|
|
||||||
|
|
||||||
// Missing, null, $exists matching.
|
|
||||||
t.remove();
|
|
||||||
t.save( { _id:0 } );
|
|
||||||
t.save( { _id:1, a:null } );
|
|
||||||
if ( 0 ) { // SERVER-6571
|
|
||||||
t.save( { _id:2, a:undefined } );
|
|
||||||
}
|
|
||||||
t.save( { _id:3, a:0 } );
|
|
||||||
assertResults( [ { _id:0 }, { _id:1, a:null } ], { a:null } );
|
|
||||||
if ( !indexed ) { // SERVER-1160
|
|
||||||
assertResults( null, { a:{ $in:[ undefined ] } } );
|
|
||||||
}
|
|
||||||
assertResults( null, { a:{ $exists:true } } );
|
|
||||||
assertResults( null, { a:{ $exists:false } } );
|
|
||||||
|
|
||||||
// $elemMatch
|
|
||||||
t.remove();
|
|
||||||
t.save( { _id:0, a:[ 1, 2 ] } );
|
|
||||||
t.save( { _id:1, a:[ 1, 2, 3 ] } );
|
|
||||||
assertResults( [ { _id:1, a:[ 1, 2, 3 ] } ], { a:{ $elemMatch:{ $gt:1, $mod:[ 2, 1 ] } } } );
|
|
||||||
|
|
||||||
t.remove();
|
|
||||||
t.save( { _id:0, a:[ { b:1 }, { c:2 } ] } );
|
|
||||||
t.save( { _id:1, a:[ { b:1, c:2 } ] } );
|
|
||||||
assertResults( [ { _id:1, a:[ { b:1, c:2 } ] } ], { a:{ $elemMatch:{ b:1, c:2 } } } );
|
|
||||||
|
|
||||||
// $size
|
|
||||||
t.remove();
|
|
||||||
t.save( {} );
|
|
||||||
t.save( { a:null } );
|
|
||||||
t.save( { a:[] } );
|
|
||||||
t.save( { a:[ 1 ] } );
|
|
||||||
t.save( { a:[ 1, 2 ] } );
|
|
||||||
assertResults( null, { a:{ $size:0 } } );
|
|
||||||
assertResults( null, { a:{ $size:1 } } );
|
|
||||||
assertResults( null, { a:{ $size:2 } } );
|
|
||||||
|
|
||||||
// $type
|
|
||||||
t.remove();
|
|
||||||
t.save( {} );
|
|
||||||
t.save( { a:null } );
|
|
||||||
if ( 0 ) { // SERVER-6571
|
|
||||||
t.save( { a:undefined } );
|
|
||||||
}
|
|
||||||
t.save( { a:NumberInt( 1 ) } );
|
|
||||||
t.save( { a:NumberLong( 2 ) } );
|
|
||||||
t.save( { a:66.6 } );
|
|
||||||
t.save( { a:'abc' } );
|
|
||||||
t.save( { a:/xyz/ } );
|
|
||||||
t.save( { a:{ q:1 } } );
|
|
||||||
t.save( { a:true } );
|
|
||||||
t.save( { a:new Date() } );
|
|
||||||
t.save( { a:new ObjectId() } );
|
|
||||||
for( type = 1; type <= 18; ++type ) {
|
|
||||||
if ( indexed && type == 17 ) {
|
|
||||||
// SERVER-3304
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
assertResults( null, { a:{ $type:type } } );
|
|
||||||
}
|
|
||||||
|
|
||||||
// $atomic does not affect results.
|
|
||||||
t.remove();
|
|
||||||
t.save( { _id:0, a:1 } );
|
|
||||||
t.save( { _id:1, a:2 } );
|
|
||||||
t.save( { _id:2, a:3 } );
|
|
||||||
assertResults( [ { _id:0, a:1 } ], { a:1, $atomic:true } );
|
|
||||||
assertResults( [ { _id:1, a:2 } ], { a:2, $atomic:true } );
|
|
||||||
assertResults( [ { _id:1, a:2 }, { _id:2, a:3 } ], { a:{ $gt:1 }, $atomic:true } );
|
|
||||||
assertResults( [ { _id:0, a:1 }, { _id:1, a:2 } ], { a:{ $lte:2 }, $atomic:true } );
|
|
||||||
assertResults( [ { _id:0, a:1 }, { _id:2, a:3 } ], { a:{ $in:[ 1, 3 ] }, $atomic:true } );
|
|
||||||
|
|
||||||
// $and
|
|
||||||
assertResults( [ { _id:1, a:2 } ], { $and:[ { a:2 }, { _id:1 } ] } );
|
|
||||||
assertResults( [], { $and:[ { a:1 }, { _id:1 } ] } );
|
|
||||||
assertResults( [ { _id:1, a:2 }, { _id:2, a:3 } ],
|
|
||||||
{ $and:[ { $or:[ { _id:1 }, { a:3 } ] }, { $or:[ { _id:2 }, { a:2 } ] } ] } );
|
|
||||||
|
|
||||||
// $or
|
|
||||||
assertResults( [ { _id:0, a:1 }, { _id:2, a:3 } ], { $or:[ { _id:0 }, { a:3 } ] } );
|
|
||||||
}
|
|
||||||
|
|
||||||
checkMatchResults( false );
|
|
||||||
t.ensureIndex( { a:1 } );
|
|
||||||
checkMatchResults( true );
|
|
||||||
t.ensureIndex( { 'a.b':1 } );
|
|
||||||
t.ensureIndex( { 'a.c':1 } );
|
|
||||||
checkMatchResults( true );
|
|
||||||
|
|
@ -1,89 +0,0 @@
|
||||||
var s3832 = db.c;
|
|
||||||
s3832.drop();
|
|
||||||
|
|
||||||
s3832.save({_id: 1, a:"foo", b:"bar"});
|
|
||||||
s3832.save({_id: 2, a:"feh", b:"baz"});
|
|
||||||
s3832.save({_id: 3, a:"fee", b:"fum"});
|
|
||||||
|
|
||||||
var a1 = s3832.aggregate( { $match : { b : "baz" } } );
|
|
||||||
|
|
||||||
var a1result = [
|
|
||||||
{
|
|
||||||
"_id" : 2,
|
|
||||||
"a" : "feh",
|
|
||||||
"b" : "baz"
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
assert.eq(a1.result, a1result, 's3832.a1 failed');
|
|
||||||
|
|
||||||
|
|
||||||
var a2 = s3832.aggregate( { $sort : { a : 1 } } );
|
|
||||||
|
|
||||||
var a2result = [
|
|
||||||
{
|
|
||||||
"_id" : 3,
|
|
||||||
"a" : "fee",
|
|
||||||
"b" : "fum"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"_id" : 2,
|
|
||||||
"a" : "feh",
|
|
||||||
"b" : "baz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"_id" : 1,
|
|
||||||
"a" : "foo",
|
|
||||||
"b" : "bar"
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
assert.eq(a2.result, a2result, 's3832.a2 failed');
|
|
||||||
|
|
||||||
|
|
||||||
var a3 = s3832.aggregate(
|
|
||||||
{ $match : { b : "baz" } },
|
|
||||||
{ $sort : { a : 1 } } );
|
|
||||||
|
|
||||||
assert.eq(a3.result, a1result, 's3832.a3 failed');
|
|
||||||
|
|
||||||
|
|
||||||
db.s3832.ensureIndex({ b : 1 }, { name : "s3832_b" });
|
|
||||||
|
|
||||||
|
|
||||||
var a4 = s3832.aggregate({ $match : { b : "baz" } });
|
|
||||||
|
|
||||||
assert.eq(a4.result, a1result, 's3832.a4 failed');
|
|
||||||
|
|
||||||
|
|
||||||
var a5 = s3832.aggregate({ $sort : { a : 1 } });
|
|
||||||
|
|
||||||
assert.eq(a5.result, a2result, 's3832.a5 failed');
|
|
||||||
|
|
||||||
|
|
||||||
var a6 = s3832.aggregate(
|
|
||||||
{ $match : { b : "baz" } },
|
|
||||||
{ $sort : { a : 1 } } );
|
|
||||||
|
|
||||||
assert.eq(a6.result, a1result, 's3832.a6 failed');
|
|
||||||
|
|
||||||
|
|
||||||
var dropb = db.s3832.dropIndex("s3832_b");
|
|
||||||
|
|
||||||
db.s3832.ensureIndex({ a : 1 }, { name : "s3832_a" });
|
|
||||||
|
|
||||||
var a7 = s3832.aggregate({ $match : { b : "baz" } });
|
|
||||||
|
|
||||||
assert.eq(a7.result, a1result, 's3832.a7 failed');
|
|
||||||
|
|
||||||
|
|
||||||
var a8 = s3832.aggregate({ $sort : { a : 1 } });
|
|
||||||
|
|
||||||
assert.eq(a8.result, a2result, 's3832.a8 failed');
|
|
||||||
|
|
||||||
|
|
||||||
var a9 = s3832.aggregate(
|
|
||||||
{ $match : { b : "baz" } },
|
|
||||||
{ $sort : { a : 1 } } );
|
|
||||||
|
|
||||||
assert.eq(a9.result, a1result, 's3832.a9 failed');
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue