pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/lintpkgsrc/files



Module Name:    pkgsrc
Committed By:   rillig
Date:           Thu Aug  4 06:02:41 UTC 2022

Modified Files:
        pkgsrc/pkgtools/lintpkgsrc/files: lintpkgsrc.pl
        pkgsrc/pkgtools/lintpkgsrc/files/t: packages.t

Log Message:
lintpkgsrc: fix storing of package variables in the cache

Broken since lintpkgsrc.pl 1.44 from yesterday. All package variables
were stored as empty strings instead of their actual values.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl
cvs rdiff -u -r1.6 -r1.7 pkgsrc/pkgtools/lintpkgsrc/files/t/packages.t

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

Modified files:

Index: pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl
diff -u pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.53 pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.54
--- pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.53 Thu Aug  4 05:50:54 2022
+++ pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl      Thu Aug  4 06:02:41 2022
@@ -1,6 +1,6 @@
 #!@PERL5@
 
-# $NetBSD: lintpkgsrc.pl,v 1.53 2022/08/04 05:50:54 rillig Exp $
+# $NetBSD: lintpkgsrc.pl,v 1.54 2022/08/04 06:02:41 rillig Exp $
 
 # Written by David Brownlee <abs%netbsd.org@localhost>.
 #
@@ -82,7 +82,7 @@ sub store($) {
        printf("package\t%s\t%s\n", $name, $ver);
 
        foreach my $varname (sort $self->vars) {
-               my $value = $self->{$varname};
+               my $value = $self->var($varname);
                $varname =~ /\s/ and die "cannot store variable name '$varname'\n";
                $value =~ /\n/ and die "cannot store variable value '$value'\n";
                printf("var\t%s\t%s\n", $varname, $value);

Index: pkgsrc/pkgtools/lintpkgsrc/files/t/packages.t
diff -u pkgsrc/pkgtools/lintpkgsrc/files/t/packages.t:1.6 pkgsrc/pkgtools/lintpkgsrc/files/t/packages.t:1.7
--- pkgsrc/pkgtools/lintpkgsrc/files/t/packages.t:1.6   Wed Aug  3 20:14:16 2022
+++ pkgsrc/pkgtools/lintpkgsrc/files/t/packages.t       Thu Aug  4 06:02:41 2022
@@ -1,4 +1,4 @@
-# $NetBSD: packages.t,v 1.6 2022/08/03 20:14:16 rillig Exp $
+# $NetBSD: packages.t,v 1.7 2022/08/04 06:02:41 rillig Exp $
 
 use strict;
 use warnings;
@@ -53,6 +53,14 @@ sub test_store_order() {
        my $pkgbase_1_3nb4 = $pkglist->add('pkgbase', '1.3nb4');
        my $pkgbase_1_15 = $pkglist->add('pkgbase', '1.15');
 
+       # Ensure that variables are stored in alphabetical order.
+       $pkgbase_1_0->var('COMMENT', 'Version 1');
+       $pkgbase_1_0->var('HOMEPAGE', 'https://example.org/pkgbase');
+       $pkgbase_1_0->var('MAINTAINER', 'pkgsrc-users%NetBSD.org@localhost');
+       $pkgbase_1_0->var('LICENSE', 'modified-bsd');
+
+       $pkgbase_1_15->var('COMMENT', 'Version 1.15');
+
        my $stdout = capture {
                $pkglist->store();
        };
@@ -61,7 +69,12 @@ sub test_store_order() {
        # On the other hand, this is just an internal cache file format.
        ok($stdout, ''
            . "package\tpkgbase\t1.0\n"
+           . "var\tCOMMENT\tVersion 1\n"
+           . "var\tHOMEPAGE\thttps://example.org/pkgbase\n";
+           . "var\tLICENSE\tmodified-bsd\n"
+           . "var\tMAINTAINER\tpkgsrc-users\@NetBSD.org\n"
            . "package\tpkgbase\t1.15\n"
+           . "var\tCOMMENT\tVersion 1.15\n"
            . "package\tpkgbase\t1.3nb4\n");
 }
 



Home | Main Index | Thread Index | Old Index