mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-06 04:35:12 +02:00
geoip: apply consistent style to xt_geoip_build
This commit is contained in:
@@ -8,12 +8,12 @@ use IO::Handle;
|
|||||||
use Text::CSV_XS; # or trade for Text::CSV
|
use Text::CSV_XS; # or trade for Text::CSV
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
my $le32 = pack('V', 0x10000000);
|
my $le32 = pack("V", 0x10000000);
|
||||||
my $be32 = pack('N', 0x10000000);
|
my $be32 = pack("N", 0x10000000);
|
||||||
my $u32 = undef;
|
my $u32 = undef;
|
||||||
|
|
||||||
sub wantBE { (!$u32 || $u32 eq $be32); }
|
sub wantBE { return !$u32 || $u32 eq $be32; }
|
||||||
sub wantLE { (!$u32 || $u32 eq $le32); }
|
sub wantLE { return !$u32 || $u32 eq $le32; }
|
||||||
|
|
||||||
my $csv = Text::CSV_XS->new({
|
my $csv = Text::CSV_XS->new({
|
||||||
allow_whitespace => 1,
|
allow_whitespace => 1,
|
||||||
@@ -35,13 +35,13 @@ if (!-d $target_dir) {
|
|||||||
}
|
}
|
||||||
my @dbs = qw(LE BE);
|
my @dbs = qw(LE BE);
|
||||||
if ($native_only) {
|
if ($native_only) {
|
||||||
$u32 = pack('L', 0x10000000);
|
$u32 = pack("L", 0x10000000);
|
||||||
if ($u32 eq $le32) {
|
if ($u32 eq $le32) {
|
||||||
@dbs = qw(LE);
|
@dbs = qw(LE);
|
||||||
} elsif ($u32 eq $be32) {
|
} elsif ($u32 eq $be32) {
|
||||||
@dbs = qw(BE);
|
@dbs = qw(BE);
|
||||||
} else {
|
} else {
|
||||||
print STDERRR "Can't determine endianness.\n";
|
print STDERRR "Cannot determine endianness.\n";
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user