pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/pkglint



Module Name:    pkgsrc
Committed By:   rillig
Date:           Wed Jan 18 23:05:43 UTC 2017

Modified Files:
        pkgsrc/pkgtools/pkglint: Makefile
        pkgsrc/pkgtools/pkglint/files: globaldata_test.go package.go
            package_test.go

Log Message:
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


To generate a diff of this commit:
cvs rdiff -u -r1.509 -r1.510 pkgsrc/pkgtools/pkglint/Makefile
cvs rdiff -u -r1.9 -r1.10 pkgsrc/pkgtools/pkglint/files/globaldata_test.go
cvs rdiff -u -r1.16 -r1.17 pkgsrc/pkgtools/pkglint/files/package.go
cvs rdiff -u -r1.12 -r1.13 pkgsrc/pkgtools/pkglint/files/package_test.go

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

Modified files:

Index: pkgsrc/pkgtools/pkglint/Makefile
diff -u pkgsrc/pkgtools/pkglint/Makefile:1.509 pkgsrc/pkgtools/pkglint/Makefile:1.510
--- pkgsrc/pkgtools/pkglint/Makefile:1.509      Tue Jan 17 22:37:27 2017
+++ pkgsrc/pkgtools/pkglint/Makefile    Wed Jan 18 23:05:43 2017
@@ -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
 

Index: pkgsrc/pkgtools/pkglint/files/globaldata_test.go
diff -u pkgsrc/pkgtools/pkglint/files/globaldata_test.go:1.9 pkgsrc/pkgtools/pkglint/files/globaldata_test.go:1.10
--- pkgsrc/pkgtools/pkglint/files/globaldata_test.go:1.9        Tue Jan 17 22:37:27 2017
+++ pkgsrc/pkgtools/pkglint/files/globaldata_test.go    Wed Jan 18 23:05:43 2017
@@ -107,3 +107,25 @@ func (s *Suite) Test_GlobalData_deprecat
 
        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/";)
+}

Index: pkgsrc/pkgtools/pkglint/files/package.go
diff -u pkgsrc/pkgtools/pkglint/files/package.go:1.16 pkgsrc/pkgtools/pkglint/files/package.go:1.17
--- pkgsrc/pkgtools/pkglint/files/package.go:1.16       Tue Jan 17 22:37:27 2017
+++ pkgsrc/pkgtools/pkglint/files/package.go    Wed Jan 18 23:05:43 2017
@@ -616,7 +616,7 @@ func (pkg *Package) ChecklinesPackageMak
                                {"PKGNAME", optional},
                                {"PKGREVISION", optional},
                                {"CATEGORIES", once},
-                               {"MASTER_SITES", optional},
+                               {"MASTER_SITES", many},
                                {"DIST_SUBDIR", optional},
                                {"EXTRACT_SUFX", optional},
                                {"DISTFILES", many},

Index: pkgsrc/pkgtools/pkglint/files/package_test.go
diff -u pkgsrc/pkgtools/pkglint/files/package_test.go:1.12 pkgsrc/pkgtools/pkglint/files/package_test.go:1.13
--- pkgsrc/pkgtools/pkglint/files/package_test.go:1.12  Tue Dec 13 00:58:07 2016
+++ pkgsrc/pkgtools/pkglint/files/package_test.go       Wed Jan 18 23:05:43 2017
@@ -47,6 +47,23 @@ func (s *Suite) Test_Package_ChecklinesP
                "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