pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/pkgtools/url2pkg/files



Module Name:    pkgsrc
Committed By:   rillig
Date:           Sun Oct  6 12:50:23 UTC 2019

Modified Files:
        pkgsrc/pkgtools/url2pkg/files: url2pkg.py url2pkg_test.py

Log Message:
pkgtools/url2pkg: refer to R2pkg for creating R packages


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 pkgsrc/pkgtools/url2pkg/files/url2pkg.py
cvs rdiff -u -r1.16 -r1.17 pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/pkgtools/url2pkg/files/url2pkg.py
diff -u pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.17 pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.18
--- pkgsrc/pkgtools/url2pkg/files/url2pkg.py:1.17       Sun Oct  6 08:24:18 2019
+++ pkgsrc/pkgtools/url2pkg/files/url2pkg.py    Sun Oct  6 12:50:23 2019
@@ -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)
             ^

Index: pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py
diff -u pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.16 pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.17
--- pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.16  Sun Oct  6 08:24:18 2019
+++ pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py       Sun Oct  6 12:50:23 2019
@@ -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_site
     ]
 
 
+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