view release on metacpan or search on metacpan
xs/ppport.h view on Meta::CPAN
F<xs/ppport.h> on your source code. See the next section for
details.
=head1 EXAMPLES
To verify whether F<xs/ppport.h> is needed for your module, whether you
should make any changes to your code, and whether any special defines
should be used, F<xs/ppport.h> can be run as a Perl script to check your
source code. Simply say:
perl xs/ppport.h
xs/ppport.h view on Meta::CPAN
vTHX|5.006000||Viu
VT_NATIVE|5.021004||Viu
vtohl|5.003007||Viu
vtohs|5.003007||Viu
VUTIL_REPLACE_CORE|5.019008||Viu
vverify|5.009003|5.009003|
VVERIFY|5.019008||Viu
vwarn|5.006000|5.006000|
vwarner|5.006000|5.004000|p
wait4pid|5.003007||Viu
wait|5.005000||Viu
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Archive/BagIt/App/Verify.pm view on Meta::CPAN
use MooseX::App::Command;
parameter 'bag_path' => (
is=>'rw',
isa=>'Str',
documentation => q[This is the path to run verify on],
required => 1,
);
option 'return_all_errors' => (
is => 'rw',
lib/Archive/BagIt/App/Verify.pm view on Meta::CPAN
}
else {
$bag = Archive::BagIt->new($bag_path);
}
eval {
$bag->verify_bag();
};
if ($@) {
print "FAIL: ".$bag_path." : $! $@\n";
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Archive/BagIt/Fast.pm view on Meta::CPAN
}
else {
$digest = $digestobj->get_hash_string($fh);
}
my $finish_time = time();
$self->{stats}->{files}->{"$filename"}->{verify_time}= ($finish_time - $start_time);
$self->{stats}->{verify_time} += ($finish_time-$start_time);
close($fh);
return $digest;
};
return $sub;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Archive/BagIt.pm view on Meta::CPAN
return $ret;
}
###############################################
sub _verify_baginfo {
my ($self, $info) = @_;
my $ret = 1;
if (!defined $info) {
if (exists $self->{bag_info_file}) {
lib/Archive/BagIt.pm view on Meta::CPAN
return $ret;
}
###############################################
sub verify_baginfo {
my ($self) = @_;
my $info = $self->bag_info();
if (List::Util::any { /the baginfo file .* could not be parsed correctly/ } @{$self->{'errors'}}) {
return;
}
return $self->_verify_baginfo($info);
}
###############################################
lib/Archive/BagIt.pm view on Meta::CPAN
}
###############################################
sub verify_bag {
my ($self,$opts) = @_;
#removed the ability to pass in a bag in the parameters, but might want options
#like $return all errors rather than dying on first one
my $bagit = $self->bag_path;
my $version = $self->bag_version(); # to call trigger
my $encoding = $self->bag_encoding(); # to call trigger
my $baginfo = $self->verify_baginfo(); #to call trigger
my $fetch_file = File::Spec->catfile($self->metadata_path, "fetch.txt");
my $payload_dir = $self->payload_path;
my $return_all_errors = $opts->{return_all_errors};
lib/Archive/BagIt.pm view on Meta::CPAN
my @errors;
# check for manifests
foreach my $algorithm ( keys %{ $self->manifests }) {
my $res = $self->manifests->{$algorithm}->verify_manifest($self->payload_files, $return_all_errors);
if ((defined $res) && ($res ne "1")) { push @errors, $res; }
}
#check for tagmanifests
foreach my $algorithm ( keys %{ $self->manifests }) {
my $res = $self->manifests->{$algorithm}->verify_tagmanifest($self->non_payload_files, $return_all_errors);
if ((defined $res) && ($res ne "1")) { push @errors, $res; }
}
push @{$self->{errors}}, @errors;
my $err = $self->errors();
my @err = @{ $err };
if (scalar( @err ) > 0) {
croak join("\n","bag verify for bagit version '$version' failed with invalid files.", @err);
}
return 1;
}
lib/Archive/BagIt.pm view on Meta::CPAN
=back
At the moment only filepaths in linux-style are supported.
To get an more detailled overview, see the testsuite under F<t/verify_bag.t> and corresponding test bags from the BagIt conformance testsuite of Library of Congress under F<bagit_conformance_suite/>.
See L<https://datatracker.ietf.org/doc/rfc8493/?include_text=1> for details.
=head1 TODO
lib/Archive/BagIt.pm view on Meta::CPAN
=item reduce complexity
=item use modern perl code
=item add flag to enable very strict verify
=back
=head1 Backward Compatibility
lib/Archive/BagIt.pm view on Meta::CPAN
=item loading the files referenced in the manifest files was previously done serially and using synchronous I/O. By
using the L<IO::Async> module, the files are loaded asynchronously, the performance gain is huge.
=back
On my system with 8cores, SSD and a large 9GB bag with 568 payload files the results for C<verify_bag()> are:
processing time run time throughput
Version user time system time total time total MB/s
v0.71 38.31s 1.60s 39.938s 100% 230
v0.81 25.48s 1.68s 27.1s 67% 340
v0.82 48.85s 3.89s 6.84s 17% 1346
=head2 How fast is L<Archive::BagIt::Fast>?
It depends. On my system with 8cores, SSD and a 38MB bag with 48 payload files the results for C<verify_bag()> are:
Rate Base Fast
Base 3.01/s -- -21%
Fast 3.80/s 26% --
On my system with 8cores, SSD and a large 9GB bag with 568 payload files the results for C<verify_bag()> are:
s/iter Base Fast
Base 74.6 -- -9%
Fast 68.3 9% --
lib/Archive/BagIt.pm view on Meta::CPAN
Without the support of my colleagues at SLUB Dresden, the project would never have made it this far.
=head1 SYNOPSIS
This modules will hopefully help with the basic commands needed to create
and verify a bag. This part supports BagIt 1.0 according to RFC 8493 ([https://tools.ietf.org/html/rfc8493](https://tools.ietf.org/html/rfc8493)).
You only need to know the following methods first:
=head2 read a BagIt
lib/Archive/BagIt.pm view on Meta::CPAN
=head2 construct a BagIt around a payload
use Archive::BagIt;
my $bag2 = Archive::BagIt->make_bag($bag_dir);
=head2 verify a BagIt-dir
use Archive::BagIt;
# Validate a BagIt archive against its manifest
my $bag3 = Archive::BagIt->new($bag_dir);
my $is_valid1 = $bag3->verify_bag();
# Validate a BagIt archive against its manifest, report all errors
my $bag4 = Archive::BagIt->new($bag_dir);
my $is_valid2 = $bag4->verify_bag( {report_all_errors => 1} );
=head2 read a BagIt-dir, change something, store
Because all methods operate lazy, you should ensure to parse parts of the bag *BEFORE* you modify it.
Otherwise it will be overwritten!
lib/Archive/BagIt.pm view on Meta::CPAN
=item C<force_utf8> - if set the warnings about non portable filenames are disabled (default: enabled)
=item C<use_plugins> - expected manifest plugin strings, if set it uses the requested plugins,
example C<Archive::BagIt::Plugin::Manifest::SHA256>.
HINT: this option *disables* the forced fixity check in C<verify_bag()>!
=back
The bag object will use $bag_dir, BUT an existing $bag_dir is not read. If you use C<store()> an existing bag will be overwritten!
lib/Archive/BagIt.pm view on Meta::CPAN
returns true if bag info exists.
=head2 errors()
Getter to return collected errors after a C<verify_bag()> call with Option C<report_all_errors>
=head2 warnings()
Getter to return collected warnings after a C<verify_bag()> call
=head2 digest_callback()
This method could be reimplemented by derived classes to handle fixity checks in own way. The
getter returns an anonymous function with following interface:
lib/Archive/BagIt.pm view on Meta::CPAN
=head2 is_baginfo_key_reserved( $searchkey )
returns true if key is reserved
=head2 verify_baginfo()
checks baginfo-keys, returns true if all fine, otherwise returns undef and the message is pushed to C<errors()>.
Warnings pushed to C< warnings() >
=head2 delete_baginfo_by_key( $searchkey )
lib/Archive/BagIt.pm view on Meta::CPAN
=head2 load()
Triggers loading of an existing bag
=head2 verify_bag($opts)
A method to verify a bag deeply. If C<$opts> is set with C<{return_all_errors}> all fixity errors are reported.
The default ist to croak with error message if any error is detected.
HINT: You might also want to check L<Archive::BagIt::Fast> to see a more direct way of accessing files (and thus faster).
=head2 calc_payload_oxum()
view all matches for this distribution
view release on metacpan or search on metacpan
1.12 Fri 3 Aug 2007
- Fixing a small bug in archive file generation (Jeffery Candiloro)
1.11 Tue 8 May 2007
- Adding a test to verify the file sorted works implemented
in the previous version works as expected.
- No functional changes.
1.10 Fri 4 May 2007
- Due to the fixing of some fairly major issues that caused
view all matches for this distribution
view release on metacpan or search on metacpan
t/02-crunch.t view on Meta::CPAN
#########################
use Archive::ByteBoozer2 qw(:crunch :rcrunch);
use File::Slurp;
use Test::More tests => 2;
#########################
sub verify {
my $expected = join '', map { chr hex } @_;
my $got = read_file 't/test.prg.b2';
is $got, $expected, 'compressed data';
unlink 't/test.prg.b2';
}
#########################
{
crunch('t/test.prg');
verify(qw(fe 0f 00 10 54 4c 05 10 00 00 ee 20 d0 84 7f ff));
}
#########################
{
rcrunch('t/test.prg', 0x4000);
verify(qw(f2 3f 00 10 54 4c 05 10 00 00 ee 20 d0 84 7f ff));
}
#########################
view all matches for this distribution
view release on metacpan or search on metacpan
This file contains message digests of all files listed in MANIFEST,
signed via the Module::Signature module, version 0.68.
To verify the content in this distribution, first make sure you have
Module::Signature installed, then type:
% cpansign -v
It will check each file's integrity, as well as the signature's
view all matches for this distribution
view release on metacpan or search on metacpan
],
"cookies": [],
"content": {
"size": 136732,
"mimeType": "text/javascript",
"text": "/* _GlobalPrefix_ */\nthis.gbar_=this.gbar_||{};(function(_){var window=this;\n/* _Module_:syp */\ntry{\nvar On=function(){};_.y(On,Error);_.Pn=function(){this.b=\"pending\";this.B=[];this.w=this.C=void 0};_.ae(_.Pn);var Qn=funct...
},
"redirectURL": "",
"headersSize": -1,
"bodySize": 0,
"_transferSize": 0
view all matches for this distribution
view release on metacpan or search on metacpan
return $self->{version};
}
# verification
sub verify {
my $self = shift;
my $verify = undef;
# required: package, version, architecture, maintainer, section, description
$verify .= "No package name\n" unless (defined $self->{name});
# version should be at least empty
$verify .= "No version\n" unless (defined $self->{architecture});
$verify .= "No architecture\n" unless (defined $self->{architecture});
$verify .= "No maintainer\n" unless (defined $self->{maintainer});
$verify .= "No section\n" unless (defined $self->{section});
$verify .= "No description\n" unless (defined $self->{description});
return $verify;
}
# file handling
sub add_files {
}
sub data {
my $self = shift;
return undef if $self->verify;
# make control package
$self->{TAR_CONTROL} = Archive::Tar->new();
$self->{TAR_CONTROL}->add_data("./control", $self->control, { mode => 0100644 });
foreach (qw(preinst postinst prerm postrm)) {
=item C<$ctl = $ipkg-E<gt>control()>
Returns the text of the control file that will be written. You just need this
if you want to check the file.
=item C<$errmsg = $ipkg-E<gt>verify()>
Verifies whether the archive can be written by checking whether at least the
required properties are set (see below).
Returns an error message if unsuccessful, else undef (!).
=over 4
=item C<$ipkg-E<gt>sloppy_checks>
Will switch of all syntax checks in accessor functions. C<verify> will still
check whether all required properties are set.
=item C<$ipkg-E<gt>strict_checks>
Re-enables syntax checks in accessor functions (this is the default).
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Archive/ppport.h view on Meta::CPAN
F<ppport.h> on your source code. See the next section for
details.
=head1 EXAMPLES
To verify whether F<ppport.h> is needed for your module, whether you
should make any changes to your code, and whether any special defines
should be used, F<ppport.h> can be run as a Perl script to check your
source code. Simply say:
perl ppport.h
lib/Archive/ppport.h view on Meta::CPAN
vmess||5.006000|
vnewSVpvf|5.006000|5.004000|p
vnormal||5.009002|
vnumify||5.009000|
vstringify||5.009000|
vverify||5.009003|
vwarner||5.006000|
vwarn||5.006000|
wait4pid|||
warn_nocontext|||vn
warner_nocontext|||vn
view all matches for this distribution
view release on metacpan or search on metacpan
xs/ppport.h view on Meta::CPAN
F<xs/ppport.h> on your source code. See the next section for
details.
=head1 EXAMPLES
To verify whether F<xs/ppport.h> is needed for your module, whether you
should make any changes to your code, and whether any special defines
should be used, F<xs/ppport.h> can be run as a Perl script to check your
source code. Simply say:
perl xs/ppport.h
xs/ppport.h view on Meta::CPAN
vTHX|5.006000||Viu
VT_NATIVE|5.021004||Viu
vtohl|5.003007||Viu
vtohs|5.003007||Viu
VUTIL_REPLACE_CORE|5.019008||Viu
vverify|5.009003|5.009003|
VVERIFY|5.019008||Viu
vwarn|5.006000|5.006000|
vwarner|5.006000|5.006000|p
wait4pid|5.003007||Viu
wait|5.005000||Viu
view all matches for this distribution
view release on metacpan or search on metacpan
This file contains message digests of all files listed in MANIFEST,
signed via the Module::Signature module, version 0.68.
To verify the content in this distribution, first make sure you have
Module::Signature installed, then type:
% cpansign -v
It will check each file's integrity, as well as the signature's
view all matches for this distribution
view release on metacpan or search on metacpan
F<ppport.h> on your source code. See the next section for
details.
=head1 EXAMPLES
To verify whether F<ppport.h> is needed for your module, whether you
should make any changes to your code, and whether any special defines
should be used, F<ppport.h> can be run as a Perl script to check your
source code. Simply say:
perl ppport.h
vmess|5.006000||p
vnewSVpvf|5.006000|5.004000|p
vnormal||5.009002|
vnumify||5.009000|
vstringify||5.009000|
vverify||5.009003|
vwarner||5.006000|
vwarn||5.006000|
wait4pid|||
warn_nocontext|||pvn
warn_sv|5.013001||p
view all matches for this distribution
view release on metacpan or search on metacpan
t/deep_nest_all_test.t view on Meta::CPAN
});
my $base = catdir($test_data_dir, $test_data_no);
$probe->reset_matches();
$probe->search($base, 1);
# verify that the .abc file is found
my $exp = catdir(
'a.rar__',
'b.tgz__',
'c.bz2__',
'd.zip__',
t/deep_nest_all_test.t view on Meta::CPAN
$probe->working_dir($tmpdir);
$base = catdir($test_data_dir, $test_data_no, "a.rar");
$probe->reset_matches();
$probe->search($base, 1);
# verify that the .abc file is found
is(
$map->{abc},
$exp,
'file search in deep nested archive(start w/ file)'
);
view all matches for this distribution