Commit 4543b6b7 authored by Jonas Smedegaard's avatar Jonas Smedegaard
Browse files

track PackageRelease files

parent dd67f459
......@@ -40,7 +40,7 @@ use App::DistroDelta::DateTime;
my $RE_srcsplit = qr/\n\n+/;
my $RE_srcfields
= qr/^(?:Package: *(?<name>\S+) *\n|Version: *(?<version>\S+) *\n|Vcs-Browser: *(?<vcs_browser>\S+) *\n|Vcs-Arch: *(?<vcs_arch>\S+)(?: [^\n]*)?\n|Vcs-Bzr: *(?<vcs_bzr>\S+)(?: [^\n]*)?\n|Vcs-Cvs: *(?<vcs_cvs>\S+)(?: [^\n]*)?\n|Vcs-Darcs: *(?<vcs_darcs>\S+)(?: [^\n]*)?\n|Vcs-Git: *(?<vcs_git>\S+)(?: +-b +(?<vcs_git_branch>\S+))?(?: [^\n]*)?\n|Vcs-Hg: *(?<vcs_hg>\S+)(?: +-b +(?<vcs_hg_branch>\S+))?(?: [^\n]*)?\n|Vcs-Mtn: *(?<vcs_mtn>\S+)(?: [^\n]*)?\n|Vcs-Svn: *(?<vcs_svn>\S+)(?: [^\n]*)?\n|\S+:[^\n]*\n(?: \S[^\n]*\n)*)+/m;
= qr/^(?:Package: *(?<name>\S+) *\n|Version: *(?<version>\S+) *\n|Vcs-Browser: *(?<vcs_browser>\S+) *\n|Vcs-Arch: *(?<vcs_arch>\S+)(?: [^\n]*)?\n|Vcs-Bzr: *(?<vcs_bzr>\S+)(?: [^\n]*)?\n|Vcs-Cvs: *(?<vcs_cvs>\S+)(?: [^\n]*)?\n|Vcs-Darcs: *(?<vcs_darcs>\S+)(?: [^\n]*)?\n|Vcs-Git: *(?<vcs_git>\S+)(?: +-b +(?<vcs_git_branch>\S+))?(?: [^\n]*)?\n|Vcs-Hg: *(?<vcs_hg>\S+)(?: +-b +(?<vcs_hg_branch>\S+))?(?: [^\n]*)?\n|Vcs-Mtn: *(?<vcs_mtn>\S+)(?: [^\n]*)?\n|Vcs-Svn: *(?<vcs_svn>\S+)(?: [^\n]*)?\n|Checksums-Sha256:\n(?<checksums_sha256>(?: [0-9a-f]{64} [0-9]+ \S+\n)+)|\S+:[^\n]*\n(?: \S[^\n]*\n)*)+/m;
my $RE_pkgver = qr/^[a-z0-9]\S* \d\S*/m;
my $RE_pkgver_ = qr/^([a-z0-9]\S*) (\d\S*)/m;
......
......@@ -22,8 +22,22 @@ part of an operating system distribution.
package App::DistroDelta::PackageRelease 0.01;
my $RE_sha256 = qr/^ (?<checksum>[0-9a-f]{64}) (?<size>[0-9]+) (?<name>\S+)/m;
sub files ($self) {
if ( !keys %{ $self->{files} } ) {
if ( $self->{checksums_sha256} ) {
$self->{checksums_sha256} =~ /$RE_sha256/g;
$self->{files} = {%+};
}
}
return $self->{files}
};
use Class::Tiny qw( project version vcs_browser
vcs_arch vcs_bzr vcs_cvs vcs_darcs vcs_git vcs_hg vcs_mtn vcs_svn ), {
vcs_arch vcs_bzr vcs_cvs vcs_darcs vcs_git vcs_hg vcs_mtn vcs_svn
checksums_sha256 ), {
files => sub { return {} },
sources => sub { return [] },
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment