diff options
author | rillig <rillig@pkgsrc.org> | 2019-10-06 12:50:23 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2019-10-06 12:50:23 +0000 |
commit | b9120fbaa985dc28a127d6f66d7c7b37fdd5cf4e (patch) | |
tree | c9aa04e8c0fdbb6cfe3a419bb8dcab8e9688002b /pkgtools/url2pkg/files | |
parent | 08c17955088409c8e8be7729a908db28cb25c524 (diff) | |
download | pkgsrc-b9120fbaa985dc28a127d6f66d7c7b37fdd5cf4e.tar.gz |
pkgtools/url2pkg: refer to R2pkg for creating R packages
Diffstat (limited to 'pkgtools/url2pkg/files')
-rw-r--r-- | pkgtools/url2pkg/files/url2pkg.py | 5 | ||||
-rw-r--r-- | pkgtools/url2pkg/files/url2pkg_test.py | 13 |
2 files changed, 16 insertions, 2 deletions
diff --git a/pkgtools/url2pkg/files/url2pkg.py b/pkgtools/url2pkg/files/url2pkg.py index 6c58417b168..9de0bdbf70a 100644 --- a/pkgtools/url2pkg/files/url2pkg.py +++ b/pkgtools/url2pkg/files/url2pkg.py @@ -1,5 +1,5 @@ #! @PYTHONBIN@ -# $NetBSD: url2pkg.py,v 1.17 2019/10/06 08:24:18 rillig Exp $ +# $NetBSD: url2pkg.py,v 1.18 2019/10/06 12:50:23 rillig Exp $ # Copyright (c) 2019 The NetBSD Foundation, Inc. # All rights reserved. @@ -290,6 +290,9 @@ class Generator: else: self.homepage = self.url[:-len(self.distfile)] + ' # TODO: check' + if varname == 'MASTER_SITE_R_CRAN': + sys.exit('url2pkg: to create R packages, use pkgtools/R2pkg instead') + def adjust_site_SourceForge(self): pattern = r'''(?x) ^ diff --git a/pkgtools/url2pkg/files/url2pkg_test.py b/pkgtools/url2pkg/files/url2pkg_test.py index 1d577e59cbb..3c06fe8ee37 100644 --- a/pkgtools/url2pkg/files/url2pkg_test.py +++ b/pkgtools/url2pkg/files/url2pkg_test.py @@ -1,4 +1,4 @@ -# $NetBSD: url2pkg_test.py,v 1.16 2019/10/06 08:24:18 rillig Exp $ +# $NetBSD: url2pkg_test.py,v 1.17 2019/10/06 12:50:23 rillig Exp $ import pytest from url2pkg import * @@ -533,6 +533,17 @@ def test_Generator_adjust_site_from_sites_mk__GNU(): ] +def test_Generator_adjust_site_from_sites_mk__R(tmp_path: Path): + up.pkgdir = tmp_path + url = 'http://cran.r-project.org/src/contrib/forecast_8.7.tar.gz' + generator = Generator(url) + + with pytest.raises(SystemExit, match='^url2pkg: to create R packages, use pkgtools/R2pkg instead$'): + generator.generate_Makefile() + + assert list(tmp_path.glob('*')) == [] + + def test_Generator_adjust_site_other__malformed_URL(): # This error is supposed to be handled by the URL check in main. |