From 8a79edb43b2ba66a4f8e2764afcf5347ffdf092b Mon Sep 17 00:00:00 2001 From: David Glasser Date: Tue, 19 Mar 2013 16:29:18 -0700 Subject: [PATCH] "tools" -> "scripts", "engine" -> "tools" --- .gitmodules | 2 +- meteor | 4 +- {tools => scripts}/admin/bless-release.sh | 0 .../admin/build-fake-release.sh | 8 +-- .../admin/build-install-script.js | 0 .../admin/build-package-tarballs.sh | 2 +- {tools => scripts}/admin/build-release.sh | 10 +-- scripts/admin/build-tools-tarballs.sh | 40 +++++++++++ .../admin/build-tools-tree.sh | 24 +++---- {tools => scripts}/admin/changelog.json | 0 {tools => scripts}/admin/debian/changelog | 0 {tools => scripts}/admin/debian/compat | 0 {tools => scripts}/admin/debian/control | 0 {tools => scripts}/admin/debian/copyright | 0 {tools => scripts}/admin/debian/docs | 0 .../admin/debian/meteor.install | 0 {tools => scripts}/admin/debian/rules | 0 {tools => scripts}/admin/debian/source/format | 0 {tools => scripts}/admin/deploy-examples.sh | 0 .../admin/find-new-npm-versions.sh | 0 .../admin/initial-engine-post-upgrade.js | 2 +- scripts/admin/install-bootstrap.txt | 1 + {tools => scripts}/admin/install-template.sh | 0 {tools => scripts}/admin/manifest.json | 0 {tools => scripts}/admin/meteor-bootstrap.sh | 6 +- {tools => scripts}/admin/meteor.spec | 0 {tools => scripts}/admin/publish-release.sh | 0 .../admin/publish-release}/.meteor/.gitignore | 0 .../admin/publish-release/.meteor/packages | 0 .../admin/publish-release/packages/awssum | 0 .../publish-release/server/publish-release.js | 20 +++--- {tools => scripts}/admin/spark-standalone.sh | 0 {tools => scripts}/bundler-test.sh | 2 +- {tools => scripts}/cli-test.sh | 4 +- .../copy-release-from-jenkins.sh | 0 {tools => scripts}/generate-dev-bundle.sh | 0 {tools => scripts}/node.sh | 0 .../run-tools-tests.sh | 8 +-- tools/admin/build-engine-tarballs.sh | 40 ----------- tools/admin/install-bootstrap.txt | 1 - {engine => tools}/app.html.in | 0 {engine => tools}/bundler.js | 4 +- {engine => tools}/cleanup.js | 0 {engine => tools}/deploy.js | 0 {engine => tools}/fiber-helpers.js | 0 {engine => tools}/files.js | 16 ++--- {engine => tools}/meteor.js | 42 ++++++------ {engine => tools}/meteor_npm.js | 0 {engine => tools}/mongo_exit_codes.js | 0 {engine => tools}/mongo_runner.js | 0 {engine => tools}/packages.js | 2 +- {engine => tools}/project.js | 3 +- {engine => tools}/run.js | 2 +- {engine => tools}/server/server.js | 2 +- .../skel}/.meteor/.gitignore | 0 {engine => tools}/skel/.meteor/packages | 0 {engine => tools}/skel/~name~.css | 0 {engine => tools}/skel/~name~.html | 0 {engine => tools}/skel/~name~.js | 0 .../test-runner-app}/.meteor/.gitignore | 0 .../test-runner-app/.meteor/packages | 0 .../app-with-package}/.meteor/.gitignore | 0 .../tests/app-with-package/.meteor/packages | 0 .../empty-app}/.meteor/.gitignore | 0 .../tests/empty-app/.meteor/packages | 0 {engine => tools}/tests/test_bundler.js | 0 {engine => tools}/tests/test_bundler_npm.js | 2 +- .../tests/test_bundler_options.js | 0 {engine => tools}/updater.js | 0 {engine => tools}/warehouse.js | 68 +++++++++---------- 70 files changed, 157 insertions(+), 158 deletions(-) rename {tools => scripts}/admin/bless-release.sh (100%) rename {tools => scripts}/admin/build-fake-release.sh (89%) rename {tools => scripts}/admin/build-install-script.js (100%) rename {tools => scripts}/admin/build-package-tarballs.sh (98%) rename {tools => scripts}/admin/build-release.sh (70%) create mode 100755 scripts/admin/build-tools-tarballs.sh rename tools/admin/build-engine-tree.sh => scripts/admin/build-tools-tree.sh (63%) rename {tools => scripts}/admin/changelog.json (100%) rename {tools => scripts}/admin/debian/changelog (100%) rename {tools => scripts}/admin/debian/compat (100%) rename {tools => scripts}/admin/debian/control (100%) rename {tools => scripts}/admin/debian/copyright (100%) rename {tools => scripts}/admin/debian/docs (100%) rename {tools => scripts}/admin/debian/meteor.install (100%) rename {tools => scripts}/admin/debian/rules (100%) rename {tools => scripts}/admin/debian/source/format (100%) rename {tools => scripts}/admin/deploy-examples.sh (100%) rename {tools => scripts}/admin/find-new-npm-versions.sh (100%) rename {tools => scripts}/admin/initial-engine-post-upgrade.js (98%) create mode 100644 scripts/admin/install-bootstrap.txt rename {tools => scripts}/admin/install-template.sh (100%) rename {tools => scripts}/admin/manifest.json (100%) rename {tools => scripts}/admin/meteor-bootstrap.sh (86%) rename {tools => scripts}/admin/meteor.spec (100%) rename {tools => scripts}/admin/publish-release.sh (100%) rename {engine/skel => scripts/admin/publish-release}/.meteor/.gitignore (100%) rename {tools => scripts}/admin/publish-release/.meteor/packages (100%) rename {tools => scripts}/admin/publish-release/packages/awssum (100%) rename {tools => scripts}/admin/publish-release/server/publish-release.js (91%) rename {tools => scripts}/admin/spark-standalone.sh (100%) rename {tools => scripts}/bundler-test.sh (80%) rename {tools => scripts}/cli-test.sh (98%) rename {tools => scripts}/copy-release-from-jenkins.sh (100%) rename {tools => scripts}/generate-dev-bundle.sh (100%) rename {tools => scripts}/node.sh (100%) rename tools/run-engine-tests.sh => scripts/run-tools-tests.sh (77%) delete mode 100755 tools/admin/build-engine-tarballs.sh delete mode 100644 tools/admin/install-bootstrap.txt rename {engine => tools}/app.html.in (100%) rename {engine => tools}/bundler.js (99%) rename {engine => tools}/cleanup.js (100%) rename {engine => tools}/deploy.js (100%) rename {engine => tools}/fiber-helpers.js (100%) rename {engine => tools}/files.js (96%) rename {engine => tools}/meteor.js (96%) rename {engine => tools}/meteor_npm.js (100%) rename {engine => tools}/mongo_exit_codes.js (100%) rename {engine => tools}/mongo_runner.js (100%) rename {engine => tools}/packages.js (99%) rename {engine => tools}/project.js (97%) rename {engine => tools}/run.js (99%) rename {engine => tools}/server/server.js (99%) rename {engine/test-runner-app => tools/skel}/.meteor/.gitignore (100%) rename {engine => tools}/skel/.meteor/packages (100%) rename {engine => tools}/skel/~name~.css (100%) rename {engine => tools}/skel/~name~.html (100%) rename {engine => tools}/skel/~name~.js (100%) rename {engine/tests/app-with-package => tools/test-runner-app}/.meteor/.gitignore (100%) rename {engine => tools}/test-runner-app/.meteor/packages (100%) rename {engine/tests/empty-app => tools/tests/app-with-package}/.meteor/.gitignore (100%) rename {engine => tools}/tests/app-with-package/.meteor/packages (100%) rename tools/{admin/publish-release => tests/empty-app}/.meteor/.gitignore (100%) rename {engine => tools}/tests/empty-app/.meteor/packages (100%) rename {engine => tools}/tests/test_bundler.js (100%) rename {engine => tools}/tests/test_bundler_npm.js (99%) rename {engine => tools}/tests/test_bundler_options.js (100%) rename {engine => tools}/updater.js (100%) rename {engine => tools}/warehouse.js (83%) diff --git a/.gitmodules b/.gitmodules index 8ca5bfb120..b3ddc9a80a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "meteor-awssum"] - path = tools/admin/publish-release/packages/awssum + path = scripts/admin/publish-release/packages/awssum url = https://github.com/avital/meteor-awssum \ No newline at end of file diff --git a/meteor b/meteor index 6a80833e13..08950a4373 100755 --- a/meteor +++ b/meteor @@ -83,11 +83,11 @@ if [ -d "$SCRIPT_DIR/.git" ] || [ -f "$SCRIPT_DIR/.git" ]; then fi DEV_BUNDLE="$SCRIPT_DIR/dev_bundle" - METEOR="$SCRIPT_DIR/engine/meteor.js" + METEOR="$SCRIPT_DIR/tools/meteor.js" else # In an install DEV_BUNDLE=$(dirname "$SCRIPT_DIR") - METEOR="$DEV_BUNDLE/engine/meteor.js" + METEOR="$DEV_BUNDLE/tools/meteor.js" fi diff --git a/tools/admin/bless-release.sh b/scripts/admin/bless-release.sh similarity index 100% rename from tools/admin/bless-release.sh rename to scripts/admin/bless-release.sh diff --git a/tools/admin/build-fake-release.sh b/scripts/admin/build-fake-release.sh similarity index 89% rename from tools/admin/build-fake-release.sh rename to scripts/admin/build-fake-release.sh index 8156577960..10de08d8fe 100755 --- a/tools/admin/build-fake-release.sh +++ b/scripts/admin/build-fake-release.sh @@ -44,12 +44,12 @@ popd # Copy post-upgrade script to where it is expected. mkdir -p "$FAKE_TMPDIR/meteor/app/meteor" -cp "$TOPDIR/tools/admin/initial-engine-post-upgrade.js" \ +cp "$TOPDIR/scripts/admin/initial-engine-post-upgrade.js" \ "$FAKE_TMPDIR/meteor/app/meteor/post-upgrade.js" # Copy in meteor-bootstrap.sh, which will become the installed # /usr/local/bin/meteor. -cp "$TOPDIR/tools/admin/meteor-bootstrap.sh" \ +cp "$TOPDIR/scripts/admin/meteor-bootstrap.sh" \ "$FAKE_TMPDIR/meteor/app/meteor/meteor-bootstrap.sh" OUTDIR="$TOPDIR/dist" @@ -69,7 +69,7 @@ if [ "$UNAME" == "Linux" ] ; then cp "$TARBALL" "meteor_${VERSION}.orig.tar.gz" mkdir "meteor-${VERSION}" cd "meteor-${VERSION}" - cp -r "$TOPDIR/tools/admin/debian" . + cp -r "$TOPDIR/scripts/admin/debian" . export TARBALL dpkg-buildpackage cp ../*.deb "$OUTDIR" @@ -79,6 +79,6 @@ if [ "$UNAME" == "Linux" ] ; then RPMDIR="$FAKE_TMPDIR/rpm" mkdir $RPMDIR rpmbuild -bb --define="TARBALL $TARBALL" \ - --define="_topdir $RPMDIR" "$TOPDIR/tools/admin/meteor.spec" + --define="_topdir $RPMDIR" "$TOPDIR/scripts/admin/meteor.spec" cp $RPMDIR/RPMS/*/*.rpm "$OUTDIR" fi diff --git a/tools/admin/build-install-script.js b/scripts/admin/build-install-script.js similarity index 100% rename from tools/admin/build-install-script.js rename to scripts/admin/build-install-script.js diff --git a/tools/admin/build-package-tarballs.sh b/scripts/admin/build-package-tarballs.sh similarity index 98% rename from tools/admin/build-package-tarballs.sh rename to scripts/admin/build-package-tarballs.sh index 982bff8287..7a0c1ae118 100755 --- a/tools/admin/build-package-tarballs.sh +++ b/scripts/admin/build-package-tarballs.sh @@ -8,7 +8,7 @@ ### At the moment smart packages don't support binary dependencies so ### we don't have to build on different architectures. At some point ### this will change, at which we'll use an approach similar to what -### we do for engines. +### we do for tools. set -e diff --git a/tools/admin/build-release.sh b/scripts/admin/build-release.sh similarity index 70% rename from tools/admin/build-release.sh rename to scripts/admin/build-release.sh index 2986caad07..230a86144c 100755 --- a/tools/admin/build-release.sh +++ b/scripts/admin/build-release.sh @@ -11,18 +11,18 @@ OUTDIR="$TOPDIR/dist" rm -rf "$OUTDIR" mkdir -p "$OUTDIR" -tools/admin/build-engine-tarballs.sh -ENGINE_VERSION=$(cat "$TOPDIR/.engine_version") -tools/admin/build-package-tarballs.sh +scripts/admin/build-tools-tarballs.sh +TOOLS_VERSION=$(cat "$TOPDIR/.tools_version") +scripts/admin/build-package-tarballs.sh MANIFEST_PACKAGE_CHUNK=$(cat "$TOPDIR/.package_manifest_chunk") # don't keep these around since they get outdated -rm "$TOPDIR/.engine_version" +rm "$TOPDIR/.tools_version" rm "$TOPDIR/.package_manifest_chunk" cat > "$OUTDIR/manifest.json" </dev/null 2>&1' 0 + +# build the tools in a temporary directory. after its built we know +# its version so rename the directory. +mkdir -p "$TOOLS_TMPDIR/.meteor/tools" +export TARGET_DIR="$TOOLS_TMPDIR/.meteor/tools/new" +$TOPDIR/scripts/admin/build-tools-tree.sh +TOOLS_VERSION=$(cat $TARGET_DIR/.tools_version.txt) +mv "$TARGET_DIR" "$TOOLS_TMPDIR/.meteor/tools/$TOOLS_VERSION" + +ln -s "$TOOLS_VERSION" "$TOOLS_TMPDIR/.meteor/tools/latest" +ln -s tools/latest/bin/meteor "$TOOLS_TMPDIR/.meteor/meteor" + +# tar it up +OUTDIR="$TOPDIR/dist/tools" +mkdir -p "$OUTDIR" + +TOOLS_TARBALL="$OUTDIR/meteor-tools-${TOOLS_VERSION}-${UNAME}-${ARCH}.tar.gz" +echo "Tarring tools to: $TOOLS_TARBALL" +tar -C "$TOOLS_TMPDIR/.meteor/tools" --exclude .meteor/local -czf "$TOOLS_TARBALL" "$TOOLS_VERSION" + +TOOLS_BOOTSTRAP_TARBALL="$OUTDIR/meteor-tools-bootstrap-${UNAME}-${ARCH}.tar.gz" +echo "Tarring tools bootstrap to: $TOOLS_BOOTSTRAP_TARBALL" +tar -C "$TOOLS_TMPDIR" --exclude .meteor/local -czf "$TOOLS_BOOTSTRAP_TARBALL" .meteor + +# A hacky (?) way to pass $TOOLS_VERSION back into build-release.sh +echo $TOOLS_VERSION > $TOPDIR/.tools_version diff --git a/tools/admin/build-engine-tree.sh b/scripts/admin/build-tools-tree.sh similarity index 63% rename from tools/admin/build-engine-tree.sh rename to scripts/admin/build-tools-tree.sh index 70f033da73..b201a4f35e 100755 --- a/tools/admin/build-engine-tree.sh +++ b/scripts/admin/build-tools-tree.sh @@ -1,9 +1,9 @@ #!/bin/bash # This script fills TARGET_DIR with what should go into -# /usr/local/meteor/engines/X.Y.Z +# ~/.meteor/tools/VERSION # It does not set up the top-level springboard file in -# /usr/local/meteor/engines or the /usr/local/bin/meteor symlink. +# ~/.meteor/tools or the ~/.meteor/meteor symlink. cd `dirname $0`/../.. @@ -19,7 +19,7 @@ if [ -e "$TARGET_DIR" ] ; then exit 1 fi -echo "Setting up engine tree in $TARGET_DIR" +echo "Setting up tools tree in $TARGET_DIR" # make sure dev bundle exists before trying to install ./meteor --version || exit 1 @@ -28,28 +28,28 @@ function CPR { tar -c --exclude .meteor/local "$1" | tar -x -C "$2" } -# The engine starts as a copy of the dev bundle. +# The tools starts as a copy of the dev bundle. cp -a dev_bundle "$TARGET_DIR" # Copy over files and directories that we want in the tarball. Keep this list -# synchronized with the files used in the $ENGINE_VERSION calculation below. The +# synchronized with the files used in the $TOOLS_VERSION calculation below. The # "meteor" script file contains the version number of the dev bundle, so we # include that instead of the (arch-specific) bundle itself in sha calculation. cp LICENSE.txt "$TARGET_DIR" cp meteor "$TARGET_DIR/bin" -CPR engine "$TARGET_DIR" +CPR tools "$TARGET_DIR" CPR examples "$TARGET_DIR" # Trim tests and unfinished examples. -rm -rf "$TARGET_DIR"/engine/tests +rm -rf "$TARGET_DIR"/tools/tests rm -rf "$TARGET_DIR"/examples/unfinished rm -rf "$TARGET_DIR"/examples/other # mark directory with current git sha git rev-parse HEAD > "$TARGET_DIR/.git_version.txt" -# generate engine version: directory hash that depends only on file +# generate tools version: directory hash that depends only on file # contents but nothing else, eg modification time -echo -n "Computing engine version... " -ENGINE_VERSION=$(git ls-tree HEAD LICENSE.txt meteor engine examples | shasum | cut -f 1 -d " ") # shasum's output looks like: 'SHA -' -echo $ENGINE_VERSION -echo -n "$ENGINE_VERSION" > "$TARGET_DIR/.engine_version.txt" +echo -n "Computing tools version... " +TOOLS_VERSION=$(git ls-tree HEAD LICENSE.txt meteor tools examples | shasum | cut -f 1 -d " ") # shasum's output looks like: 'SHA -' +echo $TOOLS_VERSION +echo -n "$TOOLS_VERSION" > "$TARGET_DIR/.tools_version.txt" diff --git a/tools/admin/changelog.json b/scripts/admin/changelog.json similarity index 100% rename from tools/admin/changelog.json rename to scripts/admin/changelog.json diff --git a/tools/admin/debian/changelog b/scripts/admin/debian/changelog similarity index 100% rename from tools/admin/debian/changelog rename to scripts/admin/debian/changelog diff --git a/tools/admin/debian/compat b/scripts/admin/debian/compat similarity index 100% rename from tools/admin/debian/compat rename to scripts/admin/debian/compat diff --git a/tools/admin/debian/control b/scripts/admin/debian/control similarity index 100% rename from tools/admin/debian/control rename to scripts/admin/debian/control diff --git a/tools/admin/debian/copyright b/scripts/admin/debian/copyright similarity index 100% rename from tools/admin/debian/copyright rename to scripts/admin/debian/copyright diff --git a/tools/admin/debian/docs b/scripts/admin/debian/docs similarity index 100% rename from tools/admin/debian/docs rename to scripts/admin/debian/docs diff --git a/tools/admin/debian/meteor.install b/scripts/admin/debian/meteor.install similarity index 100% rename from tools/admin/debian/meteor.install rename to scripts/admin/debian/meteor.install diff --git a/tools/admin/debian/rules b/scripts/admin/debian/rules similarity index 100% rename from tools/admin/debian/rules rename to scripts/admin/debian/rules diff --git a/tools/admin/debian/source/format b/scripts/admin/debian/source/format similarity index 100% rename from tools/admin/debian/source/format rename to scripts/admin/debian/source/format diff --git a/tools/admin/deploy-examples.sh b/scripts/admin/deploy-examples.sh similarity index 100% rename from tools/admin/deploy-examples.sh rename to scripts/admin/deploy-examples.sh diff --git a/tools/admin/find-new-npm-versions.sh b/scripts/admin/find-new-npm-versions.sh similarity index 100% rename from tools/admin/find-new-npm-versions.sh rename to scripts/admin/find-new-npm-versions.sh diff --git a/tools/admin/initial-engine-post-upgrade.js b/scripts/admin/initial-engine-post-upgrade.js similarity index 98% rename from tools/admin/initial-engine-post-upgrade.js rename to scripts/admin/initial-engine-post-upgrade.js index 9440b2965b..46792d468e 100644 --- a/tools/admin/initial-engine-post-upgrade.js +++ b/scripts/admin/initial-engine-post-upgrade.js @@ -107,7 +107,7 @@ var rpmUpgrade = function () { }; Fiber(function () { - console.log("Upgrading to Engine Meteor in " + prefix + "!"); + console.log("Upgrading to Tools Meteor in " + prefix + "!"); if (package_stamp === 'tar') { macUpgrade(); } else if (package_stamp === 'deb') { diff --git a/scripts/admin/install-bootstrap.txt b/scripts/admin/install-bootstrap.txt new file mode 100644 index 0000000000..876be755b2 --- /dev/null +++ b/scripts/admin/install-bootstrap.txt @@ -0,0 +1 @@ +https://warehouse.meteor.com/tools/c3cdeb9f118c5241ca6a4f1d5b88aa04f0c08ab7 diff --git a/tools/admin/install-template.sh b/scripts/admin/install-template.sh similarity index 100% rename from tools/admin/install-template.sh rename to scripts/admin/install-template.sh diff --git a/tools/admin/manifest.json b/scripts/admin/manifest.json similarity index 100% rename from tools/admin/manifest.json rename to scripts/admin/manifest.json diff --git a/tools/admin/meteor-bootstrap.sh b/scripts/admin/meteor-bootstrap.sh similarity index 86% rename from tools/admin/meteor-bootstrap.sh rename to scripts/admin/meteor-bootstrap.sh index 68de789777..e544e23324 100755 --- a/tools/admin/meteor-bootstrap.sh +++ b/scripts/admin/meteor-bootstrap.sh @@ -39,14 +39,14 @@ if [ ! -x "$HOME/.meteor/meteor" ]; then fi fi - # This returns something like https://warehouse.meteor.com/engines/db68972b9d239a95bffa3abe652d1e17815dba91 + # This returns something like https://warehouse.meteor.com/tools/db68972b9d239a95bffa3abe652d1e17815dba91 ROOT_URL="$(curl -s --fail $BOOTSTRAP_URL)" - TARBALL_URL="${ROOT_URL}/meteor-engine-bootstrap-${UNAME}-${ARCH}.tar.gz" + TARBALL_URL="${ROOT_URL}/meteor-tools-bootstrap-${UNAME}-${ARCH}.tar.gz" INSTALL_TMPDIR="$HOME/.meteor-install-tmp" rm -rf "$INSTALL_TMPDIR" mkdir "$INSTALL_TMPDIR" - echo 'This is your first time using Meteor! Downloading the engine now.' + echo 'This is your first time using Meteor! Downloading the tools now.' curl --progress-bar --fail "$TARBALL_URL" | tar -xzf - -C "$INSTALL_TMPDIR" # bomb out if it didn't work, eg no net test -x "${INSTALL_TMPDIR}/.meteor/meteor" diff --git a/tools/admin/meteor.spec b/scripts/admin/meteor.spec similarity index 100% rename from tools/admin/meteor.spec rename to scripts/admin/meteor.spec diff --git a/tools/admin/publish-release.sh b/scripts/admin/publish-release.sh similarity index 100% rename from tools/admin/publish-release.sh rename to scripts/admin/publish-release.sh diff --git a/engine/skel/.meteor/.gitignore b/scripts/admin/publish-release/.meteor/.gitignore similarity index 100% rename from engine/skel/.meteor/.gitignore rename to scripts/admin/publish-release/.meteor/.gitignore diff --git a/tools/admin/publish-release/.meteor/packages b/scripts/admin/publish-release/.meteor/packages similarity index 100% rename from tools/admin/publish-release/.meteor/packages rename to scripts/admin/publish-release/.meteor/packages diff --git a/tools/admin/publish-release/packages/awssum b/scripts/admin/publish-release/packages/awssum similarity index 100% rename from tools/admin/publish-release/packages/awssum rename to scripts/admin/publish-release/packages/awssum diff --git a/tools/admin/publish-release/server/publish-release.js b/scripts/admin/publish-release/server/publish-release.js similarity index 91% rename from tools/admin/publish-release/server/publish-release.js rename to scripts/admin/publish-release/server/publish-release.js index 7574060898..048c3f308d 100644 --- a/tools/admin/publish-release/server/publish-release.js +++ b/scripts/admin/publish-release/server/publish-release.js @@ -71,27 +71,27 @@ var noneWithPrefix = function(s3, prefix) { return !_.isEmpty(files.Body.ListBucketResult.Contents); }; -// publish a given engine, copying multiple files from +// publish a given tools, copying multiple files from // s3://com.meteor.warehouse/RELEASE/unpublished/ to -// s3://com.meteor.warehouse/engines/VERSION/ -var publishEngine = function(s3, release, version) { - var destPath = ["engines", version].join("/"); +// s3://com.meteor.warehouse/tools/VERSION/ +var publishTools = function(s3, release, version) { + var destPath = ["tools", version].join("/"); - process.stdout.write("engine " + version + ": "); + process.stdout.write("tools " + version + ": "); if (noneWithPrefix(s3, destPath)) { console.log("already published"); return; } else { - publishedArtifacts.push("engine " + version); + publishedArtifacts.push("tools " + version); console.log("publishing"); } - var engineArtifacts = s3.ListObjects({ + var toolsArtifacts = s3.ListObjects({ BucketName: "com.meteor.warehouse", - Prefix: ["unpublished", release, "meteor-engine-"].join("/") + Prefix: ["unpublished", release, "meteor-tools-"].join("/") }).Body.ListBucketResult.Contents; - parallelEach(engineArtifacts, function (artifact) { + parallelEach(toolsArtifacts, function (artifact) { var sourceKey = artifact.Key; var filename = _.last(sourceKey.split("/")); var destKey = [destPath, filename].join("/"); @@ -178,7 +178,7 @@ var main = function() { var release = getGitSha(); var s3 = configureS3(); var manifest = getManifest(s3, release); - publishEngine(s3, release, manifest.engine); + publishTools(s3, release, manifest.tools); parallelEach(manifest.packages, function(version, name) { publishPackage(s3, release, name, version); }); diff --git a/tools/admin/spark-standalone.sh b/scripts/admin/spark-standalone.sh similarity index 100% rename from tools/admin/spark-standalone.sh rename to scripts/admin/spark-standalone.sh diff --git a/tools/bundler-test.sh b/scripts/bundler-test.sh similarity index 80% rename from tools/bundler-test.sh rename to scripts/bundler-test.sh index b8edd204d1..3b7dd9c0b2 100755 --- a/tools/bundler-test.sh +++ b/scripts/bundler-test.sh @@ -7,7 +7,7 @@ trap 'echo FAILED' EXIT METEOR_DIR=$(pwd)/.. # run tests -./node.sh $METEOR_DIR/engine/tests/test_bundler.js +./node.sh $METEOR_DIR/tools/tests/test_bundler.js # cleanup trap, and print "SUCCESS" trap - EXIT diff --git a/tools/cli-test.sh b/scripts/cli-test.sh similarity index 98% rename from tools/cli-test.sh rename to scripts/cli-test.sh index 85bef2099c..718e556e88 100755 --- a/tools/cli-test.sh +++ b/scripts/cli-test.sh @@ -23,11 +23,11 @@ if [ "$1" == "--global" ]; then fi if [ "$TEST_WAREHOUSE_DIR" ]; then - # The point of this testing script is to test the engine, so we make + # The point of this testing script is to test the tools, so we make # sure (in lib/meteor.js) to not springboard if TEST_WAREHOUSE_DIR is # set. This is a random release that we pass to --release on all # commands (in case TEST_WAREHOUSE_DIR) is set. This could break if - # this specified release is incompatible with the current engine, in + # this specified release is incompatible with the current tools, in # which case you can build and publish a new release and set it here. TEST_RELEASE="0.6.0" diff --git a/tools/copy-release-from-jenkins.sh b/scripts/copy-release-from-jenkins.sh similarity index 100% rename from tools/copy-release-from-jenkins.sh rename to scripts/copy-release-from-jenkins.sh diff --git a/tools/generate-dev-bundle.sh b/scripts/generate-dev-bundle.sh similarity index 100% rename from tools/generate-dev-bundle.sh rename to scripts/generate-dev-bundle.sh diff --git a/tools/node.sh b/scripts/node.sh similarity index 100% rename from tools/node.sh rename to scripts/node.sh diff --git a/tools/run-engine-tests.sh b/scripts/run-tools-tests.sh similarity index 77% rename from tools/run-engine-tests.sh rename to scripts/run-tools-tests.sh index 88a78d08dc..9365be9aa9 100755 --- a/tools/run-engine-tests.sh +++ b/scripts/run-tools-tests.sh @@ -12,14 +12,14 @@ make_temp_dir() { mktemp -d -t $1.XXXXXX } -## Test the Meteor CLI from an installed engine (tests loading packages +## Test the Meteor CLI from an installed tools (tests loading packages ## into the warehouse). Notably TEST_TMPDIR=$(make_temp_dir meteor-installed-cli-tests) -ENGINE_DIR="$TEST_TMPDIR/engine-tree" -TARGET_DIR="$ENGINE_DIR" admin/build-engine-tree.sh +TOOLS_DIR="$TEST_TMPDIR/tools-tree" +TARGET_DIR="$TOOLS_DIR" admin/build-tools-tree.sh export TEST_WAREHOUSE_DIR=$(make_temp_dir meteor-installed-cli-tests-warehouse) # run with empty warehouse -export METEOR_DIR="$ENGINE_DIR/bin" +export METEOR_DIR="$TOOLS_DIR/bin" ./cli-test.sh unset TEST_WAREHOUSE_DIR unset METEOR_DIR diff --git a/tools/admin/build-engine-tarballs.sh b/tools/admin/build-engine-tarballs.sh deleted file mode 100755 index d67e7f0d98..0000000000 --- a/tools/admin/build-engine-tarballs.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -set -e - -# cd to top level dir -cd `dirname $0` -cd ../.. -TOPDIR=$(pwd) - -UNAME=$(uname) -ARCH=$(uname -m) - -ENGINE_TMPDIR=$(mktemp -d -t meteor-build-release-XXXXXXXX) -trap 'rm -rf "$ENGINE_TMPDIR" >/dev/null 2>&1' 0 - -# build the engine in a temporary directory. after its built we know -# its version so rename the directory. -mkdir -p "$ENGINE_TMPDIR/.meteor/engines" -export TARGET_DIR="$ENGINE_TMPDIR/.meteor/engines/new" -$TOPDIR/tools/admin/build-engine-tree.sh -ENGINE_VERSION=$(cat $TARGET_DIR/.engine_version.txt) -mv "$TARGET_DIR" "$ENGINE_TMPDIR/.meteor/engines/$ENGINE_VERSION" - -ln -s "$ENGINE_VERSION" "$ENGINE_TMPDIR/.meteor/engines/latest" -ln -s engines/latest/bin/meteor "$ENGINE_TMPDIR/.meteor/meteor" - -# tar it up -OUTDIR="$TOPDIR/dist/engine" -mkdir -p "$OUTDIR" - -ENGINE_TARBALL="$OUTDIR/meteor-engine-${ENGINE_VERSION}-${UNAME}-${ARCH}.tar.gz" -echo "Tarring engine to: $ENGINE_TARBALL" -tar -C "$ENGINE_TMPDIR/.meteor/engines" --exclude .meteor/local -czf "$ENGINE_TARBALL" "$ENGINE_VERSION" - -ENGINE_BOOTSTRAP_TARBALL="$OUTDIR/meteor-engine-bootstrap-${UNAME}-${ARCH}.tar.gz" -echo "Tarring engine bootstrap to: $ENGINE_BOOTSTRAP_TARBALL" -tar -C "$ENGINE_TMPDIR" --exclude .meteor/local -czf "$ENGINE_BOOTSTRAP_TARBALL" .meteor - -# A hacky (?) way to pass $ENGINE_VERSION back into build-release.sh -echo $ENGINE_VERSION > $TOPDIR/.engine_version diff --git a/tools/admin/install-bootstrap.txt b/tools/admin/install-bootstrap.txt deleted file mode 100644 index cefcc13829..0000000000 --- a/tools/admin/install-bootstrap.txt +++ /dev/null @@ -1 +0,0 @@ -https://warehouse.meteor.com/engines/c3cdeb9f118c5241ca6a4f1d5b88aa04f0c08ab7 diff --git a/engine/app.html.in b/tools/app.html.in similarity index 100% rename from engine/app.html.in rename to tools/app.html.in diff --git a/engine/bundler.js b/tools/bundler.js similarity index 99% rename from engine/bundler.js rename to tools/bundler.js index ae8af52e60..f394f7f2aa 100644 --- a/engine/bundler.js +++ b/tools/bundler.js @@ -3,7 +3,7 @@ // /static [served by node for now] // /static_cacheable [cache-forever files, served by node for now] // /server [XXX split out into a package] -// server.js, .... [contents of engine/server] +// server.js, .... [contents of tools/server] // node_modules [for now, contents of (dev_bundle)/lib/node_modules] // /app.html // /app [user code] @@ -702,7 +702,7 @@ _.extend(Bundle.prototype, { where: 'internal', hash: self._hash(app_html) }); - dependencies_json.core.push(path.join('engine', 'app.html.in')); + dependencies_json.core.push(path.join('tools', 'app.html.in')); // --- Documentation, and running from the command line --- diff --git a/engine/cleanup.js b/tools/cleanup.js similarity index 100% rename from engine/cleanup.js rename to tools/cleanup.js diff --git a/engine/deploy.js b/tools/deploy.js similarity index 100% rename from engine/deploy.js rename to tools/deploy.js diff --git a/engine/fiber-helpers.js b/tools/fiber-helpers.js similarity index 100% rename from engine/fiber-helpers.js rename to tools/fiber-helpers.js diff --git a/engine/files.js b/tools/files.js similarity index 96% rename from engine/files.js rename to tools/files.js index a8f2833ed0..e267d6bc4a 100644 --- a/engine/files.js +++ b/tools/files.js @@ -189,7 +189,7 @@ var files = module.exports = { // Are we running Meteor from a git checkout? in_checkout: function () { try { - if (fs.existsSync(path.join(files.getCurrentEngineDir(), '.git'))) + if (fs.existsSync(path.join(files.getCurrentToolsDir(), '.git'))) return true; } catch (e) { console.log(e);} @@ -208,13 +208,13 @@ var files = module.exports = { return !files.in_checkout(); }, - // Read the '.engine_version.txt' file. If in a checkout, throw an error. - getEngineVersion: function () { + // Read the '.tools_version.txt' file. If in a checkout, throw an error. + getToolsVersion: function () { if (!files.in_checkout()) { return fs.readFileSync( - path.join(files.getCurrentEngineDir(), '.engine_version.txt'), 'utf8'); + path.join(files.getCurrentToolsDir(), '.tools_version.txt'), 'utf8'); } else { - throw new Error("Unexpected. Git checkouts don't have engine versions."); + throw new Error("Unexpected. Git checkouts don't have tools versions."); } }, @@ -222,13 +222,13 @@ var files = module.exports = { // install, or (checkout root)/dev_bundle in a checkout..) get_dev_bundle: function () { if (files.in_checkout()) - return path.join(files.getCurrentEngineDir(), 'dev_bundle'); + return path.join(files.getCurrentToolsDir(), 'dev_bundle'); else - return files.getCurrentEngineDir(); + return files.getCurrentToolsDir(); }, // Return the top-level directory for this meteor install or checkout - getCurrentEngineDir: function () { + getCurrentToolsDir: function () { return path.join(__dirname, '..'); }, diff --git a/engine/meteor.js b/tools/meteor.js similarity index 96% rename from engine/meteor.js rename to tools/meteor.js index c92a307142..6ba42aea20 100644 --- a/engine/meteor.js +++ b/tools/meteor.js @@ -72,7 +72,7 @@ Fiber(function () { // If the releases directory in local warehouse is empty, fetch the // latest release from our servers. This release may require a - // different engine, in which case we'll springboard later. + // different tools, in which case we'll springboard later. var ensureSomeRelease = function () { if (!warehouse.latestRelease()) { warehouse.fetchLatestRelease(); @@ -399,14 +399,14 @@ Fiber(function () { var didUpdate = warehouse.fetchLatestRelease(); // we need to update the global releaseVersion variable - // because that's what engineSpringboard reads + // because that's what toolsSpringboard reads /* global */ releaseVersion = warehouse.latestRelease(); // XXX make errors look good if (didUpdate) { console.log("Updated Meteor to release " + releaseVersion + "."); - engineSpringboard(['--updated-from=' + updatedFrom]); - // If the engine for release is different, then engineSpringboard + toolsSpringboard(['--updated-from=' + updatedFrom]); + // If the tools for release is different, then toolsSpringboard // execs and does not return. Otherwise, keeps going. } @@ -414,7 +414,7 @@ Fiber(function () { // XXX this next line is WRONG, which suggests that the logic for // updatedFrom is wrong. (updatedFrom can be an app's version, not // just global version.) - engineDebugMessage("Globally updated from " + updatedFrom + " to " + toolsDebugMessage("Globally updated from " + updatedFrom + " to " + releaseVersion); // ... here is a chance to update the bootstrap script, etc // ... maybe print out some release notes or something @@ -828,30 +828,30 @@ Fiber(function () { } }); - // Prints a message if $METEOR_ENGINE_DEBUG is set. + // Prints a message if $METEOR_TOOLS_DEBUG is set. // XXX We really should have a better logging system. - var engineDebugMessage = function (msg) { - if (process.env.METEOR_ENGINE_DEBUG) - console.log("[ENGINE DEBUG] " + msg); + var toolsDebugMessage = function (msg) { + if (process.env.METEOR_TOOLS_DEBUG) + console.log("[TOOLS DEBUG] " + msg); }; // As the first step of running the Meteor CLI, check which Meteor // release we should be running against. Then, check whether the - // engine corresponding to that release is the same as the one - // we're running. If not, springboard to the right engine (after + // tools corresponding to that release is the same as the one + // we're running. If not, springboard to the right tools (after // having fetched it to the local warehouse) - var engineSpringboard = function (extraArgs) { + var toolsSpringboard = function (extraArgs) { var releaseManifest = warehouse.releaseManifestByVersion(releaseVersion); - if (releaseManifest.engine === files.getEngineVersion()) + if (releaseManifest.tools === files.getToolsVersion()) return; - engineDebugMessage("springboarding from " + files.getEngineVersion() + - " to " + releaseManifest.engine); + toolsDebugMessage("springboarding from " + files.getToolsVersion() + + " to " + releaseManifest.tools); // Strip off the "node" and "meteor.js" from argv and replace it with the - // appropriate engine's meteor shell script. + // appropriate tools's meteor shell script. var newArgv = process.argv.slice(2); - newArgv.unshift(path.join(warehouse.getEngineDir(releaseManifest.engine), + newArgv.unshift(path.join(warehouse.getToolsDir(releaseManifest.tools), 'bin', 'meteor')); if (extraArgs) newArgv.push.apply(newArgv, extraArgs); @@ -873,15 +873,15 @@ Fiber(function () { var argv = optimist.argv; /*global*/ releaseVersion = calculateReleaseVersion(argv); - engineDebugMessage("Running Meteor Release " + releaseVersion); + toolsDebugMessage("Running Meteor Release " + releaseVersion); - // if we're not running the correct engine, fetch it and + // if we're not running the correct tools, fetch it and // re-run. do *not* do this if we are in a checkout, or if // process.env.TEST_WAREHOUSE_DIR is set. This hook allows unit - // tests to test the current engine's ability to run other + // tests to test the current tools's ability to run other // releases. if (!files.in_checkout() && !process.env.TEST_WAREHOUSE_DIR) - engineSpringboard(); + toolsSpringboard(); if (argv.help) { argv._.splice(0, 0, "help"); diff --git a/engine/meteor_npm.js b/tools/meteor_npm.js similarity index 100% rename from engine/meteor_npm.js rename to tools/meteor_npm.js diff --git a/engine/mongo_exit_codes.js b/tools/mongo_exit_codes.js similarity index 100% rename from engine/mongo_exit_codes.js rename to tools/mongo_exit_codes.js diff --git a/engine/mongo_runner.js b/tools/mongo_runner.js similarity index 100% rename from engine/mongo_runner.js rename to tools/mongo_runner.js diff --git a/engine/packages.js b/tools/packages.js similarity index 99% rename from engine/packages.js rename to tools/packages.js index 911c7ba26f..f7c16de395 100644 --- a/engine/packages.js +++ b/tools/packages.js @@ -435,7 +435,7 @@ var packages = module.exports = { // If we're running out of a git checkout of meteor, use the packages from // the git tree. if (!files.usesWarehouse()) - packageDirs.push(path.join(files.getCurrentEngineDir(), 'packages')); + packageDirs.push(path.join(files.getCurrentToolsDir(), 'packages')); // Only return directories that exist. return _.filter(packageDirs, function (dir) { diff --git a/engine/project.js b/tools/project.js similarity index 97% rename from engine/project.js rename to tools/project.js index b30859daff..31b1468648 100644 --- a/engine/project.js +++ b/tools/project.js @@ -70,8 +70,7 @@ var project = module.exports = { return project._trim_line(project._get_lines(releasePath)[0]); else // This is a legacy app with no '.meteor/release' - // file. Default to the first release separating engine from - // packages + // file. Default to the first release of Engine. return '0.6.0'; }, diff --git a/engine/run.js b/tools/run.js similarity index 99% rename from engine/run.js rename to tools/run.js index 7057f19554..3bfe26a5de 100644 --- a/engine/run.js +++ b/tools/run.js @@ -338,7 +338,7 @@ var DependencyWatcher = function ( // contain individual files) self.bulk_dirs = []; _.each(deps.core || [], function (filepath) { - self.bulk_dirs.push(path.join(files.getCurrentEngineDir(), filepath)); + self.bulk_dirs.push(path.join(files.getCurrentToolsDir(), filepath)); }); _.each(deps.app || [], function (filepath) { self.bulk_dirs.push(path.join(self.app_dir, filepath)); diff --git a/engine/server/server.js b/tools/server/server.js similarity index 99% rename from engine/server/server.js rename to tools/server/server.js index 78db7c2a69..ea9a035caf 100644 --- a/engine/server/server.js +++ b/tools/server/server.js @@ -13,7 +13,7 @@ var useragent = require('useragent'); var _ = require('underscore'); -// This code is duplicated in engine/server/server.js. +// This code is duplicated in tools/server/server.js. var MIN_NODE_VERSION = 'v0.8.18'; if (require('semver').lt(process.version, MIN_NODE_VERSION)) { process.stderr.write( diff --git a/engine/test-runner-app/.meteor/.gitignore b/tools/skel/.meteor/.gitignore similarity index 100% rename from engine/test-runner-app/.meteor/.gitignore rename to tools/skel/.meteor/.gitignore diff --git a/engine/skel/.meteor/packages b/tools/skel/.meteor/packages similarity index 100% rename from engine/skel/.meteor/packages rename to tools/skel/.meteor/packages diff --git a/engine/skel/~name~.css b/tools/skel/~name~.css similarity index 100% rename from engine/skel/~name~.css rename to tools/skel/~name~.css diff --git a/engine/skel/~name~.html b/tools/skel/~name~.html similarity index 100% rename from engine/skel/~name~.html rename to tools/skel/~name~.html diff --git a/engine/skel/~name~.js b/tools/skel/~name~.js similarity index 100% rename from engine/skel/~name~.js rename to tools/skel/~name~.js diff --git a/engine/tests/app-with-package/.meteor/.gitignore b/tools/test-runner-app/.meteor/.gitignore similarity index 100% rename from engine/tests/app-with-package/.meteor/.gitignore rename to tools/test-runner-app/.meteor/.gitignore diff --git a/engine/test-runner-app/.meteor/packages b/tools/test-runner-app/.meteor/packages similarity index 100% rename from engine/test-runner-app/.meteor/packages rename to tools/test-runner-app/.meteor/packages diff --git a/engine/tests/empty-app/.meteor/.gitignore b/tools/tests/app-with-package/.meteor/.gitignore similarity index 100% rename from engine/tests/empty-app/.meteor/.gitignore rename to tools/tests/app-with-package/.meteor/.gitignore diff --git a/engine/tests/app-with-package/.meteor/packages b/tools/tests/app-with-package/.meteor/packages similarity index 100% rename from engine/tests/app-with-package/.meteor/packages rename to tools/tests/app-with-package/.meteor/packages diff --git a/tools/admin/publish-release/.meteor/.gitignore b/tools/tests/empty-app/.meteor/.gitignore similarity index 100% rename from tools/admin/publish-release/.meteor/.gitignore rename to tools/tests/empty-app/.meteor/.gitignore diff --git a/engine/tests/empty-app/.meteor/packages b/tools/tests/empty-app/.meteor/packages similarity index 100% rename from engine/tests/empty-app/.meteor/packages rename to tools/tests/empty-app/.meteor/packages diff --git a/engine/tests/test_bundler.js b/tools/tests/test_bundler.js similarity index 100% rename from engine/tests/test_bundler.js rename to tools/tests/test_bundler.js diff --git a/engine/tests/test_bundler_npm.js b/tools/tests/test_bundler_npm.js similarity index 99% rename from engine/tests/test_bundler_npm.js rename to tools/tests/test_bundler_npm.js index f1ba1148f2..ba42578875 100644 --- a/engine/tests/test_bundler_npm.js +++ b/tools/tests/test_bundler_npm.js @@ -244,7 +244,7 @@ assert.doesNotThrow(function () { // shared state, such as cached compiled packages try { var result = meteorNpm._execFileSync( - path.join(files.getCurrentEngineDir(), "meteor"), + path.join(files.getCurrentToolsDir(), "meteor"), ["bundle", path.join(tmpDirToPutBundleTarball, "bundle.tar.gz")], {cwd: tmpAppDir}); files.rm_recursive(tmpDirToPutBundleTarball); diff --git a/engine/tests/test_bundler_options.js b/tools/tests/test_bundler_options.js similarity index 100% rename from engine/tests/test_bundler_options.js rename to tools/tests/test_bundler_options.js diff --git a/engine/updater.js b/tools/updater.js similarity index 100% rename from engine/updater.js rename to tools/updater.js diff --git a/engine/warehouse.js b/tools/warehouse.js similarity index 83% rename from engine/warehouse.js rename to tools/warehouse.js index 3c0e8bbf35..9798de627e 100644 --- a/engine/warehouse.js +++ b/tools/warehouse.js @@ -1,19 +1,19 @@ -/// We store a "warehouse" of engines, releases and packages on +/// We store a "warehouse" of tools, releases and packages on /// disk. This warehouse is populated from our servers, as needed. /// /// Directory structure: /// -/// meteor (relative path symlink to engines/latest/bin/meteor) -/// engines/ (not in checkout, since we run against checked-out code) -/// latest/ (relative path symlink to latest x.y.z/ engine directory) -/// x.y.z/ +/// meteor (relative path symlink to tools/latest/bin/meteor) +/// tools/ (not in checkout, since we run against checked-out code) +/// latest/ (relative path symlink to latest VERSION/ tools directory) +/// VERSION/ /// releases/ /// latest (relative path symlink to latest x.y.z.release.json) /// x.y.z.release.json /// x.y.z.changelog.json /// packages/ /// foo/ -/// x.y.z/ +/// VERSION/ /// /// When running from a checkout, there is only one acceptable release - 'none', which /// has an empty manifest, ensuring that we only load local packages (in CHECKOUT/packages @@ -41,7 +41,7 @@ var symlinkOverSync = function (linkText, file) { var warehouse = module.exports = { - // Return our loaded collection of engines, releases and + // Return our loaded collection of tools, releases and // packages. If we're running an installed version, found at // $HOME/.meteor. getWarehouseDir: function () { @@ -58,8 +58,8 @@ var warehouse = module.exports = { return path.join(process.env.HOME, '.meteor'); }, - getEngineDir: function (version) { - return path.join(warehouse.getWarehouseDir(), 'engines', version); + getToolsDir: function (version) { + return path.join(warehouse.getWarehouseDir(), 'tools', version); }, // If you're running from a git checkout, only accept 'none' and @@ -100,18 +100,18 @@ var warehouse = module.exports = { return linkText.replace(/\.release\.json$/, ''); }, - _latestEngineSymlinkPath: function () { - return path.join(warehouse.getWarehouseDir(), 'engines', 'latest'); + _latestToolsSymlinkPath: function () { + return path.join(warehouse.getWarehouseDir(), 'tools', 'latest'); }, - // Look in the warehouse for the latest engine version. (This is the one that + // Look in the warehouse for the latest tools version. (This is the one that // the meteor shell script runs initially). If the symlink doesn't exist // (which shouldn't happen, since it is provided in the bootstrap tarball) // returns null. - latestEngine: function() { - var latestEngineSymlink = warehouse._latestEngineSymlinkPath(); + latestTools: function() { + var latestToolsSymlink = warehouse._latestToolsSymlinkPath(); try { - return fs.readlinkSync(latestEngineSymlink); + return fs.readlinkSync(latestToolsSymlink); } catch (e) { return null; } @@ -134,11 +134,11 @@ var warehouse = module.exports = { warehouse._populateWarehouseForRelease(releaseName, background); var latestReleaseManifest = warehouse.releaseManifestByVersion(releaseName); - // First, make sure the latest engine symlink reflects the latest installed + // First, make sure the latest tools symlink reflects the latest installed // release. - if (latestReleaseManifest.engine !== warehouse.latestEngine()) { - symlinkOverSync(latestReleaseManifest.engine, - warehouse._latestEngineSymlinkPath()); + if (latestReleaseManifest.tools !== warehouse.latestTools()) { + symlinkOverSync(latestReleaseManifest.tools, + warehouse._latestToolsSymlinkPath()); } var storedLatestRelease = warehouse.latestRelease(); @@ -158,8 +158,8 @@ var warehouse = module.exports = { path.join(warehouse.getWarehouseDir(), 'packages', name, version, 'package.js')); }, - engineExistsInWarehouse: function (version) { - return fs.existsSync(warehouse.getEngineDir(version)); + toolsExistsInWarehouse: function (version) { + return fs.existsSync(warehouse.getToolsDir(version)); }, // fetches the manifest file for the given release version. also fetches @@ -206,31 +206,31 @@ var warehouse = module.exports = { // no changelog, proceed } - // populate warehouse with engine version for this release - var engineVersion = releaseManifest.engine; - if (!warehouse.engineExistsInWarehouse(engineVersion)) { + // populate warehouse with tools version for this release + var toolsVersion = releaseManifest.tools; + if (!warehouse.toolsExistsInWarehouse(toolsVersion)) { try { // XXX this sucks. We store all the tarballs in memory. This is huge. // We should instead stream packages in parallel. Since the node stream // API is in flux, we should probably wait a bit. // http://blog.nodejs.org/2012/12/20/streams2/ - var engineTarballFilename = - "meteor-engine-" + releaseManifest.engine + "-" + + var toolsTarballFilename = + "meteor-tools-" + releaseManifest.tools + "-" + warehouse._unameAndArch() + ".tar.gz"; - var engineTarballPath = "/engines/" + releaseManifest.engine + "/" - + engineTarballFilename; + var toolsTarballPath = "/tools/" + releaseManifest.tools + "/" + + toolsTarballFilename; if (!background) - console.log("Fetching Meteor Engine " + engineVersion + "..."); - var engineTarball = files.getUrl({ - url: PACKAGES_URLBASE + engineTarballPath, + console.log("Fetching Meteor Tools " + toolsVersion + "..."); + var toolsTarball = files.getUrl({ + url: PACKAGES_URLBASE + toolsTarballPath, encoding: null }); - files.extractTarGz(engineTarball, - warehouse.getEngineDir(engineVersion)); + files.extractTarGz(toolsTarball, + warehouse.getToolsDir(toolsVersion)); } catch (e) { if (!background) - console.error("Failed to load engine for release " + releaseVersion); + console.error("Failed to load tools for release " + releaseVersion); throw e; } }