Commit d6c569a4 authored by Andrew Ayer's avatar Andrew Ayer

Rename module from StripNondeterminism to File::StripNondeterminism

parent 0faf9c5a
......@@ -4,8 +4,8 @@ Makefile.PL
README
bin/dh_strip_nondeterminism
bin/strip-nondeterminism
lib/StripNondeterminism.pm
lib/StripNondeterminism/handlers/ar.pm
lib/StripNondeterminism/handlers/gzip.pm
lib/StripNondeterminism/handlers/jar.pm
lib/StripNondeterminism/handlers/zip.pm
lib/File/StripNondeterminism.pm
lib/File/StripNondeterminism/handlers/ar.pm
lib/File/StripNondeterminism/handlers/gzip.pm
lib/File/StripNondeterminism/handlers/jar.pm
lib/File/StripNondeterminism/handlers/zip.pm
......@@ -7,7 +7,7 @@ my $MMVER = eval $ExtUtils::MakeMaker::VERSION;
WriteMakefile(
NAME => 'strip-nondeterminism',
AUTHOR => 'Andrew Ayer <agwa@andrewayer.name>',
VERSION_FROM => 'lib/StripNondeterminism.pm',
VERSION_FROM => 'lib/File/StripNondeterminism.pm',
ABSTRACT => 'tool for stripping non-determinism from files',
EXE_FILES => [qw(bin/dh_strip_nondeterminism bin/strip-nondeterminism)],
PREREQ_PM => {
......
StripNondeterminism is a Perl module for stripping bits of
File::StripNondeterminism is a Perl module for stripping bits of
non-deterministic information, such as timestamps and file system
order, from files such as gzipped files, ZIP archives, and Jar files.
It can be used as a post-processing step to make a build reproducible,
when the build process itself cannot be made deterministic. It is used
as part of the Reproducible Builds project.
strip-nondeterminism contains the StripNondeterminism Perl module, the
strip-nondeterminism contains the File::StripNondeterminism Perl module, the
strip-nondeterminism command line utility, and the dh_strip_nondeterminism
Debhelper add-on.
......@@ -9,7 +9,7 @@ dh_strip_nondeterminism - strip uninteresting, non-deterministic information fro
use strict;
use File::Find;
use Debian::Debhelper::Dh_Lib;
use StripNondeterminism;
use File::StripNondeterminism;
=head1 SYNOPSIS
......@@ -54,7 +54,7 @@ sub testfile {
return if ($fn=~m/\Q$f\E/);
}
my $normalizer = StripNondeterminism::get_normalizer_for_file($_);
my $normalizer = File::StripNondeterminism::get_normalizer_for_file($_);
if ($normalizer) {
push @nondeterministic_files, [$fn, $normalizer];
}
......
......@@ -22,7 +22,7 @@
use strict;
use warnings;
use StripNondeterminism;
use File::StripNondeterminism;
use Getopt::Long;
Getopt::Long::Configure(qw(no_ignore_case permute bundling));
......@@ -42,7 +42,7 @@ if ($glop->{help}) {
}
if ($glop->{version}) {
print "$cmd version $StripNondeterminism::VERSION\n";
print "$cmd version $File::StripNondeterminism::VERSION\n";
exit 0;
}
......@@ -51,10 +51,10 @@ die $usage if @ARGV == 0;
for my $filename (@ARGV) {
my $normalizer;
if ($glop->{type}) {
$normalizer = StripNondeterminism::get_normalizer_by_name($glop->{type});
$normalizer = File::StripNondeterminism::get_normalizer_by_name($glop->{type});
die $glop->{type} . ": Unknown file type\n" unless $normalizer;
} else {
$normalizer = StripNondeterminism::get_normalizer_for_file($filename);
$normalizer = File::StripNondeterminism::get_normalizer_for_file($filename);
next unless $normalizer;
}
......
......@@ -16,16 +16,16 @@
# You should have received a copy of the GNU General Public License
# along with strip-nondeterminism. If not, see <http://www.gnu.org/licenses/>.
#
package StripNondeterminism;
package File::StripNondeterminism;
use strict;
use warnings;
use StripNondeterminism::handlers::ar;
use StripNondeterminism::handlers::gzip;
use StripNondeterminism::handlers::jar;
use StripNondeterminism::handlers::javadoc;
use StripNondeterminism::handlers::zip;
use File::StripNondeterminism::handlers::ar;
use File::StripNondeterminism::handlers::gzip;
use File::StripNondeterminism::handlers::jar;
use File::StripNondeterminism::handlers::javadoc;
use File::StripNondeterminism::handlers::zip;
our($VERSION);
......@@ -48,34 +48,34 @@ sub get_normalizer_for_file {
# ar
if (m/\.a$/ && _get_file_type($_) =~ m/ar archive/) {
return \&StripNondeterminism::handlers::ar::normalize;
return \&File::StripNondeterminism::handlers::ar::normalize;
}
# gzip
if (m/\.gz$/ && _get_file_type($_) =~ m/gzip compressed data/) {
return \&StripNondeterminism::handlers::gzip::normalize;
return \&File::StripNondeterminism::handlers::gzip::normalize;
}
# jar
if (m/\.jar$/ && _get_file_type($_) =~ m/Zip archive data/) {
return \&StripNondeterminism::handlers::jar::normalize;
return \&File::StripNondeterminism::handlers::jar::normalize;
}
# javadoc
if (m/\.html$/ && StripNondeterminism::handlers::javadoc::is_javadoc_file($_)) {
return \&StripNondeterminism::handlers::javadoc::normalize;
if (m/\.html$/ && File::StripNondeterminism::handlers::javadoc::is_javadoc_file($_)) {
return \&File::StripNondeterminism::handlers::javadoc::normalize;
}
# zip
if (m/\.zip$/ && _get_file_type($_) =~ m/Zip archive data/) {
return \&StripNondeterminism::handlers::zip::normalize;
return \&File::StripNondeterminism::handlers::zip::normalize;
}
return undef;
}
sub get_normalizer_by_name {
$_ = shift;
return \&StripNondeterminism::handlers::ar::normalize if $_ eq 'ar';
return \&StripNondeterminism::handlers::gzip::normalize if $_ eq 'gzip';
return \&StripNondeterminism::handlers::jar::normalize if $_ eq 'jar';
return \&StripNondeterminism::handlers::javadoc::normalize if $_ eq 'javadoc';
return \&StripNondeterminism::handlers::zip::normalize if $_ eq 'zip';
return \&File::StripNondeterminism::handlers::ar::normalize if $_ eq 'ar';
return \&File::StripNondeterminism::handlers::gzip::normalize if $_ eq 'gzip';
return \&File::StripNondeterminism::handlers::jar::normalize if $_ eq 'jar';
return \&File::StripNondeterminism::handlers::javadoc::normalize if $_ eq 'javadoc';
return \&File::StripNondeterminism::handlers::zip::normalize if $_ eq 'zip';
return undef;
}
......
......@@ -18,7 +18,7 @@
# Copyright (C) 2007 Stefano Zacchiroli <zack@debian.org>
# Copyright (C) 2007 Filippo Giunchedi <filippo@debian.org>
package StripNondeterminism::handlers::ar;
package File::StripNondeterminism::handlers::ar;
use strict;
use warnings;
......
......@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with strip-nondeterminism. If not, see <http://www.gnu.org/licenses/>.
#
package StripNondeterminism::handlers::gzip;
package File::StripNondeterminism::handlers::gzip;
use strict;
use warnings;
......
......@@ -16,14 +16,14 @@
# You should have received a copy of the GNU General Public License
# along with strip-nondeterminism. If not, see <http://www.gnu.org/licenses/>.
#
package StripNondeterminism::handlers::jar;
package File::StripNondeterminism::handlers::jar;
use strict;
use warnings;
use Archive::Zip;
use StripNondeterminism::handlers::zip;
use StripNondeterminism::handlers::javadoc;
use File::StripNondeterminism::handlers::zip;
use File::StripNondeterminism::handlers::javadoc;
sub _jar_filename_cmp ($$) {
my ($a, $b) = @_;
......@@ -41,16 +41,16 @@ sub _jar_normalize_member {
return if $member->isDirectory();
if ($member->fileName() =~ /\.html$/ &&
StripNondeterminism::handlers::zip::peek_member($member, 1024) =~ /\<!-- Generated by javadoc/) {
File::StripNondeterminism::handlers::zip::peek_member($member, 1024) =~ /\<!-- Generated by javadoc/) {
# javadoc header should be within first 1kb of file
StripNondeterminism::handlers::zip::normalize_member($member,
\&StripNondeterminism::handlers::javadoc::normalize);
File::StripNondeterminism::handlers::zip::normalize_member($member,
\&File::StripNondeterminism::handlers::javadoc::normalize);
}
}
sub normalize {
my ($jar_filename) = @_;
return StripNondeterminism::handlers::zip::normalize($jar_filename,
return File::StripNondeterminism::handlers::zip::normalize($jar_filename,
filename_cmp => \&_jar_filename_cmp,
member_normalizer => \&_jar_normalize_member);
}
......
......@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with strip-nondeterminism. If not, see <http://www.gnu.org/licenses/>.
#
package StripNondeterminism::handlers::javadoc;
package File::StripNondeterminism::handlers::javadoc;
use strict;
use warnings;
......
......@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with strip-nondeterminism. If not, see <http://www.gnu.org/licenses/>.
#
package StripNondeterminism::handlers::zip;
package File::StripNondeterminism::handlers::zip;
use strict;
use warnings;
......
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