Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
abuild
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
13
Issues
13
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
abuild
Commits
27c430cc
Commit
27c430cc
authored
Nov 25, 2018
by
Timothy Legge
Committed by
Natanael Copa
Mar 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates for metacpan
parent
0126fbdf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
apkbuild-cpan.in
apkbuild-cpan.in
+13
-13
No files found.
apkbuild-cpan.in
View file @
27c430cc
...
...
@@ -31,7 +31,7 @@ _pkgreal=[% pkgreal %]
pkgver=[% pkgver %]
pkgrel=0
pkgdesc="Perl module for [% pkgreal %]"
url="http
://search.cpan.org/dist
/[% pkgreal %]/"
url="http
s://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
]
->
{
cpan
id
};
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
("
http
s://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
->
{
dist
vname
}}
=
$moddata
;
$distfiles
->
{
$moddata
->
{
dist
ribution
}}
=
$moddata
;
}
# map package names to alpine packages
foreach
(
keys
%
{
$distfiles
}
)
{
$response
=
$ua
->
get
("
http
://search.cpan.org/api/dist
/
$_
");
$response
=
$ua
->
get
("
http
s://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
("
http
s://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
("
http
s://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
("
http
s://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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment