summaryrefslogtreecommitdiffstats
path: root/apkbuild-cpan.in
diff options
context:
space:
mode:
authorTimothy Legge <timlegge@gmail.com>2018-11-25 01:51:08 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2019-03-20 17:10:15 +0000
commit27c430cc64e7ea59c7e5610809bac23cc7191d74 (patch)
treedbc07ee62321838a93ef0f3830f2ebcb3d43f0e9 /apkbuild-cpan.in
parent0126fbdffbb70161ee65ac284a9e36249f687efd (diff)
downloadabuild-27c430cc64e7ea59c7e5610809bac23cc7191d74.tar.bz2
abuild-27c430cc64e7ea59c7e5610809bac23cc7191d74.tar.xz
Updates for metacpan
Diffstat (limited to 'apkbuild-cpan.in')
-rw-r--r--apkbuild-cpan.in26
1 files changed, 13 insertions, 13 deletions
diff --git a/apkbuild-cpan.in b/apkbuild-cpan.in
index 8160042..62ba4d5 100644
--- a/apkbuild-cpan.in
+++ b/apkbuild-cpan.in
@@ -31,7 +31,7 @@ _pkgreal=[% pkgreal %]
pkgver=[% pkgver %]
pkgrel=0
pkgdesc="Perl module for [% pkgreal %]"
-url="http://search.cpan.org/dist/[% pkgreal %]/"
+url="https://metacpan.org/release/[% pkgreal %]/"
arch="noarch"
license="GPL PerlArtistic"
cpandepends=""
@@ -110,15 +110,15 @@ sub read_apkbuild {
sub write_apkbuild {
my ($distdata, $authors) = @_;
- my $cpanid = $distdata->{releases}[0]->{cpanid};
+ my $cpanid = $distdata->{releases}[0]->{id};
$cpanid = substr($cpanid, 0, 1) . "/" . substr($cpanid, 0, 2) . "/$cpanid";
my %repl = (
authors => ($authors or "# Contributor: $packager\n# Maintainer: $packager"),
- pkgname => map_cpan_to_apk($distdata->{name}),
- pkgreal => $distdata->{name},
- pkgver => $distdata->{releases}[0]->{version},
- source => "http://search.cpan.org/CPAN/authors/id/$cpanid/\$_pkgreal-\$pkgver.tar.gz",
+ pkgname => map_cpan_to_apk($distdata->{metadata}{name}),
+ pkgreal => $distdata->{metadata}{name},
+ pkgver => $distdata->{version},
+ source => $distdata->{download_url},
);
$template =~ s/\[% (.*?) %\]/$repl{$1}/g;
@@ -143,16 +143,16 @@ sub parse_deps {
next if $module eq 'perl';
# map module name to package name
- $response = $ua->get("http://search.cpan.org/api/module/$module");
+ $response = $ua->get("https://fastapi.metacpan.org/module/$module");
$response->is_success or die $response->status_line;
my $moddata = $json->decode($response->decoded_content);
$moddata->{error} and die "Error trying to locate $module: $moddata->{error}\n";
- $distfiles->{$moddata->{distvname}} = $moddata;
+ $distfiles->{$moddata->{distribution}} = $moddata;
}
# map package names to alpine packages
foreach ( keys %{ $distfiles } ) {
- $response = $ua->get("http://search.cpan.org/api/dist/$_");
+ $response = $ua->get("https://fastapi.metacpan.org/releases/$_");
$response->is_success or die $response->status_line;
my $distdata = $json->decode($response->decoded_content);
$distdata->{error} and die "Error trying to locate $_: $distdata->{error}\n";
@@ -317,7 +317,7 @@ sub do_depends {
sub get_data {
my $apkbuild = read_apkbuild;
$apkbuild->{_pkgreal} or die "Not apkbuild-cpan generated APKBUILD";
- my $response = $ua->get("http://search.cpan.org/api/dist/$apkbuild->{_pkgreal}");
+ my $response = $ua->get("https://fastapi.metacpan.org/release/$apkbuild->{_pkgreal}");
$response->is_success or die $response->status_line;
my $distdata = $json->decode($response->decoded_content);
$distdata->{error} and die "Error trying to locate $apkbuild->{_pkgreal}: $distdata->{error}\n";
@@ -337,17 +337,17 @@ given ( $ARGV[0] ) {
my $response;
$module or die "Module name is a mandatory argument";
- $response = $ua->get("http://search.cpan.org/api/module/$module");
+ $response = $ua->get("https://fastapi.metacpan.org/module/$module");
$response->is_success or die $response->status_line;
my $moddata = $json->decode($response->decoded_content);
$moddata->{error} and die "Error trying to locate $module: $moddata->{error}\n";
- $response = $ua->get("http://search.cpan.org/api/dist/$moddata->{distvname}");
+ $response = $ua->get("https://fastapi.metacpan.org/release/$moddata->{distribution}");
$response->is_success or die $response->status_line;
my $distdata = $json->decode($response->decoded_content);
$distdata->{error} and die "Error trying to locate $module: $distdata->{error}\n";
- my $apkname = map_cpan_to_apk $distdata->{name};
+ my $apkname = map_cpan_to_apk $distdata->{metadata}{name};
mkdir $apkname;
chdir $apkname;
write_apkbuild($distdata);