New Upstream Snapshot - libdebian-dep12-perl
Ready changes
Summary
Merged new upstream version: 0.1.0+git20210302.1.f060166 (was: 0.1.0).
Resulting package
Built on 2023-01-19T11:41 (took 3m8s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-snapshots libdebian-dep12-perl
Lintian Result
Diff
diff --git a/MANIFEST b/MANIFEST
index 8cef47b..abafbfd 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,4 +1,4 @@
-# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.012.
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.029.
Changes
LICENSE
MANIFEST
diff --git a/META.json b/META.json
index 4d7aaae..2093423 100644
--- a/META.json
+++ b/META.json
@@ -4,7 +4,7 @@
"Andrius Merkys <merkys@cpan.org>"
],
"dynamic_config" : 0,
- "generated_by" : "Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010",
+ "generated_by" : "Dist::Zilla version 6.029, CPAN::Meta::Converter version 2.150010",
"license" : [
"bsd"
],
@@ -47,7 +47,8 @@
}
},
"version" : "0.1.0",
- "x_generated_by_perl" : "v5.30.0",
- "x_serialization_backend" : "Cpanel::JSON::XS version 4.19"
+ "x_generated_by_perl" : "v5.36.0",
+ "x_serialization_backend" : "Cpanel::JSON::XS version 4.32",
+ "x_spdx_expression" : "BSD"
}
diff --git a/META.yml b/META.yml
index 7e33768..13b0168 100644
--- a/META.yml
+++ b/META.yml
@@ -8,7 +8,7 @@ build_requires:
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 0
-generated_by: 'Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010'
+generated_by: 'Dist::Zilla version 6.029, CPAN::Meta::Converter version 2.150010'
license: bsd
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -24,5 +24,6 @@ resources:
homepage: https://search.cpan.org/dist/Debian-DEP12
repository: git://github.com/merkys/debian-dep12.git
version: 0.1.0
-x_generated_by_perl: v5.30.0
+x_generated_by_perl: v5.36.0
x_serialization_backend: 'YAML::Tiny version 1.73'
+x_spdx_expression: BSD
diff --git a/Makefile.PL b/Makefile.PL
index 72648c4..2d3aaa3 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,4 +1,4 @@
-# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.012.
+# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.029.
use strict;
use warnings;
diff --git a/README b/README
index c36e676..1f1d67a 100644
--- a/README
+++ b/README
@@ -10,4 +10,4 @@ This is free software, licensed under:
The (three-clause) BSD License
-This README file was generated by Dist::Zilla::Plugin::Readme v6.012.
+This README file was generated by Dist::Zilla::Plugin::Readme v6.029.
diff --git a/debian/changelog b/debian/changelog
index 22e87e3..b58d418 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libdebian-dep12-perl (0.1.0+git20210302.1.f060166-1) UNRELEASED; urgency=low
+
+ * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk> Thu, 19 Jan 2023 11:40:04 -0000
+
libdebian-dep12-perl (0.1.0-3) unstable; urgency=medium
[ Debian Janitor ]
diff --git a/lib/Debian/DEP12.pm b/lib/Debian/DEP12.pm
index 0f43dc0..7d3c190 100644
--- a/lib/Debian/DEP12.pm
+++ b/lib/Debian/DEP12.pm
@@ -6,6 +6,11 @@ use warnings;
# ABSTRACT: interface to Debian DEP 12 format
our $VERSION = '0.1.0'; # VERSION
+# As DEP 12 is in draft state and the development is happening in its
+# wiki page (https://wiki.debian.org/UpstreamMetadata), this variable
+# holds the UTC timestamp of DEP 12 wiki page.
+our $DEP12_VERSION = '2021-02-21 11:52:54';
+
use Data::Validate::Email qw( is_email_rfc822 );
use Data::Validate::URI qw( is_uri );
use Debian::DEP12::ValidationWarning;
@@ -50,6 +55,13 @@ my @list_fields = qw(
Screenshots
);
+my @reserved_fields = qw(
+ ping
+ YAML-ALL
+ YAML-URL
+ YAML-REFRESH-DATE
+);
+
=head1 NAME
Debian::DEP12 - interface to Debian DEP 12 format
@@ -68,7 +80,13 @@ Debian::DEP12 - interface to Debian DEP 12 format
Debian::DEP12 is an object-oriented interface for Debian DEP 12 format,
also known as debian/upstream/metadata. Primary focus of the initial
-development was validation and fixing of DEP 12 data.
+development is the validation and fixing of DEP 12 data.
+
+DEP 12 is in draft state and the development is happening in its wiki
+page (L<https://wiki.debian.org/UpstreamMetadata>). Thus Debian::DEP12
+attempts to keep up with the DEP 12 specification. To keep track, the
+UTC timestamp of DEP 12 wiki page is stored in C<$DEP12_VERSION> class
+variable.
Contributions welcome!
@@ -252,6 +270,11 @@ sub validate
_warn_value( 'unknown field', $key, $self->get( $key ) );
}
+ if( grep { $_ eq $key } @reserved_fields ) {
+ push @warnings,
+ _warn_value( 'reserved field', $key, $self->get( $key ) );
+ }
+
if( ref $self->get( $key ) && !grep { $_ eq $key } @list_fields ) {
push @warnings,
_warn_value( 'scalar value expected',
@@ -264,7 +287,12 @@ sub validate
'Documentation', 'Donation', 'FAQ', 'Gallery',
'Other-References', 'Registration', 'Repository',
'Repository-Browse', 'Screenshots', 'Webservice') {
- next if !defined $self->get( $key );
+ next if !exists $self->{$key};
+
+ if( !defined $self->get( $key ) ) {
+ push @warnings, _warn_value( 'undefined value', $key );
+ next;
+ }
my @values;
if( ref $self->get( $key ) eq 'ARRAY' ) {
@@ -313,6 +341,64 @@ sub validate
}
}
+ if( defined $self->get( 'Registry' ) &&
+ ref $self->get( 'Registry' ) eq 'ARRAY' ) {
+ # TODO: report non-arrays
+
+ my @registry = @{$self->get( 'Registry' )};
+ for my $i (0..$#registry) {
+ my @unknown_fields = grep { $_ !~ /^(Name|Entry)$/ }
+ sort keys %{$registry[$i]};
+ for (@unknown_fields) {
+ push @warnings,
+ _warn_value( 'unknown field',
+ "Registry[$i].$_",
+ $registry[$i]->{$_} );
+ }
+
+ for ('Name', 'Entry') {
+ if( !exists $registry[$i]->{$_} ) {
+ push @warnings,
+ _warn_value( 'missing mandatory field',
+ "Registry[$i].$_" );
+ next;
+ }
+
+ if( !defined $registry[$i]->{$_} ) {
+ push @warnings,
+ _warn_value( 'undefined value',
+ "Registry[$i].$_" );
+ next;
+ }
+
+ if( ref $registry[$i]->{$_} ) {
+ push @warnings,
+ _warn_value( 'non-scalar value',
+ "Registry[$i].$_",
+ $registry[$i]->{$_} );
+ next;
+ }
+
+ if( $_ eq 'Name' ) {
+ if( $registry[$i]->{$_} !~
+ /^(bio\.tools|biii|OMICtools|SciCrunch|conda:.+|opam|PyPI)$/ ) {
+ push @warnings,
+ _warn_value( 'unknown registry \'%(value)s\'',
+ "Registry[$i].$_",
+ $registry[$i]->{$_} );
+ }
+ } else { # Entry
+ if( defined is_uri $registry[$i]->{$_} ) {
+ push @warnings,
+ _warn_value( 'should not be URI',
+ "Registry[$i].$_",
+ $registry[$i]->{$_} );
+ }
+ }
+ }
+ }
+ }
+
my @BibTeX = $self->_to_BibTeX;
for my $i (0..$#BibTeX) {
my $BibTeX = $BibTeX[$i];
diff --git a/t/02_validate.t b/t/02_validate.t
index 455661b..2848511 100644
--- a/t/02_validate.t
+++ b/t/02_validate.t
@@ -20,10 +20,14 @@ is( scalar @warnings, 0 );
$entry = Debian::DEP12->new( <<END );
Bug-Database: github.com/merkys/Debian-DEP12/issues
+Bug-Submit:
END
@warnings = $entry->validate;
-is( "@warnings", 'Bug-Database: value \'github.com/merkys/Debian-DEP12/issues\' does not look like valid URL' );
+is( join( "\n", @warnings ) . "\n", <<'END' );
+Bug-Database: value 'github.com/merkys/Debian-DEP12/issues' does not look like valid URL
+Bug-Submit: undefined value
+END
$entry = Debian::DEP12->new;
$entry->set( 'Bug-Database', 'github.com/merkys/Debian-DEP12/issues' );
Debdiff
File lists identical (after any substitutions)
No differences were encountered in the control files