Skip to content
GitLab
Explore
Sign in
derf
Travel-Status-DE-IRIS
Compare revisions
af2b2b2c32312cd7d2f848dbcef8be7d79f8d4b9 to 019091bf2317f875440eb44ed1f1f055306490ac
Commits on Source (2)
GIS::Distance has been packaged for Debian trixie; drop Geo::Distance support
· 1a950109
Birte Kristina Friesel
authored
Dec 10, 2023
1a950109
Stations: perltidy
· 019091bf
Birte Kristina Friesel
authored
Dec 10, 2023
019091bf
Hide whitespace changes
Inline
Side-by-side
lib/Travel/Status/DE/IRIS/Stations.pm.PL
View file @
019091bf
...
...
@@ -26,16 +26,7 @@ use warnings;
use 5.014;
use utf8;
EOF
if
(
$ENV
{
DB_IRIS_DEB_BUILD
})
{
$buf
.=
"
use Geo::Distance;
\n
"
}
else
{
$buf
.=
"
use GIS::Distance;
\n
";
}
$buf
.=
<<'EOF';
use GIS::Distance;
use List::Util qw(min);
use List::UtilsBy qw(uniq_by);
use List::MoreUtils qw(firstval pairwise);
...
...
@@ -71,11 +62,8 @@ $buf .= <<'EOF';
my $meta = {
EOF
for
my
$eva
(
keys
%
{
$meta
})
{
$buf
.=
sprintf
("
%s => [%s],
\n
",
$eva
,
join
(
q{,}
,
@
{
$meta
->
{
$eva
}})
);
for
my
$eva
(
keys
%
{
$meta
}
)
{
$buf
.=
sprintf
(
"
%s => [%s],
\n
",
$eva
,
join
(
q{,}
,
@
{
$meta
->
{
$eva
}
}
)
);
}
$buf
.=
<<'EOF';
...
...
@@ -130,16 +118,7 @@ sub get_station_by_location {
$num_matches //= 10;
EOF
if
(
$ENV
{
DB_IRIS_DEB_BUILD
})
{
$buf
.=
"
\t
my
\$
dist = Geo::Distance->new();
\n
";
}
else
{
$buf
.=
"
\t
my
\$
dist = GIS::Distance->new();
\n
";
}
$buf
.=
<<'EOF';
my $dist = GIS::Distance->new();
# we only use geolocations inside germany.
# For these, this fast preprocessing step will let through all
...
...
@@ -150,18 +129,8 @@ $buf .= <<'EOF';
and abs( $_->[4] - $lat )
< 1
} @stations;
my @distances
EOF
if
(
$ENV
{
DB_IRIS_DEB_BUILD
})
{
$buf
.=
'
= map { $dist->distance(
\'
kilometer
\'
, $lon, $lat, $_->[3], $_->[4] ) }
';
}
else
{
$buf
.=
'
= map { $dist->distance_metal( $lat, $lon, $_->[4], $_->[3] ) }
';
}
$buf
.=
<<'EOF';
@candidates;
my @distances = map
{ $dist->distance_metal( $lat, $lon, $_->[4], $_->[3] ) } @candidates;
my @station_map = pairwise { [ $a, $b ] } @candidates, @distances;
@station_map = sort { $a->[1] <=> $b->[1] } @station_map;
...
...
scripts/makedeb-docker-helper
View file @
019091bf
...
...
@@ -9,7 +9,7 @@ apt-get update
apt-get
-y
install
\
apt-file dh-make-perl libmodule-build-perl
\
libcache-perl libclass-accessor-perl libdatetime-perl
\
libdatetime-format-strptime-perl libg
eo
-distance-
xs-
perl
\
libdatetime-format-strptime-perl libg
is
-distance-perl
\
liblist-compare-perl liblist-moreutils-perl liblist-utilsby-perl
\
libwww-perl libtext-levenshteinxs-perl libxml-libxml-perl
\
libfile-slurp-perl libjson-perl libjson-xs-perl
\
...
...
@@ -25,8 +25,6 @@ cp -a /orig/bin /orig/examples /orig/lib /orig/share /orig/t /src/app
cd
/src/app
sed
-i
's/sign *=> *1/sign => 0/'
Build.PL
sed
-i
's/GIS::Distance/Geo::Distance/'
Build.PL
export
DB_IRIS_DEB_BUILD
=
1
perl Build.PL
perl Build
perl Build manifest
...
...