rename bootstrap to update

This commit is contained in:
Radovan Bast 2015-06-04 12:13:44 +02:00
parent 457c8a64b2
commit 3e4272cf14
9 changed files with 29 additions and 29 deletions

2
.gitignore vendored
View File

@ -4,7 +4,7 @@ __pycache__/
# generated by unit tests
test/*/CMakeLists.txt
test/*/build/
test/*/cmake/bootstrap.py*
test/*/cmake/update.py*
test/*/cmake/lib/
test/*/cmake/modules/
test/*/setup.py

View File

@ -9,13 +9,13 @@ Autocmake assembles CMake modules, generates ``CMakeLists.txt`` as well as
``setup.py``, which serves as a front-end to ``CMakeLists.txt``. All this is
done based on a lightweight ``autocmake.cfg`` file::
bootstrap.py --update
update.py --self
|
| fetches Autocmake infrastructure
v
autocmake.cfg
|
| bootstrap.py
| update.py
v
CMakeLists.txt (and setup.py front-end)
|

View File

@ -3,19 +3,19 @@
Bootstrapping a new project
===========================
Download the ``bootstrap.py`` and execute it to fetch other infrastructure files
Download the ``update.py`` and execute it to fetch other infrastructure files
which will be needed to build the project::
mkdir cmake # does not have to be called "cmake" - take the name you prefer
cd cmake
wget https://github.com/scisoft/autocmake/raw/master/bootstrap.py
python bootstrap.py --update
wget https://github.com/scisoft/autocmake/raw/master/update.py
python update.py --self
This creates (or updates) the following files (an existing ``autocmake.cfg`` is
not overwritten by the script)::
cmake/
bootstrap.py # no need to edit
update.py # no need to edit
autocmake.cfg # edit this file
lib/
config.py # no need to edit

View File

@ -3,16 +3,16 @@
Generating the CMake infrastructure
===================================
Edit ``autocmake.cfg`` and run the ``bootstrap.py`` script which
Edit ``autocmake.cfg`` and run the ``update.py`` script which
creates ``CMakeLists.txt`` and ``setup.py`` in the build path::
python bootstrap.py ..
python update.py ..
The script also copies or downloads CMake modules specified in ``autocmake.cfg`` to a directory
called ``modules/``::
cmake/
bootstrap.py
update.py
autocmake.cfg
lib/
config.py

View File

@ -3,7 +3,7 @@
Customizing CMake modules
=========================
The ``boostrap.py`` script assembles modules listed in ``autocmake.cfg`` and
The ``update.py`` script assembles modules listed in ``autocmake.cfg`` and
places them inside ``modules/``. You have at least four options to customize
CMake modules:
@ -13,7 +13,7 @@ Directly inside the generated modules directory
The CMake modules can be customized directly inside ``modules/`` but this is
the least elegant solution since the customizations may be overwritten by the
``boostrap.py`` script (use version control).
``update.py`` script (use version control).
Adapt local copies of CMake modules

View File

@ -7,7 +7,7 @@ Autocmake
:maxdepth: 2
about.rst
bootstrap.rst
update.rst
cmakelists.rst
customizing-modules.rst
updating-modules.rst

View File

@ -3,13 +3,13 @@
Updating CMake modules
======================
To update CMake modules you need to run the ``boostrap.py`` script::
To update CMake modules you need to run the ``update.py`` script::
cd cmake
python bootstrap.py ..
python update.py ..
The CMake modules are not fetched or updated at configure time or build time.
In other words, if you never re-run ``boostrap.py`` script and never modify the
In other words, if you never re-run ``update.py`` script and never modify the
CMake module files, then the CMake modules will remain forever frozen.

View File

@ -15,9 +15,9 @@ def exe(command):
def test_cxx():
os.chdir(os.path.join(HERE, 'cxx', 'cmake'))
stdout, stderr = exe('wget https://github.com/scisoft/autocmake/raw/master/bootstrap.py')
stdout, stderr = exe('python bootstrap.py --update')
stdout, stderr = exe('python bootstrap.py ..')
stdout, stderr = exe('wget https://github.com/scisoft/autocmake/raw/master/update.py')
stdout, stderr = exe('python update.py --self')
stdout, stderr = exe('python update.py ..')
os.chdir(os.path.join(HERE, 'cxx'))
stdout, stderr = exe('python setup.py --cxx=g++')
os.chdir(os.path.join(HERE, 'cxx', 'build'))
@ -29,9 +29,9 @@ def test_cxx():
def test_fortran():
os.chdir(os.path.join(HERE, 'fortran', 'cmake'))
stdout, stderr = exe('wget https://github.com/scisoft/autocmake/raw/master/bootstrap.py')
stdout, stderr = exe('python bootstrap.py --update')
stdout, stderr = exe('python bootstrap.py ..')
stdout, stderr = exe('wget https://github.com/scisoft/autocmake/raw/master/update.py')
stdout, stderr = exe('python update.py --self')
stdout, stderr = exe('python update.py ..')
os.chdir(os.path.join(HERE, 'fortran'))
stdout, stderr = exe('python setup.py --fc=gfortran')
os.chdir(os.path.join(HERE, 'fortran', 'build'))

View File

@ -265,18 +265,18 @@ def main(argv):
Main function.
"""
if len(argv) != 2:
sys.stderr.write("\nYou can bootstrap a project in two steps.\n\n")
sys.stderr.write("\nYou can update a project in two steps.\n\n")
sys.stderr.write("Step 1: Update or create infrastructure files\n")
sys.stderr.write(" which will be needed to configure and build the project:\n")
sys.stderr.write(" $ %s --update\n\n" % argv[0])
sys.stderr.write(" $ %s --self\n\n" % argv[0])
sys.stderr.write("Step 2: Create CMakeLists.txt and setup.py in PROJECT_ROOT:\n")
sys.stderr.write(" $ %s <PROJECT_ROOT>\n" % argv[0])
sys.stderr.write(" example:\n")
sys.stderr.write(" $ %s ..\n" % argv[0])
sys.exit(-1)
if argv[1] == '--update':
# update infrastructure files
if argv[1] == '--self':
# update self
if not os.path.isfile('autocmake.cfg'):
print('- fetching example autocmake.cfg')
fetch_url(
@ -293,10 +293,10 @@ def main(argv):
src='https://github.com/docopt/docopt/raw/master/docopt.py',
dst='lib/docopt.py'
)
print('- fetching bootstrap.py')
print('- fetching update.py')
fetch_url(
src='%s/raw/master/bootstrap.py' % AUTOCMAKE_GITHUB_URL,
dst='bootstrap.py'
src='%s/raw/master/update.py' % AUTOCMAKE_GITHUB_URL,
dst='update.py'
)
sys.exit(0)