pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools/url2pkg/files pkgtools/url2pkg: refer to R2pk...
details: https://anonhg.NetBSD.org/pkgsrc/rev/d4f778fcf1cb
branches: trunk
changeset: 340701:d4f778fcf1cb
user: rillig <rillig%pkgsrc.org@localhost>
date: Sun Oct 06 12:50:23 2019 +0000
description:
pkgtools/url2pkg: refer to R2pkg for creating R packages
diffstat:
pkgtools/url2pkg/files/url2pkg.py | 5 ++++-
pkgtools/url2pkg/files/url2pkg_test.py | 13 ++++++++++++-
2 files changed, 16 insertions(+), 2 deletions(-)
diffs (47 lines):
diff -r e874b003e72b -r d4f778fcf1cb pkgtools/url2pkg/files/url2pkg.py
--- a/pkgtools/url2pkg/files/url2pkg.py Sun Oct 06 12:43:53 2019 +0000
+++ b/pkgtools/url2pkg/files/url2pkg.py Sun Oct 06 12:50:23 2019 +0000
@@ -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 @@
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 -r e874b003e72b -r d4f778fcf1cb pkgtools/url2pkg/files/url2pkg_test.py
--- a/pkgtools/url2pkg/files/url2pkg_test.py Sun Oct 06 12:43:53 2019 +0000
+++ b/pkgtools/url2pkg/files/url2pkg_test.py Sun Oct 06 12:50:23 2019 +0000
@@ -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__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.
Home |
Main Index |
Thread Index |
Old Index