From 3e4272cf144fe115d76eb64b189c5c38b8ebc7b6 Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Thu, 4 Jun 2015 12:13:44 +0200 Subject: [PATCH] rename bootstrap to update --- .gitignore | 2 +- doc/about.rst | 4 ++-- doc/bootstrap.rst | 8 ++++---- doc/cmakelists.rst | 6 +++--- doc/customizing-modules.rst | 4 ++-- doc/index.rst | 2 +- doc/updating-modules.rst | 6 +++--- test/test.py | 12 ++++++------ bootstrap.py => update.py | 14 +++++++------- 9 files changed, 29 insertions(+), 29 deletions(-) rename bootstrap.py => update.py (96%) diff --git a/.gitignore b/.gitignore index 547953c..ed57d16 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/doc/about.rst b/doc/about.rst index 0ae1e45..85089a8 100644 --- a/doc/about.rst +++ b/doc/about.rst @@ -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) | diff --git a/doc/bootstrap.rst b/doc/bootstrap.rst index 612d60d..4032824 100644 --- a/doc/bootstrap.rst +++ b/doc/bootstrap.rst @@ -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 diff --git a/doc/cmakelists.rst b/doc/cmakelists.rst index dfc8f26..a573ea0 100644 --- a/doc/cmakelists.rst +++ b/doc/cmakelists.rst @@ -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 diff --git a/doc/customizing-modules.rst b/doc/customizing-modules.rst index 6bb2323..ced194c 100644 --- a/doc/customizing-modules.rst +++ b/doc/customizing-modules.rst @@ -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 diff --git a/doc/index.rst b/doc/index.rst index b480cda..f196ed6 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -7,7 +7,7 @@ Autocmake :maxdepth: 2 about.rst - bootstrap.rst + update.rst cmakelists.rst customizing-modules.rst updating-modules.rst diff --git a/doc/updating-modules.rst b/doc/updating-modules.rst index 55a4200..cbb1254 100644 --- a/doc/updating-modules.rst +++ b/doc/updating-modules.rst @@ -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. diff --git a/test/test.py b/test/test.py index f9648d2..ef5bfc0 100644 --- a/test/test.py +++ b/test/test.py @@ -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')) diff --git a/bootstrap.py b/update.py similarity index 96% rename from bootstrap.py rename to update.py index 191c13d..cc42036 100755 --- a/bootstrap.py +++ b/update.py @@ -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 \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)