From: Brian Warner Date: Thu, 11 Oct 2007 10:38:24 +0000 (-0700) Subject: rename bin/allmydata-tahoe to bin/tahoe. Closes #155. X-Git-Tag: allmydata-tahoe-0.6.1~40 X-Git-Url: https://git.rkrishnan.org/pf/content/en/footer/about.html?a=commitdiff_plain;h=dc573554c82617a87c1737fc80d9da0d4dddb0f8;p=tahoe-lafs%2Ftahoe-lafs.git rename bin/allmydata-tahoe to bin/tahoe. Closes #155. --- diff --git a/Makefile b/Makefile index 78113636..b28f8d02 100644 --- a/Makefile +++ b/Makefile @@ -78,6 +78,9 @@ endif PP=PYTHONPATH="$(SRCPATH)$(PATHSEP)$(EGGSPATH)$(PATHSEP)$(PYTHONPATH)" .PHONY: make-version build +# N.B.: the first argument to make-version.py is used to find darcs tags that +# represent released versions, so it needs to match whatever release +# conventions are in use. make-version: $(PYTHON) misc/make-version.py "allmydata-tahoe" "src/allmydata/_version.py" @@ -87,7 +90,7 @@ make-version: build: $(PYTHON) ./setup.py build_ext -i - chmod +x bin/allmydata-tahoe + chmod +x bin/tahoe # 'make install' will do the following: # build+install tahoe (probably to /usr/lib/pythonN.N/site-packages) @@ -239,10 +242,10 @@ check-memory-once: .built check-speed: .built if [ -z '$(TESTCLIENTDIR)' ]; then exit 1; fi - $(PYTHON) bin/allmydata-tahoe start $(TESTCLIENTDIR) + $(PYTHON) bin/tahoe start $(TESTCLIENTDIR) sleep 5 $(PYTHON) src/allmydata/test/check_speed.py $(TESTCLIENTDIR) - $(PYTHON) bin/allmydata-tahoe stop $(TESTCLIENTDIR) + $(PYTHON) bin/tahoe stop $(TESTCLIENTDIR) test-darcs-boringfile: $(MAKE) diff --git a/README b/README index 4bb568e9..22a7b335 100644 --- a/README +++ b/README @@ -180,11 +180,11 @@ Running-In-Place Way, and The Debian Way. Choose one: 3. Build Tahoe by running "make". - 4. Once you've built it then you can execute "./bin/allmydata-tahoe". (When - the allmydata-tahoe script is in a Tahoe source distribution, it adds - the necessary directory to the Python "sys.path". It also looks for any - dependencies that you installed by "make build-deps" and includes them - in the sys.path.) See the RUNNING section, below. + 4. Once you've built it then you can execute "./bin/tahoe". (When the tahoe + script is in a Tahoe source distribution, it adds the necessary + directory to the Python "sys.path". It also looks for any dependencies + that you installed by "make build-deps" and includes them in the + sys.path.) See the RUNNING section, below. The Debian Way: @@ -215,15 +215,15 @@ TESTING THAT IT IS PROPERLY INSTALLED slow computers. There are a lot of tests and some of them do a lot of public-key cryptography.) - Executing the allmydata-tahoe script from the "bin" subdirectory will work - only if Tahoe itself is installed, either because it is installed into the - local subdirectory (as per "The Running-In-Place Way") or because it is - installed into your system (as per the other three ways of installing). + Executing the tahoe script from the "bin" subdirectory will work only if + Tahoe itself is installed, either because it is installed into the local + subdirectory (as per "The Running-In-Place Way") or because it is installed + into your system (as per the other three ways of installing). RUNNING: - Run the "allmydata-tahoe" executable. + Run the "tahoe" executable. If you installed "The Running-In-Place Way", then it is in your source tree, in the "bin" subdirectory thereof. If you installed in one of the other @@ -231,10 +231,10 @@ RUNNING: filesystem, perhaps in "/usr/bin" on Unix, or in "C:\Python25\Scripts" on Window. - The "allmydata-tahoe" utility is used to create, start, and stop nodes. - Each node lives in a separate base directory, inside of which you can add - files to configure and control the node. Nodes also read and write files - within that directory. + The "tahoe" utility is used to create, start, and stop nodes. Each node + lives in a separate base directory, inside of which you can add files to + configure and control the node. Nodes also read and write files within that + directory. A grid consists of a single central 'introducer and vdrive' node and one or more 'client' nodes. If you are joining an existing grid, the @@ -243,28 +243,28 @@ RUNNING: create both an introducer-and-vdrive and a client (and then invite other people to create their own client nodes and join your grid). - The introducer (-and-vdrive) node is constructed by running 'allmydata-tahoe - create-introducer --basedir $HERE'. Once constructed, you can start the - introducer by running 'allmydata-tahoe start --basedir $HERE' (or, if you - are already in the introducer's base directory, just type 'allmydata-tahoe - start'). Inside that base directory, there will be a pair of files - 'introducer.furl' and 'vdrive.furl'. Make a copy of these, as they'll be - needed on the client nodes. + The introducer (-and-vdrive) node is constructed by running 'tahoe + create-introducer --basedir $HERE'. Once constructed, you can start the + introducer by running 'tahoe start --basedir $HERE' (or, if you are already + in the introducer's base directory, just type 'tahoe start'). Inside that + base directory, there will be a pair of files 'introducer.furl' and + 'vdrive.furl'. Make a copy of these, as they'll be needed on the client + nodes. To construct a client node, pick a new working directory for it, then run - 'allmydata-tahoe create-client --basedir $HERE'. Copy the two .furl files - from the introducer into this new directory, then run 'allmydata-tahoe start - --basedir $HERE'. After that, the client node should be off and running. - The first thing it will do is connect to the introducer and introduce itself - to all other nodes on the grid. You can follow its progress by looking at - the $HERE/logs/twistd.log file. + 'tahoe create-client --basedir $HERE'. Copy the two .furl files from the + introducer into this new directory, then run 'tahoe start --basedir $HERE'. + After that, the client node should be off and running. The first thing it + will do is connect to the introducer and introduce itself to all other nodes + on the grid. You can follow its progress by looking at the + $HERE/logs/twistd.log file. To actually use the client, enable the web interface by writing a port number (like "8123") into a file named $HERE/webport and then restarting the - node with 'allmydata-tahoe restart --basedir $HERE'. This will prompt the - client node to run a webserver on the desired port, through which you can - view, upload, download, and delete files. This 'webport' file is actually a - "strports specification", defined in + node with 'tahoe restart --basedir $HERE'. This will prompt the client node + to run a webserver on the desired port, through which you can view, upload, + download, and delete files. This 'webport' file is actually a "strports + specification", defined in http://twistedmatrix.com/documents/current/api/twisted.application.strports.html , so you can have it only listen on a local interface by writing "tcp:8123:interface=127.0.0.1" to this file, or make it use SSL by writing diff --git a/Tahoe.home b/Tahoe.home index f3f4dca7..7b4a6e5f 100644 --- a/Tahoe.home +++ b/Tahoe.home @@ -1,2 +1 @@ -This file exists so the preamble in bin/allmydata-tahoe can find its source -tree. +This file exists so the preamble in bin/tahoe can find its source tree. diff --git a/bin/allmydata-tahoe b/bin/allmydata-tahoe deleted file mode 100644 index d1506430..00000000 --- a/bin/allmydata-tahoe +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python - -# This preamble is adapted from Twisted. If we're being run from a source -# tree, add that tree's libdir to our path, so tahoe can be run from source -# without a lot of tedious PYTHONPATH changes. -import sys, os.path -where = os.path.realpath(sys.argv[0]).split(os.sep) - -# look for Tahoe.home . Two cases: -# ...(not BASE)/allmydata-tahoe -# .../(BASE)/bin/allmydata-tahoe -if len(where) >= 2 and where[-2] == "bin": - base = os.sep.join(where[:-2]) - - if os.path.exists(os.path.join(base, "Tahoe.home")): - # we've found our home. Put the tahoe source at the front of sys.path - srcdir = os.path.join(base, "src") - sys.path.insert(0, srcdir) - # and put any support eggs at the end of sys.path - if sys.platform == "win32": - supportdir = os.path.join(base, "support", "Lib", "site-packages") - else: - supportdir = os.path.join(base, "support", - "lib", - "python%d.%d" % sys.version_info[:2], - "site-packages") - support_eggs = [] - if os.path.exists(supportdir): - for fn in os.listdir(supportdir): - if fn.endswith(".egg"): - support_eggs.append(os.path.join(supportdir, fn)) - - sys.path.extend(support_eggs) - - # also update PYTHONPATH so that child processes (like twistd) will - # use this too - pp = os.environ.get("PYTHONPATH") - if pp: - pp = os.pathsep.join([srcdir] + pp.split(os.pathsep) + support_eggs) - else: - pp = os.pathsep.join([srcdir] + support_eggs) - os.environ["PYTHONPATH"] = pp - -from allmydata.scripts import runner -runner.run() diff --git a/bin/tahoe b/bin/tahoe new file mode 100644 index 00000000..d1506430 --- /dev/null +++ b/bin/tahoe @@ -0,0 +1,45 @@ +#!/usr/bin/env python + +# This preamble is adapted from Twisted. If we're being run from a source +# tree, add that tree's libdir to our path, so tahoe can be run from source +# without a lot of tedious PYTHONPATH changes. +import sys, os.path +where = os.path.realpath(sys.argv[0]).split(os.sep) + +# look for Tahoe.home . Two cases: +# ...(not BASE)/allmydata-tahoe +# .../(BASE)/bin/allmydata-tahoe +if len(where) >= 2 and where[-2] == "bin": + base = os.sep.join(where[:-2]) + + if os.path.exists(os.path.join(base, "Tahoe.home")): + # we've found our home. Put the tahoe source at the front of sys.path + srcdir = os.path.join(base, "src") + sys.path.insert(0, srcdir) + # and put any support eggs at the end of sys.path + if sys.platform == "win32": + supportdir = os.path.join(base, "support", "Lib", "site-packages") + else: + supportdir = os.path.join(base, "support", + "lib", + "python%d.%d" % sys.version_info[:2], + "site-packages") + support_eggs = [] + if os.path.exists(supportdir): + for fn in os.listdir(supportdir): + if fn.endswith(".egg"): + support_eggs.append(os.path.join(supportdir, fn)) + + sys.path.extend(support_eggs) + + # also update PYTHONPATH so that child processes (like twistd) will + # use this too + pp = os.environ.get("PYTHONPATH") + if pp: + pp = os.pathsep.join([srcdir] + pp.split(os.pathsep) + support_eggs) + else: + pp = os.pathsep.join([srcdir] + support_eggs) + os.environ["PYTHONPATH"] = pp + +from allmydata.scripts import runner +runner.run() diff --git a/docs/configuration.txt b/docs/configuration.txt index afa54fde..9e329ce8 100644 --- a/docs/configuration.txt +++ b/docs/configuration.txt @@ -79,8 +79,8 @@ held while they are being received. client.tac : this file defines the client, by constructing the actual Client instance each time the node is started. It is used by the 'twistd' daemonization program (in the "-y" mode), which is run internally by the -"allmydata-tahoe start" command. This file is created by the "allmydata-tahoe -create-client" command. +"tahoe start" command. This file is created by the "tahoe create-client" +command. control.furl : this file contains a FURL that provides access to a control port on the client node, from which files can be uploaded and downloaded. diff --git a/misc/feisty/debian/rules b/misc/feisty/debian/rules index 3d669dae..a7a6d118 100644 --- a/misc/feisty/debian/rules +++ b/misc/feisty/debian/rules @@ -9,9 +9,9 @@ include /usr/share/cdbs/1/class/python-distutils.mk STAGING_DIR=$(CURDIR)/debian/allmydata-tahoe -# we overwrite the setuptools-generated /usr/bin/allmydata-tahoe with our -# package's original version, because the setuptools form (using "entry -# points") insists upon .egg-info -visible forms of dependent packages to be +# we overwrite the setuptools-generated /usr/bin/tahoe with our package's +# original version, because the setuptools form (using "entry points") +# insists upon .egg-info -visible forms of dependent packages to be # installed. For a debian package, we rely upon the dependencies that are # declared in debian/control . # @@ -23,7 +23,7 @@ STAGING_DIR=$(CURDIR)/debian/allmydata-tahoe install/allmydata-tahoe:: mkdir -pm755 $(STAGING_DIR) python setup.py install --root=$(STAGING_DIR) - cp bin/allmydata-tahoe $(STAGING_DIR)/usr/bin/ + cp bin/tahoe $(STAGING_DIR)/usr/bin/ dh_pycentral diff --git a/misc/sid/debian/rules b/misc/sid/debian/rules index 3d669dae..a7a6d118 100644 --- a/misc/sid/debian/rules +++ b/misc/sid/debian/rules @@ -9,9 +9,9 @@ include /usr/share/cdbs/1/class/python-distutils.mk STAGING_DIR=$(CURDIR)/debian/allmydata-tahoe -# we overwrite the setuptools-generated /usr/bin/allmydata-tahoe with our -# package's original version, because the setuptools form (using "entry -# points") insists upon .egg-info -visible forms of dependent packages to be +# we overwrite the setuptools-generated /usr/bin/tahoe with our package's +# original version, because the setuptools form (using "entry points") +# insists upon .egg-info -visible forms of dependent packages to be # installed. For a debian package, we rely upon the dependencies that are # declared in debian/control . # @@ -23,7 +23,7 @@ STAGING_DIR=$(CURDIR)/debian/allmydata-tahoe install/allmydata-tahoe:: mkdir -pm755 $(STAGING_DIR) python setup.py install --root=$(STAGING_DIR) - cp bin/allmydata-tahoe $(STAGING_DIR)/usr/bin/ + cp bin/tahoe $(STAGING_DIR)/usr/bin/ dh_pycentral diff --git a/setup.py b/setup.py index 27ba5aa8..f33150e8 100644 --- a/setup.py +++ b/setup.py @@ -118,7 +118,7 @@ setup(name='allmydata-tahoe', test_suite="allmydata.test", install_requires=install_requires, dependency_links=dependency_links, - entry_points = { 'console_scripts': [ 'allmydata-tahoe = allmydata.scripts.runner:run' ] }, + entry_points = { 'console_scripts': [ 'tahoe = allmydata.scripts.runner:run' ] }, ext_modules=[ Extension("allmydata.Crypto.Cipher.AES", include_dirs=["src/allmydata/Crypto"], diff --git a/src/allmydata/test/test_runner.py b/src/allmydata/test/test_runner.py index c21d6266..80ef42c1 100644 --- a/src/allmydata/test/test_runner.py +++ b/src/allmydata/test/test_runner.py @@ -172,7 +172,7 @@ class RunNode(unittest.TestCase, testutil.PollMixin): # now we can kill it. TODO: On a slow machine, the node might kill # itself before we get a chance too, especially if spawning the - # 'allmydata-tahoe stop' command takes a while. + # 'tahoe stop' command takes a while. def _stop(res): open(HOTLINE_FILE, "w").write("") self.failUnless(os.path.exists(TWISTD_PID_FILE))