pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/pkglint/files



Module Name:    pkgsrc
Committed By:   rillig
Date:           Fri Dec 21 19:46:48 UTC 2018

Modified Files:
        pkgsrc/pkgtools/pkglint/files: alternatives.go alternatives_test.go
            lines_test.go

Log Message:
pkgtools/pkglint: fix alternatives check

The alternatives implementation may have command line arguments.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 pkgsrc/pkgtools/pkglint/files/alternatives.go
cvs rdiff -u -r1.10 -r1.11 pkgsrc/pkgtools/pkglint/files/alternatives_test.go
cvs rdiff -u -r1.4 -r1.5 pkgsrc/pkgtools/pkglint/files/lines_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/files/alternatives.go
diff -u pkgsrc/pkgtools/pkglint/files/alternatives.go:1.9 pkgsrc/pkgtools/pkglint/files/alternatives.go:1.10
--- pkgsrc/pkgtools/pkglint/files/alternatives.go:1.9   Fri Dec 21 08:05:24 2018
+++ pkgsrc/pkgtools/pkglint/files/alternatives.go       Fri Dec 21 19:46:48 2018
@@ -45,7 +45,7 @@ func CheckFileAlternatives(filename stri
        }
 
        for _, line := range lines.Lines {
-               m, wrapper, space, alternative := match3(line.Text, `^([^\t ]+)([ \t]+)([^\t ]+)$`)
+               m, wrapper, space, alternative := match3(line.Text, `^([^\t ]+)([ \t]+)([^\t ]+)`)
                if !m {
                        line.Errorf("Invalid line %q.", line.Text)
                        G.Explain(

Index: pkgsrc/pkgtools/pkglint/files/alternatives_test.go
diff -u pkgsrc/pkgtools/pkglint/files/alternatives_test.go:1.10 pkgsrc/pkgtools/pkglint/files/alternatives_test.go:1.11
--- pkgsrc/pkgtools/pkglint/files/alternatives_test.go:1.10     Fri Dec 21 08:05:24 2018
+++ pkgsrc/pkgtools/pkglint/files/alternatives_test.go  Fri Dec 21 19:46:48 2018
@@ -30,7 +30,7 @@ func (s *Suite) Test_CheckFileAlternativ
                "ERROR: ALTERNATIVES:3: Alternative wrapper \"bin/echo\" must not appear in the PLIST.",
                "ERROR: ALTERNATIVES:3: Alternative implementation \"bin/gnu-echo\" must appear in the PLIST.",
                "ERROR: ALTERNATIVES:3: Alternative implementation \"bin/gnu-echo\" must be an absolute path.",
-               "ERROR: ALTERNATIVES:4: Invalid line \"bin/editor bin/vim -e\".",
+               "ERROR: ALTERNATIVES:4: Alternative implementation \"bin/vim\" must be an absolute path.",
                "ERROR: ALTERNATIVES:5: Invalid line \"invalid\".",
                "ERROR: ALTERNATIVES:6: Alternative implementation \"${PREFIX}/bin/firefox\" must appear in the PLIST.",
                "ERROR: ALTERNATIVES:6: Alternative implementation \"${PREFIX}/bin/firefox\" must be an absolute path.",
@@ -42,7 +42,8 @@ func (s *Suite) Test_CheckFileAlternativ
        G.Check(".")
 
        t.CheckOutputLines(
-               "AUTOFIX: ALTERNATIVES:3: Replacing \"bin/gnu-echo\" with \"@PREFIX@/bin/gnu-echo\".")
+               "AUTOFIX: ALTERNATIVES:3: Replacing \"bin/gnu-echo\" with \"@PREFIX@/bin/gnu-echo\".",
+               "AUTOFIX: ALTERNATIVES:4: Replacing \"bin/vim\" with \"@PREFIX@/bin/vim\".")
 }
 
 func (s *Suite) Test_CheckFileAlternatives__empty(c *check.C) {

Index: pkgsrc/pkgtools/pkglint/files/lines_test.go
diff -u pkgsrc/pkgtools/pkglint/files/lines_test.go:1.4 pkgsrc/pkgtools/pkglint/files/lines_test.go:1.5
--- pkgsrc/pkgtools/pkglint/files/lines_test.go:1.4     Fri Dec 21 08:05:24 2018
+++ pkgsrc/pkgtools/pkglint/files/lines_test.go Fri Dec 21 19:46:48 2018
@@ -57,8 +57,8 @@ func (s *Suite) Test_Lines_CheckRcsID__w
        G.Check(t.File("wip/package"))
 
        t.CheckOutputLines(
-               "AUTOFIX: ~/wip/package/file1.mk:1: Replacing \"# $NetBSD: lines_test.go,v 1.4 2018/12/21 08:05:24 rillig Exp $\" with \"# $NetBSD: lines_test.go,v 1.4 2018/12/21 08:05:24 rillig Exp 
$\".",
-               "AUTOFIX: ~/wip/package/file3.mk:1: Inserting a line \"# $NetBSD: lines_test.go,v 1.4 2018/12/21 08:05:24 rillig Exp $\" before this line.",
-               "AUTOFIX: ~/wip/package/file4.mk:1: Inserting a line \"# $NetBSD: lines_test.go,v 1.4 2018/12/21 08:05:24 rillig Exp $\" before this line.",
-               "AUTOFIX: ~/wip/package/file5.mk:1: Inserting a line \"# $NetBSD: lines_test.go,v 1.4 2018/12/21 08:05:24 rillig Exp $\" before this line.")
+               "AUTOFIX: ~/wip/package/file1.mk:1: Replacing \"# $"+"NetBSD: dummy $\" with \"# $"+"NetBSD$\".",
+               "AUTOFIX: ~/wip/package/file3.mk:1: Inserting a line \"# $"+"NetBSD$\" before this line.",
+               "AUTOFIX: ~/wip/package/file4.mk:1: Inserting a line \"# $"+"NetBSD$\" before this line.",
+               "AUTOFIX: ~/wip/package/file5.mk:1: Inserting a line \"# $"+"NetBSD$\" before this line.")
 }



Home | Main Index | Thread Index | Old Index