diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2018-07-18 20:10:46 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2018-07-25 23:10:10 -0700 |
commit | 498d8cf04b6c932d8c224c7b3b9f696fd7dd3e27 (patch) | |
tree | 7efbdb612705017cf323651bad48fe534da6bec4 /var | |
parent | 5792a805fc0a3867df30f14234e62a983cb0d395 (diff) | |
download | spack-498d8cf04b6c932d8c224c7b3b9f696fd7dd3e27.tar.gz spack-498d8cf04b6c932d8c224c7b3b9f696fd7dd3e27.tar.bz2 spack-498d8cf04b6c932d8c224c7b3b9f696fd7dd3e27.tar.xz spack-498d8cf04b6c932d8c224c7b3b9f696fd7dd3e27.zip |
core: fixes and tests for handling of fetcher attributes in packages
- Packages can remove the top-level `url` attribute and still work
- These are now legal:
- Packages with *only* version-specific URLs (even with gaps)
- Packages with a top-level git/hg/svn attribute and `version`
directives for that.
- If a package has both a top-level hg/git/svn attribute AND a top-level
url attribute, the url attribute takes precedence.
Diffstat (limited to 'var')
6 files changed, 215 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/git-and-url-top-level/package.py b/var/spack/repos/builtin.mock/packages/git-and-url-top-level/package.py new file mode 100644 index 0000000000..d34c9d9b06 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/git-and-url-top-level/package.py @@ -0,0 +1,38 @@ +############################################################################## +# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/spack/spack +# Please also see the NOTICE and LICENSE files for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + + +class GitAndUrlTopLevel(Package): + """Mock package that uses git for fetching.""" + homepage = "http://www.git-fetch-example.com" + + git = 'https://example.com/some/git/repo' + url = 'https://example.com/some/tarball-1.0.tar.gz' + + version('2.0') + + def install(self, spec, prefix): + pass diff --git a/var/spack/repos/builtin.mock/packages/git-top-level/package.py b/var/spack/repos/builtin.mock/packages/git-top-level/package.py new file mode 100644 index 0000000000..5c0be81101 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/git-top-level/package.py @@ -0,0 +1,36 @@ +############################################################################## +# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/spack/spack +# Please also see the NOTICE and LICENSE files for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + + +class GitTopLevel(Package): + """Mock package that uses git for fetching.""" + homepage = "http://www.git-fetch-example.com" + + git = 'https://example.com/some/git/repo' + version('1.0') + + def install(self, spec, prefix): + pass diff --git a/var/spack/repos/builtin.mock/packages/hg-top-level/package.py b/var/spack/repos/builtin.mock/packages/hg-top-level/package.py new file mode 100644 index 0000000000..94a06cd38e --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/hg-top-level/package.py @@ -0,0 +1,36 @@ +############################################################################## +# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/spack/spack +# Please also see the NOTICE and LICENSE files for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + + +class HgTopLevel(Package): + """Test package that does fetching with mercurial.""" + homepage = "http://www.hg-fetch-example.com" + + hg = 'https://example.com/some/hg/repo' + version('1.0') + + def install(self, spec, prefix): + pass diff --git a/var/spack/repos/builtin.mock/packages/svn-top-level/package.py b/var/spack/repos/builtin.mock/packages/svn-top-level/package.py new file mode 100644 index 0000000000..3198b16435 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/svn-top-level/package.py @@ -0,0 +1,35 @@ +############################################################################## +# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/spack/spack +# Please also see the NOTICE and LICENSE files for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + + +class SvnTopLevel(Package): + """Mock package that uses svn for fetching.""" + + svn = 'https://example.com/some/svn/repo' + version('1.0') + + def install(self, spec, prefix): + pass diff --git a/var/spack/repos/builtin.mock/packages/url-only-override-with-gaps/package.py b/var/spack/repos/builtin.mock/packages/url-only-override-with-gaps/package.py new file mode 100644 index 0000000000..8bcbb386bd --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/url-only-override-with-gaps/package.py @@ -0,0 +1,37 @@ +############################################################################## +# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/spack/spack +# Please also see the NOTICE and LICENSE files for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + + +class UrlOnlyOverrideWithGaps(Package): + homepage = 'http://www.example.com' + + version('1.0.5', 'abcdef0') + version('1.0.0', 'bcdef0a', url='http://a.example.com/url_override-1.0.0.tar.gz') + version('0.9.5', 'cdef0ab') + version('0.9.0', 'def0abc', url='http://b.example.com/url_override-0.9.0.tar.gz') + version('0.8.5', 'ef0abcd') + version('0.8.1', 'f0abcde', url='http://c.example.com/url_override-0.8.1.tar.gz') + version('0.7.0', '0abcdef') diff --git a/var/spack/repos/builtin.mock/packages/url-only-override/package.py b/var/spack/repos/builtin.mock/packages/url-only-override/package.py new file mode 100644 index 0000000000..76999fb21e --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/url-only-override/package.py @@ -0,0 +1,33 @@ +############################################################################## +# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/spack/spack +# Please also see the NOTICE and LICENSE files for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + + +class UrlOnlyOverride(Package): + homepage = 'http://www.example.com' + + version('1.0.0', 'cxyzab', url='http://a.example.com/url_override-1.0.0.tar.gz') + version('0.9.0', 'bcxyza', url='http://b.example.com/url_override-0.9.0.tar.gz') + version('0.8.1', 'cxyzab', url='http://c.example.com/url_override-0.8.1.tar.gz') |