File: dep12-validate

package info (click to toggle)
libdebian-dep12-perl 0.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 124 kB
  • sloc: perl: 481; makefile: 2
file content (23 lines) | stat: -rwxr-xr-x 434 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/perl

use strict;
use warnings;

use Debian::DEP12;

@ARGV = ( '-' ) unless @ARGV;

for my $i (0..$#ARGV) {
    my $filename = $ARGV[$i];
    open( my $inp, '<' . $filename );
    my $yaml = join '', <$inp>;
    close $inp;

    my $meta = Debian::DEP12->new( $yaml );
    my @warnings = $meta->validate;

    for my $warning (@warnings) {
        $warning->set( 'file', $filename );
        warn "$0: $warning\n";
    }
}