pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint Updated pkglint to 5.4.17.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6e225f2c23d1
branches:  trunk
changeset: 357346:6e225f2c23d1
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Wed Jan 18 23:05:43 2017 +0000

description:
Updated pkglint to 5.4.17.

Changes since 5.4.16:

* allow multiple definitions for MASTER_SITES in the package Makefile,
  without triggering a warning about wrong ordering.
  See https://mail-index.netbsd.org/tech-pkg/2017/01/18/msg017698.html

diffstat:

 pkgtools/pkglint/Makefile                 |   4 ++--
 pkgtools/pkglint/files/globaldata_test.go |  22 ++++++++++++++++++++++
 pkgtools/pkglint/files/package.go         |   2 +-
 pkgtools/pkglint/files/package_test.go    |  17 +++++++++++++++++
 4 files changed, 42 insertions(+), 3 deletions(-)

diffs (80 lines):

diff -r 40f85819927d -r 6e225f2c23d1 pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Wed Jan 18 21:10:51 2017 +0000
+++ b/pkgtools/pkglint/Makefile Wed Jan 18 23:05:43 2017 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.509 2017/01/17 22:37:27 rillig Exp $
+# $NetBSD: Makefile,v 1.510 2017/01/18 23:05:43 rillig Exp $
 
-PKGNAME=       pkglint-5.4.16
+PKGNAME=       pkglint-5.4.17
 DISTFILES=     # none
 CATEGORIES=    pkgtools
 
diff -r 40f85819927d -r 6e225f2c23d1 pkgtools/pkglint/files/globaldata_test.go
--- a/pkgtools/pkglint/files/globaldata_test.go Wed Jan 18 21:10:51 2017 +0000
+++ b/pkgtools/pkglint/files/globaldata_test.go Wed Jan 18 23:05:43 2017 +0000
@@ -107,3 +107,25 @@
 
        c.Check(s.Output(), equals, "WARN: Makefile:5: Definition of USE_PERL5 is deprecated. Use USE_TOOLS+=perl or USE_TOOLS+=perl:run instead.\n")
 }
+
+// https://mail-index.netbsd.org/tech-pkg/2017/01/18/msg017698.html
+func (s *Suite) Test_GlobalData_loadDistSites(c *check.C) {
+       s.Init(c)
+       G.globalData.Pkgsrcdir = s.TmpDir()
+       s.CreateTmpFileLines("mk/fetch/sites.mk",
+               mkrcsid,
+               "",
+               "MASTER_SITE_A+= https://example.org/distfiles/";,
+               "MASTER_SITE_B+= https://b.example.org/distfiles/ \\",
+               "  https://b2.example.org/distfiles/";,
+               "MASTER_SITE_A+= https://a.example.org/distfiles/";)
+
+       G.globalData.loadDistSites()
+
+       c.Check(G.globalData.MasterSiteURLToVar["https://example.org/distfiles/";], equals, "MASTER_SITE_A")
+       c.Check(G.globalData.MasterSiteURLToVar["https://b.example.org/distfiles/";], equals, "MASTER_SITE_B")
+       c.Check(G.globalData.MasterSiteURLToVar["https://b2.example.org/distfiles/";], equals, "MASTER_SITE_B")
+       c.Check(G.globalData.MasterSiteURLToVar["https://a.example.org/distfiles/";], equals, "MASTER_SITE_A")
+       c.Check(G.globalData.MasterSiteVarToURL["MASTER_SITE_A"], equals, "https://example.org/distfiles/";)
+       c.Check(G.globalData.MasterSiteVarToURL["MASTER_SITE_B"], equals, "https://b.example.org/distfiles/";)
+}
diff -r 40f85819927d -r 6e225f2c23d1 pkgtools/pkglint/files/package.go
--- a/pkgtools/pkglint/files/package.go Wed Jan 18 21:10:51 2017 +0000
+++ b/pkgtools/pkglint/files/package.go Wed Jan 18 23:05:43 2017 +0000
@@ -616,7 +616,7 @@
                                {"PKGNAME", optional},
                                {"PKGREVISION", optional},
                                {"CATEGORIES", once},
-                               {"MASTER_SITES", optional},
+                               {"MASTER_SITES", many},
                                {"DIST_SUBDIR", optional},
                                {"EXTRACT_SUFX", optional},
                                {"DISTFILES", many},
diff -r 40f85819927d -r 6e225f2c23d1 pkgtools/pkglint/files/package_test.go
--- a/pkgtools/pkglint/files/package_test.go    Wed Jan 18 21:10:51 2017 +0000
+++ b/pkgtools/pkglint/files/package_test.go    Wed Jan 18 23:05:43 2017 +0000
@@ -47,6 +47,23 @@
                "WARN: Makefile:6: The canonical position for the required variable LICENSE is here.\n")
 }
 
+// https://mail-index.netbsd.org/tech-pkg/2017/01/18/msg017698.html
+func (s *Suite) Test_Package_ChecklinesPackageMakefileVarorder__MASTER_SITES(c *check.C) {
+       s.Init(c)
+       s.UseCommandLine("-Worder")
+       pkg := NewPackage("category/package")
+
+       pkg.ChecklinesPackageMakefileVarorder(s.NewMkLines("Makefile",
+               mkrcsid,
+               "",
+               "PKGNAME=\tpackage-1.0",
+               "CATEGORIES=\tcategory",
+               "MASTER_SITES=\thttp://example.org/";,
+               "MASTER_SITES+=\thttp://mirror.example.org/";))
+
+       c.Check(s.Output(), equals, "") // No warning that "MASTER_SITES appears too late"
+}
+
 func (s *Suite) Test_Package_getNbpart(c *check.C) {
        pkg := NewPackage("category/pkgbase")
        pkg.vardef["PKGREVISION"] = NewMkLine(NewLine("Makefile", 1, "PKGREVISION=14", nil))



Home | Main Index | Thread Index | Old Index