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 May 23 16:20:46 UTC 2021

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

Log Message:
url2pkg: add test for GitHub URL that leads to wrong DISTNAME

Reported by Brook Milligan via private mail.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 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_test.py
diff -u pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.27 pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.28
--- pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py:1.27  Sat Oct 17 22:39:01 2020
+++ pkgsrc/pkgtools/url2pkg/files/url2pkg_test.py       Sun May 23 16:20:46 2021
@@ -1,4 +1,4 @@
-# $NetBSD: url2pkg_test.py,v 1.27 2020/10/17 22:39:01 rillig Exp $
+# $NetBSD: url2pkg_test.py,v 1.28 2021/05/23 16:20:46 rillig Exp $
 
 import pytest
 from url2pkg import *
@@ -431,6 +431,32 @@ def test_Generator_adjust_site_GitHub_ar
     ]
 
 
+def test_Generator_adjust_site_GitHub_archive_tag():
+    url = 'https://github.com/org/proj/archive/refs/tags/1.0.0.tar.gz'
+
+    lines = Generator(url).generate_Makefile()
+    assert detab(lines) == [
+        mkcvsid,
+        '',
+        'GITHUB_PROJECT= proj',
+        'GITHUB_TAG=     refs/tags/1.0.0',
+        # FIXME: DISTNAME must not contain slashes
+        'DISTNAME=       refs/tags/1.0.0',
+        'PKGNAME=        ${GITHUB_PROJECT}-${DISTNAME}',
+        'CATEGORIES=     pkgtools',
+        'MASTER_SITES=   ${MASTER_SITE_GITHUB:=org/}',
+        'DIST_SUBDIR=    ${GITHUB_PROJECT}',
+        '',
+        'MAINTAINER=     INSERT_YOUR_MAIL_ADDRESS_HERE # or use pkgsrc-users%NetBSD.org@localhost',
+        'HOMEPAGE=       https://github.com/org/proj/',
+        'COMMENT=        TODO: Short description of the package',
+        '#LICENSE=       # TODO: (see mk/license.mk)',
+        '',
+        '# url2pkg-marker (please do not remove this line.)',
+        ".include \"../../mk/bsd.pkg.mk\"",
+    ]
+
+
 def test_Generator_adjust_site_GitHub_release__containing_project_name():
     url = 'https://github.com/org/proj/releases/download/1.0.0/proj.zip'
 



Home | Main Index | Thread Index | Old Index