Merge pull request #1200 from glennpj/lowpackname
Have ``spack create`` default to lower case name for package
This commit is contained in:
commit
c086ccdab6
@ -36,10 +36,11 @@ Creating & editing packages
|
|||||||
``spack create``
|
``spack create``
|
||||||
~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
The ``spack create`` command generates a boilerplate package template
|
The ``spack create`` command creates a directory with the package name and
|
||||||
from a URL. The URL should point to a tarball or other software
|
generates a ``package.py`` file with a boilerplate package template from a URL.
|
||||||
archive. In most cases, ``spack create`` plus a few modifications is
|
The URL should point to a tarball or other software archive. In most cases,
|
||||||
all you need to get a package working.
|
``spack create`` plus a few modifications is all you need to get a package
|
||||||
|
working.
|
||||||
|
|
||||||
Here's an example:
|
Here's an example:
|
||||||
|
|
||||||
@ -47,12 +48,16 @@ Here's an example:
|
|||||||
|
|
||||||
$ spack create http://www.cmake.org/files/v2.8/cmake-2.8.12.1.tar.gz
|
$ spack create http://www.cmake.org/files/v2.8/cmake-2.8.12.1.tar.gz
|
||||||
|
|
||||||
Spack examines the tarball URL and tries to figure out the name of the
|
Spack examines the tarball URL and tries to figure out the name of the package
|
||||||
package to be created. It also tries to determine what version strings
|
to be created. Once the name is determined a directory in the appropriate
|
||||||
look like for this package. Using this information, it will try to
|
repository is created with that name. Spack prefers, but does not require, that
|
||||||
find *additional* versions by spidering the package's webpage. If it
|
names be lower case so the directory name will be lower case when ``spack
|
||||||
finds multiple versions, Spack prompts you to tell it how many
|
create`` generates it. In cases where it is desired to have mixed case or upper
|
||||||
versions you want to download and checksum:
|
case simply rename the directory. Spack also tries to determine what version
|
||||||
|
strings look like for this package. Using this information, it will try to find
|
||||||
|
*additional* versions by spidering the package's webpage. If it finds multiple
|
||||||
|
versions, Spack prompts you to tell it how many versions you want to download
|
||||||
|
and checksum:
|
||||||
|
|
||||||
.. code-block:: sh
|
.. code-block:: sh
|
||||||
|
|
||||||
@ -297,9 +302,10 @@ directories or files (like patches) that it needs to build.
|
|||||||
Package Names
|
Package Names
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Packages are named after the directory containing ``package.py``. So,
|
Packages are named after the directory containing ``package.py``. It is
|
||||||
``libelf``'s ``package.py`` lives in a directory called ``libelf``.
|
preferred, but not required, that the directory, and thus the package name, are
|
||||||
The ``package.py`` file defines a class called ``Libelf``, which
|
lower case. So, ``libelf``'s ``package.py`` lives in a directory called
|
||||||
|
``libelf``. The ``package.py`` file defines a class called ``Libelf``, which
|
||||||
extends Spack's ``Package`` class. for example, here is
|
extends Spack's ``Package`` class. for example, here is
|
||||||
``$SPACK_ROOT/var/spack/repos/builtin/packages/libelf/package.py``:
|
``$SPACK_ROOT/var/spack/repos/builtin/packages/libelf/package.py``:
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ def create(parser, args):
|
|||||||
# Figure out a name and repo for the package.
|
# Figure out a name and repo for the package.
|
||||||
name, version = guess_name_and_version(url, args)
|
name, version = guess_name_and_version(url, args)
|
||||||
spec = Spec(name)
|
spec = Spec(name)
|
||||||
name = spec.name # factors out namespace, if any
|
name = spec.name.lower() # factors out namespace, if any
|
||||||
repo = find_repository(spec, args)
|
repo = find_repository(spec, args)
|
||||||
|
|
||||||
tty.msg("This looks like a URL for %s version %s" % (name, version))
|
tty.msg("This looks like a URL for %s version %s" % (name, version))
|
||||||
|
Loading…
Reference in New Issue
Block a user