pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools/lintpkgsrc/files lintpkgsrc: fix storing of p...
details: https://anonhg.NetBSD.org/pkgsrc/rev/accdfaac77d8
branches: trunk
changeset: 382737:accdfaac77d8
user: rillig <rillig%pkgsrc.org@localhost>
date: Thu Aug 04 06:02:41 2022 +0000
description:
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.
diffstat:
pkgtools/lintpkgsrc/files/lintpkgsrc.pl | 4 ++--
pkgtools/lintpkgsrc/files/t/packages.t | 15 ++++++++++++++-
2 files changed, 16 insertions(+), 3 deletions(-)
diffs (57 lines):
diff -r d177d0f2476c -r accdfaac77d8 pkgtools/lintpkgsrc/files/lintpkgsrc.pl
--- a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl Thu Aug 04 05:50:54 2022 +0000
+++ b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl Thu Aug 04 06:02:41 2022 +0000
@@ -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 @@
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);
diff -r d177d0f2476c -r accdfaac77d8 pkgtools/lintpkgsrc/files/t/packages.t
--- a/pkgtools/lintpkgsrc/files/t/packages.t Thu Aug 04 05:50:54 2022 +0000
+++ b/pkgtools/lintpkgsrc/files/t/packages.t Thu Aug 04 06:02:41 2022 +0000
@@ -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 @@
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 @@
# 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