Commit graph

20 commits

Author SHA1 Message Date
Todd Gamblin
3118647802
Update copyright year to 2024 (#41919)
It was time to run `spack license update-copyright-year` again.
2024-01-02 09:21:30 +01:00
Harmen Stoppels
fce95e2efb
license year bump (#34921)
* license bump year
* fix black issues of modified files
* mypy
* fix 2021 -> 2023
2023-01-18 14:30:17 -08:00
Tamara Dahlgren
6f25e5242e
Docs: Updated copyrights in files still using 2020 as ending year (#23215) 2021-04-22 22:23:09 -07:00
Todd Gamblin
aebf20ebdc sbang: vendor sbang
`sbang` now lives at https://github.com/spack/sbang, and it has its own
test suite that's more extensive than what's in Spack. We'll leave sbang
tests to sbang from now on, and just vendor `bin/sbang` directly.
Remaining `sbang` tests have to do with patching files, not with
`sbang`'s functionality.

This update also fixes a bug with `sbang` and multiple command line
arguments that was introduced in #19529. See:
  * https://github.com/spack/sbang/pull/1
  * https://github.com/spack/sbang/pull/2

- [x] include latest `sbang` from https://github.com/spack/sbang
- [x] remove old `sbang` tests from Spack
- [x] update `COPYRIGHT` and `cmd/license.py`
2020-10-28 17:43:23 -07:00
Todd Gamblin
ec9456feb8 sbang: convert sbang script to POSIX shell
`sbang` was previously a bash script but did not need to be. This
converts it to a plain old POSIX shell script and adds some options. This
also allows us to simplify sbang shebangs to `#!/bin/sh /path/to/sbang`
instead of `#!/bin/bash /path/to/sbang`.

The new script passes shellcheck (with a few exceptions noted in the file)

- [x] `SBANG_DEBUG` env var enables printing what *would* be executed
- [x] `sbang` checks whether it has been passed an option and fails gracefully
- [x] `sbang` will now fail if it can't find a second shebang line, or if
      the second line happens to be sbang (avoid infinite loops)
- [x] add more rigorous tests for `sbang` behavior using `SBANG_DEBUG`
2020-10-27 13:59:46 -07:00
Toyohisa Kameyama
bb00b1a7c9
sbang: add support for php (#18299)
PHP supports an initial shebang, but its comment syntax can't handle our 2-line
shebangs. So, we need to embed the 2nd-line shebang comment to look like a
PHP comment:

    <?php #!/path/to/php ?>

This adds patching support to the sbang hook and support for
instrumenting php shebangs.

This also patches `phar`, which is a tool used to create php packages.
`phar` itself has to add sbangs to those packages (as phar archives
apparently contain UTF-8, as well as binary blobs), and `phar` sets a
checksum based on the contents of the package.

Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2020-10-26 22:11:43 -07:00
Michael Kuhn
95ddd3d6f2 sbang: Fix perl binary detection
The perl binary can also be called `perlX.Y.Z` if using a development
build or simply using the versioned binary.

We were also dropping all sbang arguments, since `exec $interpreter_v`
was only using the first element of the `interpreter_v` array.
2020-01-24 17:06:51 -08:00
Todd Gamblin
4af6303086
copyright: update copyright dates for 2020 (#14328) 2019-12-30 22:36:56 -08:00
Todd Gamblin
6f50cd52ed copyright: update license headers for 2013-2019 copyright. 2019-01-01 00:44:28 -08:00
Todd Gamblin
eea786f4e8 relicense: replace LGPL headers with Apache-2.0/MIT SPDX headers
- remove the old LGPL license headers from all files in Spack
- add SPDX headers to all files
  - core and most packages are (Apache-2.0 OR MIT)
  - a very small number of remaining packages are LGPL-2.1-only
2018-10-17 14:42:06 -07:00
Todd Gamblin
54f97d1dec
Update copyright on LLNL files for 2018. (#7592) 2018-03-24 12:13:52 -07:00
Todd Gamblin
05fa302655
Replace github.com/llnl/spack with github.com/spack/spack (#6142)
We moved to a new GitHub org! Now make the code and docs reflect that.
2017-11-04 17:08:04 -07:00
Michael Kuhn
84ae7872d3 Update copyright notices for 2017 (#5295) 2017-09-06 17:44:16 -10:00
healther
d6d2dff324 sbang support: add node-js and fix lua
This adds sbang hook support for node-js and fixes the sbang filter
for lua (the character class exclusion was swallowing newlines and
reporting a false positive if lua was mentioned anywhere in the 
file).
2017-08-18 11:57:52 -07:00
Todd Gamblin
cac4362f64 Make LICENSE recognizable by GitHub. (#4598) 2017-06-24 22:22:55 -07:00
Luigi Calori
daa5cf7e73 fix intltool_sbang issue #4191 (#4192)
* fix intltool_sbang issue #4191

* add per dep even if already depending on perl-xml-parser

* adding more comment, properly spaced
2017-06-14 13:24:01 -05:00
Eric
025b779a30 Fix sbang for perl (#1802)
* Perform shebang fix for all files

* Fix sbang for perl scripts

Otherwise perl would look at the #! line and call sbang again, resulting
in an infinite loop.
2016-09-22 00:43:47 -07:00
Todd Gamblin
27e9bc6d02 Make sbang handle lua
- use --! instead of #! for patched lua scripts.
2016-06-23 00:03:23 -07:00
Todd Gamblin
e7ced54369 Correct LLNL LGPL license template for clarity. 2016-05-11 21:22:25 -07:00
Todd Gamblin
fc6aa7374a Fix #104, #54: issues with overlong shebang in deep directories.
This does several things:

- Add `sbang`: a script to run scripts with long shebang lines.
  - Documentation for `sbang` is in `bin/sbang`.

- Add an `sbang` hook that filters the `bin` directory after install
  and modifies any scripts wtih shebangs that are too long to use
  `sbang` instead.

- `sbang` is at the top level, so it should be runnable (not much we
  can do if spack itself is too deep for shebang)
  - `sbang`, when used as the interpreter, runs the *second* shebang
    line it finds in a script.
  - shoud fix issues with too long shebang paths.
2016-03-05 04:18:48 -08:00