diff options
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin.mock/packages/old-sbang/package.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/old-sbang/package.py b/var/spack/repos/builtin.mock/packages/old-sbang/package.py new file mode 100644 index 0000000000..3308f91611 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/old-sbang/package.py @@ -0,0 +1,35 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +from spack import * + + +class OldSbang(Package): + """Toy package for testing the old sbang replacement problem""" + + homepage = "https://www.example.com" + url = "https://www.example.com/old-sbang.tar.gz" + + version('1.0.0', '0123456789abcdef0123456789abcdef') + + def install(self, spec, prefix): + mkdirp(prefix.bin) + + sbang_style_1 = '''#!/bin/bash {0}/bin/sbang +#!/usr/bin/env python + +{1} + '''.format(spack.paths.prefix, prefix.bin) + sbang_style_2 = '''#!/bin/sh {0}/bin/sbang +#!/usr/bin/env python + +{1} + '''.format(spack.store.unpadded_root, prefix.bin) + with open('%s/sbang-style-1.sh' % self.prefix.bin, 'w') as f: + f.write(sbang_style_1) + + with open('%s/sbang-style-2.sh' % self.prefix.bin, 'w') as f: + f.write(sbang_style_2) |