perl: update to 5.20.1.
This commit is contained in:
parent
78853cfca6
commit
38941d2215
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -1,289 +0,0 @@
|
|||||||
#!/usr/bin/env perl
|
|
||||||
##
|
|
||||||
# Script for printing out a provides list of every CPAN distribution
|
|
||||||
# that is bundled with perl. You can run it before building perl
|
|
||||||
# or you can run it after building perl. Required modules are in core
|
|
||||||
# for perl 5.13 and above. It might be nice if this didn't require
|
|
||||||
# HTTP::Tiny and maybe just used wget or curl.
|
|
||||||
#
|
|
||||||
# This script uses HTTP::Tiny to query Tatsuhiko Miyagawa's webapp at
|
|
||||||
# cpanmetadb.plackperl.org to cross-reference module files to their
|
|
||||||
# providing CPAN distribution. Thank you Miyagawa!
|
|
||||||
#
|
|
||||||
# - Justin "juster" Davis <jrcd83@gmail.com>
|
|
||||||
#
|
|
||||||
# Based on the Archlinux version and modified for xbps.
|
|
||||||
|
|
||||||
use warnings 'FATAL' => 'all';
|
|
||||||
use strict;
|
|
||||||
|
|
||||||
package Common;
|
|
||||||
|
|
||||||
sub evalver
|
|
||||||
{
|
|
||||||
my ($path, $mod) = @_;
|
|
||||||
|
|
||||||
open my $fh, '<', $path or die "open $path: $!";
|
|
||||||
|
|
||||||
my $m = ($mod
|
|
||||||
? qr/(?:\$${mod}::VERSION|\$VERSION)/
|
|
||||||
: qr/\$VERSION/);
|
|
||||||
|
|
||||||
while (my $ln = <$fh>) {
|
|
||||||
next unless $ln =~ /\s*$m\s*=\s*.+/;
|
|
||||||
chomp $ln;
|
|
||||||
my $ver = do { no strict; eval $ln };
|
|
||||||
return $ver unless $@;
|
|
||||||
die qq{$path:$. bad version string in "$ln"\n};
|
|
||||||
}
|
|
||||||
|
|
||||||
close $fh;
|
|
||||||
return undef;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
package Dists;
|
|
||||||
|
|
||||||
sub maindistfile
|
|
||||||
{
|
|
||||||
my ($dist, $dir) = @_;
|
|
||||||
|
|
||||||
# libpath is the modern style, installing modules under lib/
|
|
||||||
# with dirs matching the name components.
|
|
||||||
my $libpath = join q{/}, 'lib', split /-/, "${dist}.pm";
|
|
||||||
|
|
||||||
# dumbpath is an old style where there's no subdirs and just
|
|
||||||
# a .pm file.
|
|
||||||
my $dumbpath = $dist;
|
|
||||||
$dumbpath =~ s/\A.+-//;
|
|
||||||
$dumbpath .= ".pm";
|
|
||||||
|
|
||||||
my @paths = ($libpath, $dumbpath);
|
|
||||||
# Some modules (with simple names like XSLoader, lib, etc) are
|
|
||||||
# generated by Makefile.PL. Search through their generating code.
|
|
||||||
push @paths, "${dist}_pm.PL" if $dist =~ tr/-/-/ == 0;
|
|
||||||
|
|
||||||
for my $path (map { "$dir/$_" } @paths) { return $path if -f $path; }
|
|
||||||
return undef;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub module_ver
|
|
||||||
{
|
|
||||||
my ($dist, $dir) = @_;
|
|
||||||
|
|
||||||
my $path = maindistfile($dist, $dir) or return undef;
|
|
||||||
|
|
||||||
my $mod = $dist;
|
|
||||||
$mod =~ s/-/::/g;
|
|
||||||
my $ver = Common::evalver($path, $mod);
|
|
||||||
unless ($ver) {
|
|
||||||
warn "failed to find version in module file for $dist\n";
|
|
||||||
return undef;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $ver;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub changelog_ver
|
|
||||||
{
|
|
||||||
my ($dist, $dir) = @_;
|
|
||||||
|
|
||||||
my $path;
|
|
||||||
for my $tmp (glob "$dir/{Changes,ChangeLog}") {
|
|
||||||
if (-f $tmp) { $path = $tmp; last; }
|
|
||||||
}
|
|
||||||
return undef unless $path;
|
|
||||||
|
|
||||||
open my $fh, '<', $path or die "open: $!";
|
|
||||||
while (<$fh>) {
|
|
||||||
return $1 if /\A\s*(?:$dist[ \t]*)?([0-9._]+)/;
|
|
||||||
return $1 if /\A\s*version\s+([0-9._]+)/i;
|
|
||||||
}
|
|
||||||
close $fh;
|
|
||||||
|
|
||||||
return undef;
|
|
||||||
}
|
|
||||||
|
|
||||||
# for some reason podlators has a VERSION file with perl code in it
|
|
||||||
sub verfile_ver
|
|
||||||
{
|
|
||||||
my ($dist, $dir) = @_;
|
|
||||||
|
|
||||||
my $path = "$dir/VERSION";
|
|
||||||
return undef unless -f $path; # no warning, only podlaters has it
|
|
||||||
|
|
||||||
return Common::evalver($path);
|
|
||||||
}
|
|
||||||
|
|
||||||
# scans a directory full of nicely separated dist. directories.
|
|
||||||
sub scan_distroot
|
|
||||||
{
|
|
||||||
my ($distroot) = @_;
|
|
||||||
opendir my $cpand, "$distroot" or die "failed to open $distroot";
|
|
||||||
my @dists = grep { !/^\./ && -d "$distroot/$_" } readdir $cpand;
|
|
||||||
closedir $cpand;
|
|
||||||
|
|
||||||
my @found;
|
|
||||||
for my $dist (@dists) {
|
|
||||||
my $distdir = "$distroot/$dist";
|
|
||||||
my $ver = (module_ver($dist, $distdir)
|
|
||||||
|| changelog_ver($dist, $distdir)
|
|
||||||
|| verfile_ver($dist, $distdir));
|
|
||||||
|
|
||||||
if ($ver) { push @found, [ $dist, $ver ]; }
|
|
||||||
else { warn "failed to find version for $dist\n"; }
|
|
||||||
}
|
|
||||||
return @found;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub find
|
|
||||||
{
|
|
||||||
my ($srcdir) = @_;
|
|
||||||
return map { scan_distroot($_) } glob "$srcdir/{cpan,dist}";
|
|
||||||
}
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
package Modules;
|
|
||||||
|
|
||||||
use HTTP::Tiny qw();
|
|
||||||
use File::Find qw();
|
|
||||||
use File::stat;
|
|
||||||
|
|
||||||
*findfile = *File::Find::find;
|
|
||||||
|
|
||||||
sub cpan_provider
|
|
||||||
{
|
|
||||||
my ($module) = @_;
|
|
||||||
my $url = "http://cpanmetadb.plackperl.org/v1.0/package/$module";
|
|
||||||
my $http = HTTP::Tiny->new;
|
|
||||||
my $resp = $http->get($url);
|
|
||||||
return undef unless $resp->{'success'};
|
|
||||||
|
|
||||||
my ($cpanpath) = $resp->{'content'} =~ /^distfile: (.*)$/m
|
|
||||||
or return undef;
|
|
||||||
|
|
||||||
my $dist = $cpanpath;
|
|
||||||
$dist =~ s{\A.+/}{}; # remove author directory
|
|
||||||
$dist =~ s{-[^-]+\z}{}; # remove version and extension
|
|
||||||
return ($dist eq 'perl' ? undef : $dist);
|
|
||||||
}
|
|
||||||
|
|
||||||
sub find
|
|
||||||
{
|
|
||||||
my ($srcdir) = @_;
|
|
||||||
my $libdir = "$srcdir/lib/";
|
|
||||||
die "failed to find $libdir directory" unless -d $libdir;
|
|
||||||
|
|
||||||
# Find only the module files that have not changed since perl
|
|
||||||
# was extracted. We don't want the files perl just recently
|
|
||||||
# installed into lib/. We processed those already.
|
|
||||||
my @modfiles;
|
|
||||||
my $finder = sub {
|
|
||||||
return unless /[.]pm\z/;
|
|
||||||
return if m{\Q$libdir\E[^/]+/t/}; # ignore testing modules
|
|
||||||
push @modfiles, $_;
|
|
||||||
};
|
|
||||||
findfile({ 'no_chdir' => 1, 'wanted' => $finder }, $libdir);
|
|
||||||
|
|
||||||
# First we have to find what the oldest ctime actually is.
|
|
||||||
my $oldest = time;
|
|
||||||
@modfiles = map {
|
|
||||||
my $modfile = $_;
|
|
||||||
my $ctime = (stat $modfile)->ctime;
|
|
||||||
$oldest = $ctime if $ctime < $oldest;
|
|
||||||
[ $modfile, $ctime ]; # save ctime for later
|
|
||||||
} @modfiles;
|
|
||||||
|
|
||||||
# Then we filter out any file that was created more than a
|
|
||||||
# few seconds after that. Process the rest.
|
|
||||||
my @mods;
|
|
||||||
for my $modfile (@modfiles) {
|
|
||||||
my ($mod, $ctime) = @$modfile;
|
|
||||||
next if $ctime - $oldest > 5; # ignore newer files
|
|
||||||
|
|
||||||
my $path = $mod;
|
|
||||||
$mod =~ s{[.]pm\z}{};
|
|
||||||
$mod =~ s{\A$libdir}{};
|
|
||||||
$mod =~ s{/}{::}g;
|
|
||||||
|
|
||||||
my $ver = Common::evalver($path, $mod) || q{};
|
|
||||||
push @mods, [ $mod, $ver ];
|
|
||||||
}
|
|
||||||
|
|
||||||
# Convert modules names to the dist names who provide them.
|
|
||||||
my %seen;
|
|
||||||
my @dists;
|
|
||||||
for my $modref (@mods) {
|
|
||||||
my ($mod, $ver) = @$modref;
|
|
||||||
my $dist = cpan_provider($mod) or next; # filter out core modules
|
|
||||||
next if $seen{$dist}++; # avoid duplicate dists
|
|
||||||
push @dists, [ $dist, $ver ];
|
|
||||||
}
|
|
||||||
return @dists;
|
|
||||||
}
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
package Dist2Pkg;
|
|
||||||
|
|
||||||
sub name
|
|
||||||
{
|
|
||||||
my ($name) = @_;
|
|
||||||
my $orig = $name;
|
|
||||||
|
|
||||||
# Delete leading or trailing hyphens...
|
|
||||||
$name =~ s/\A-|-\z//g;
|
|
||||||
|
|
||||||
die qq{Dist. name '$orig' completely violates packaging standards}
|
|
||||||
unless $name;
|
|
||||||
|
|
||||||
return "perl-$name";
|
|
||||||
}
|
|
||||||
|
|
||||||
sub version
|
|
||||||
{
|
|
||||||
my ($version) = @_;
|
|
||||||
|
|
||||||
# Package versions should be numbers and decimal points only...
|
|
||||||
$version =~ tr/-/./;
|
|
||||||
$version =~ tr/_0-9.-//cd;
|
|
||||||
|
|
||||||
$version =~ tr/././s; # only one period at a time
|
|
||||||
$version =~ s/\A[.]|[.]\z//g; # shouldn't start or stop with a period
|
|
||||||
|
|
||||||
return $version;
|
|
||||||
}
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
package main;
|
|
||||||
|
|
||||||
my %CPANNAME = ('List-Util' => 'Scalar-List-Utils',
|
|
||||||
'Text-Tabs' => 'Text-Tabs+Wrap',
|
|
||||||
'Cwd' => 'PathTools');
|
|
||||||
|
|
||||||
my $perldir = shift or die "Usage: $0 [path to perl source directory]\n";
|
|
||||||
die "$perldir is not a valid directory." unless -d $perldir;
|
|
||||||
|
|
||||||
my @dists = (Dists::find($perldir), Modules::find($perldir));
|
|
||||||
for my $dist (@dists) {
|
|
||||||
my $name = $dist->[0];
|
|
||||||
$dist->[0] = $CPANNAME{$name} if exists $CPANNAME{$name};
|
|
||||||
}
|
|
||||||
|
|
||||||
my @pkgs = map {
|
|
||||||
my ($name, $ver) = @$_;
|
|
||||||
$name = Dist2Pkg::name($name);
|
|
||||||
$ver = Dist2Pkg::version($ver);
|
|
||||||
[ $name, $ver ];
|
|
||||||
} @dists;
|
|
||||||
|
|
||||||
@pkgs = sort { $a->[0] cmp $b->[0] } @pkgs;
|
|
||||||
|
|
||||||
for my $pkg (@pkgs) {
|
|
||||||
my ($name, $ver) = @$pkg;
|
|
||||||
print "$name-$ver\_1\n";
|
|
||||||
}
|
|
269
srcpkgs/perl/files/update-perl-provides.pl
Normal file
269
srcpkgs/perl/files/update-perl-provides.pl
Normal file
@ -0,0 +1,269 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
##
|
||||||
|
## Name:
|
||||||
|
## update-perl-provides
|
||||||
|
##
|
||||||
|
## Description:
|
||||||
|
## Patch the provides list in the perl package PKGBUILD. Scan the appropriate
|
||||||
|
## directories under the perl source tree for directories containing dists
|
||||||
|
## similar to CPAN dists. Search the files in the distributions for VERSION
|
||||||
|
## strings, which are perl expressions. Filters these version strings through
|
||||||
|
## the perl interpreter, then transform the dist. names and versions into
|
||||||
|
## package names and versions. Finally, we cut out the "provides" array from the
|
||||||
|
## template and replace it with the newer version.
|
||||||
|
##
|
||||||
|
## Usage:
|
||||||
|
## update-provides.pl [path to perl source tree] [path to template]
|
||||||
|
##
|
||||||
|
## Caveats:
|
||||||
|
## The path code is not platform independent and will only work in POSIX.
|
||||||
|
##
|
||||||
|
## Changelog:
|
||||||
|
## 07/25/14 JR Updated for void.
|
||||||
|
## 06/10/14 JD Rewrite from scratch for perl 5.20.0 and ArchLinux.
|
||||||
|
##
|
||||||
|
## Authors:
|
||||||
|
## Justin "juster" Davis <jrcd83@gmail.com>
|
||||||
|
## Juan RP <xtraeme@gmail.com>
|
||||||
|
##
|
||||||
|
|
||||||
|
use warnings;
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
sub err
|
||||||
|
{
|
||||||
|
print STDERR "$0: error: @_\n";
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
## Extract the dist. name from its containing directory.
|
||||||
|
sub path_dist
|
||||||
|
{
|
||||||
|
my($path) = @_;
|
||||||
|
$path =~ s{^.*/}{};
|
||||||
|
return $path;
|
||||||
|
}
|
||||||
|
|
||||||
|
## Create a path like $path/lib/Foo/Bar.pm for Foo::Bar.
|
||||||
|
sub lib_modpath
|
||||||
|
{
|
||||||
|
my($path, $modname) = @_;
|
||||||
|
$modname =~ s{::}{/}g;
|
||||||
|
return "$path/lib/$modname.pm";
|
||||||
|
}
|
||||||
|
|
||||||
|
## Create a path to a file in the containing directory, named after
|
||||||
|
## the last segment of the module name, with suffix attached.
|
||||||
|
sub dumb_modpath
|
||||||
|
{
|
||||||
|
my($path, $modname, $suffix) = @_;
|
||||||
|
$modname =~ s{^.*::}{};
|
||||||
|
return "$path/$modname$suffix";
|
||||||
|
}
|
||||||
|
|
||||||
|
## Find a source file contained in the directory that we can scrape the
|
||||||
|
## perl versions string from.
|
||||||
|
my %distmods = (
|
||||||
|
'PathTools' => 'Cwd',
|
||||||
|
'Scalar-List-Utils' => 'List::Util',
|
||||||
|
'IO-Compress' => 'IO::Compress::Gzip',
|
||||||
|
);
|
||||||
|
sub dist_srcpath
|
||||||
|
{
|
||||||
|
my($path) = @_;
|
||||||
|
my $distname = path_dist($path);
|
||||||
|
my $modname;
|
||||||
|
if(exists $distmods{$distname}){
|
||||||
|
$modname = $distmods{$distname};
|
||||||
|
}else{
|
||||||
|
$modname = $distname;
|
||||||
|
$modname =~ s/-/::/g;
|
||||||
|
}
|
||||||
|
my @srcpaths = (
|
||||||
|
lib_modpath($path, $modname),
|
||||||
|
dumb_modpath($path, $modname, '.pm'),
|
||||||
|
dumb_modpath($path, $modname, '_pm.PL'),
|
||||||
|
"$path/VERSION", # for podlators
|
||||||
|
);
|
||||||
|
for my $src (@srcpaths){
|
||||||
|
return $src if(-f $src);
|
||||||
|
}
|
||||||
|
return undef;
|
||||||
|
}
|
||||||
|
|
||||||
|
## Scrape the version string for the module file or Makefile.PL.
|
||||||
|
sub scrape_verln
|
||||||
|
{
|
||||||
|
my($srcpath) = @_;
|
||||||
|
open my $fh, '<', $srcpath or die "open: $!";
|
||||||
|
while(my $ln = <$fh>){
|
||||||
|
if($ln =~ s/^.*VERSION *=>? *//){
|
||||||
|
close $fh;
|
||||||
|
return $ln;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close $fh;
|
||||||
|
err("failed to find VERSION in $srcpath");
|
||||||
|
}
|
||||||
|
|
||||||
|
## Scrape the version string from the module source file.
|
||||||
|
sub scrape_modver
|
||||||
|
{
|
||||||
|
my($srcpath) = @_;
|
||||||
|
return scrape_verln($srcpath);
|
||||||
|
}
|
||||||
|
|
||||||
|
## Scrape the version string from the Makefile.PL. (for libnet)
|
||||||
|
sub scrape_mkplver
|
||||||
|
{
|
||||||
|
my($srcpath) = @_;
|
||||||
|
my $verln = scrape_verln($srcpath);
|
||||||
|
$verln =~ s/,/;/;
|
||||||
|
return $verln;
|
||||||
|
}
|
||||||
|
|
||||||
|
## Scrape the version string from a file inside the dist dir.
|
||||||
|
sub distpath_ver
|
||||||
|
{
|
||||||
|
my($distpath) = @_;
|
||||||
|
my $srcpath = dist_srcpath($distpath);
|
||||||
|
my $mkplpath = "$distpath/Makefile.PL";
|
||||||
|
if(defined $srcpath){
|
||||||
|
return scrape_modver($srcpath);
|
||||||
|
}elsif(-f $mkplpath){
|
||||||
|
return scrape_mkplver($mkplpath);
|
||||||
|
}else{
|
||||||
|
err("failed to scrape version from $distpath");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
## Search the base path for the dist dirs and extract their respective
|
||||||
|
## version strings.
|
||||||
|
sub find_distvers
|
||||||
|
{
|
||||||
|
my($basepath) = @_;
|
||||||
|
opendir my $dh, $basepath or die "opendir: $!";
|
||||||
|
my @dirs = grep { -d $_ } map { "$basepath/$_" } grep { !/^[.]/ } readdir $dh;
|
||||||
|
closedir $dh;
|
||||||
|
|
||||||
|
my @distvers;
|
||||||
|
for my $dpath (@dirs){
|
||||||
|
push @distvers, [ path_dist($dpath), distpath_ver($dpath) ];
|
||||||
|
}
|
||||||
|
return @distvers;
|
||||||
|
}
|
||||||
|
|
||||||
|
## Maps an aref of dist name/perl version strings (perl expressions) to
|
||||||
|
## a package name and version string suitable for a PKGBUILD.
|
||||||
|
sub pkgspec
|
||||||
|
{
|
||||||
|
my($dist, $ver) = @$_;
|
||||||
|
## print STDOUT "dist $dist\n";
|
||||||
|
## $dist =~ tr/-/./;
|
||||||
|
#print STDOUT "1 dist $dist\n";
|
||||||
|
#$dist =~ tr/_0-9.-//cd;
|
||||||
|
#print STDOUT "2 dist $dist\n";
|
||||||
|
$ver =~ tr/././s; # only one period at a time
|
||||||
|
$ver =~ s/\A[.]|[.]\z//g; # shouldn't start or stop with a period
|
||||||
|
$ver = eval $ver;
|
||||||
|
my $rev = "_1";
|
||||||
|
my $res = "perl-$dist-$ver" . $rev;
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
|
## Searches the perl source dir provided for a list of packages which
|
||||||
|
## correspond to the core distributions bundled within in.
|
||||||
|
sub perlcorepkgs
|
||||||
|
{
|
||||||
|
my($perlpath) = @_;
|
||||||
|
my @dirs = ("$perlpath/cpan", "$perlpath/dist");
|
||||||
|
my @provs;
|
||||||
|
for my $d (@dirs){
|
||||||
|
if(!-d $d){
|
||||||
|
err("$d is not a valid directory");
|
||||||
|
}
|
||||||
|
push @provs, map pkgspec, find_distvers($d);
|
||||||
|
}
|
||||||
|
return @provs;
|
||||||
|
}
|
||||||
|
|
||||||
|
## Formats the provided lines into a neatly formatted bash array. The first arg
|
||||||
|
## is the name of the bash variable to assign it to.
|
||||||
|
sub basharray
|
||||||
|
{
|
||||||
|
my $vname = shift;
|
||||||
|
|
||||||
|
## Sort entries and surround with quotes.
|
||||||
|
my @lns = sort map { qq{$_} } @_;
|
||||||
|
$lns[0] = "$vname=\"$lns[0]";
|
||||||
|
|
||||||
|
## Indent lines for OCD geeks.
|
||||||
|
if(@lns > 1){
|
||||||
|
my $ind = length($vname) + 2;
|
||||||
|
splice @lns, 1, @lns-1,
|
||||||
|
map { (' ' x $ind) . $_ } @lns[1 .. $#lns];
|
||||||
|
}
|
||||||
|
|
||||||
|
$lns[$#lns] .= '"';
|
||||||
|
return map { "$_\n" } @lns;
|
||||||
|
}
|
||||||
|
|
||||||
|
## Patch the PKGBUILD at the given path with a new provides array, overwriting
|
||||||
|
## the old one.
|
||||||
|
sub patchpb
|
||||||
|
{
|
||||||
|
my $pbpath = shift;
|
||||||
|
open my $fh, '<', $pbpath or die "open: $!";
|
||||||
|
my @lines = <$fh>;
|
||||||
|
close $fh;
|
||||||
|
|
||||||
|
my($i, $j);
|
||||||
|
for($i = 0; $i < @lines; $i++){
|
||||||
|
last if($lines[$i] =~ /^provides="/);
|
||||||
|
}
|
||||||
|
if($i == @lines){
|
||||||
|
err("failed to find provides array in xbps template");
|
||||||
|
}
|
||||||
|
for($j = $i; $j < @lines; $j++){
|
||||||
|
last if($lines[$j] =~ /["]/);
|
||||||
|
}
|
||||||
|
if($j == @lines){
|
||||||
|
err("failed to find end of provides array");
|
||||||
|
}
|
||||||
|
|
||||||
|
splice @lines, $i, $j-$i+1,
|
||||||
|
basharray('provides', grep { !/win32|next/ } @_);
|
||||||
|
|
||||||
|
## Avoid corrupting the existing template in case of a crash, etc.
|
||||||
|
if(-f "$pbpath.$$"){
|
||||||
|
err("pbpath.$$ temporary file already exists, please remove it.");
|
||||||
|
}
|
||||||
|
open $fh, '>', "$pbpath.$$" or die "open: $!";
|
||||||
|
print $fh @lines;
|
||||||
|
close $fh or die "close: $!";
|
||||||
|
rename "$pbpath.$$", "$pbpath" or die "rename: $!";
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
## Program entrypoint.
|
||||||
|
sub main
|
||||||
|
{
|
||||||
|
if(@_ < 2){
|
||||||
|
print STDERR "usage: $0 [perl source path] [template path]\n";
|
||||||
|
exit 2;
|
||||||
|
}
|
||||||
|
my($perlpath, $pbpath) = @_;
|
||||||
|
if(!-f $pbpath){
|
||||||
|
err("$pbpath is not a valid file.");
|
||||||
|
}elsif(!-d $perlpath){
|
||||||
|
err("$perlpath is not a valid directory.");
|
||||||
|
}else{
|
||||||
|
patchpb($pbpath, perlcorepkgs($perlpath));
|
||||||
|
}
|
||||||
|
exit 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
main(@ARGV);
|
||||||
|
|
||||||
|
# EOF
|
@ -1,6 +1,6 @@
|
|||||||
--- Makefile.SH.orig 2013-02-23 12:44:25.420587388 +0100
|
--- Makefile.SH 2014-09-14 13:30:59.000000000 +0200
|
||||||
+++ Makefile.SH 2013-02-23 12:51:32.923426243 +0100
|
+++ Makefile.SH 2014-09-22 18:06:16.402316893 +0200
|
||||||
@@ -302,10 +302,12 @@ LIB_EXT = $_a
|
@@ -308,6 +308,7 @@
|
||||||
OBJ_EXT = $_o
|
OBJ_EXT = $_o
|
||||||
PATH_SEP = $p_
|
PATH_SEP = $p_
|
||||||
|
|
||||||
@ -8,12 +8,7 @@
|
|||||||
# Macros to invoke a copy of miniperl during the build. Targets which
|
# Macros to invoke a copy of miniperl during the build. Targets which
|
||||||
# are built using these macros should depend on \$(MINIPERL_EXE)
|
# are built using these macros should depend on \$(MINIPERL_EXE)
|
||||||
MINIPERL_EXE = miniperl\$(EXE_EXT)
|
MINIPERL_EXE = miniperl\$(EXE_EXT)
|
||||||
MINIPERL = \$(LDLIBPTH) \$(RUN) ./miniperl\$(EXE_EXT) -Ilib
|
@@ -336,6 +337,23 @@
|
||||||
+HOST_MINIPERL = $(MINIPERL_EXE)
|
|
||||||
|
|
||||||
# Macros to invoke a copy of our fully operational perl during the build.
|
|
||||||
PERL_EXE = perl\$(EXE_EXT)
|
|
||||||
@@ -314,6 +316,23 @@ RUN_PERL = \$(LDLIBPTH) \$(RUN) ./perl\$
|
|
||||||
# Macros to run our tests
|
# Macros to run our tests
|
||||||
RUN_TESTS = \$(LDLIBPTH) ./runtests
|
RUN_TESTS = \$(LDLIBPTH) ./runtests
|
||||||
|
|
||||||
@ -37,7 +32,7 @@
|
|||||||
dynamic_ext = $dynamic_list
|
dynamic_ext = $dynamic_list
|
||||||
dynamic_ext_re = $dynamic_ext_re
|
dynamic_ext_re = $dynamic_ext_re
|
||||||
static_ext = $static_list
|
static_ext = $static_list
|
||||||
@@ -559,6 +578,9 @@ all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) $(
|
@@ -569,6 +587,9 @@
|
||||||
@echo " ";
|
@echo " ";
|
||||||
@echo " Everything is up to date. Type '$(MAKE) test' to run test suite."
|
@echo " Everything is up to date. Type '$(MAKE) test' to run test suite."
|
||||||
|
|
||||||
@ -47,7 +42,7 @@
|
|||||||
.PHONY: all translators utilities
|
.PHONY: all translators utilities
|
||||||
|
|
||||||
# Both git_version.h and lib/Config_git.pl are built
|
# Both git_version.h and lib/Config_git.pl are built
|
||||||
@@ -649,6 +671,9 @@ $spitshell >>$Makefile <<'!NO!SUBS!'
|
@@ -666,6 +687,9 @@
|
||||||
|
|
||||||
globals$(OBJ_EXT): $(generated_headers)
|
globals$(OBJ_EXT): $(generated_headers)
|
||||||
|
|
||||||
@ -56,28 +51,12 @@
|
|||||||
+# provided already
|
+# provided already
|
||||||
uudmap.h mg_data.h: bitcount.h
|
uudmap.h mg_data.h: bitcount.h
|
||||||
|
|
||||||
bitcount.h: generate_uudmap$(HOST_EXE_EXT)
|
generate_uudmap$(OBJ_EXT): mg_raw.h
|
||||||
@@ -658,6 +683,7 @@ generate_uudmap$(OBJ_EXT): mg_raw.h
|
@@ -690,6 +714,7 @@
|
||||||
|
$spitshell >>$Makefile <<'!NO!SUBS!'
|
||||||
generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT)
|
generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT)
|
||||||
$(CC) -o generate_uudmap$(EXE_EXT) $(LDFLAGS) generate_uudmap$(OBJ_EXT) $(libs)
|
$(CC) -o generate_uudmap$(EXE_EXT) $(LDFLAGS) generate_uudmap$(OBJ_EXT) $(libs)
|
||||||
+endif
|
+endif
|
||||||
|
|
||||||
miniperlmain$(OBJ_EXT): miniperlmain.c patchlevel.h
|
|
||||||
$(CCCMD) $(PLDLFLAGS) $*.c
|
|
||||||
@@ -869,9 +895,15 @@ $(MINIPERL_EXE): $& $(mini_obj)
|
|
||||||
$spitshell >>$Makefile <<'!NO!SUBS!'
|
|
||||||
$(MINIPERL_EXE): $& $(mini_obj)
|
|
||||||
-@rm -f miniperl.xok
|
|
||||||
+ifeq (,$(CROSS_PERL))
|
|
||||||
$(LDLIBPTH) $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
|
|
||||||
$(mini_obj) $(libs)
|
|
||||||
$(LDLIBPTH) $(RUN) ./miniperl$(HOST_EXE_EXT) -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
|
|
||||||
+else
|
|
||||||
+ -rm $(MINIPERL_EXE)
|
|
||||||
+ ln -s $(HOST_MINIPERL) $(MINIPERL_EXE)
|
|
||||||
+endif
|
|
||||||
+
|
|
||||||
!NO!SUBS!
|
!NO!SUBS!
|
||||||
;;
|
;;
|
||||||
esac
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Template build file for 'perl'.
|
# Template build file for 'perl'.
|
||||||
pkgname=perl
|
pkgname=perl
|
||||||
version=5.18.2
|
version=5.20.1
|
||||||
revision=5
|
revision=1
|
||||||
hostmakedepends="which less"
|
hostmakedepends="which less"
|
||||||
makedepends="zlib-devel bzip2-devel gdbm-devel db-devel>=5.3"
|
makedepends="zlib-devel bzip2-devel gdbm-devel db-devel>=5.3"
|
||||||
short_desc="Practical Extraction and Report Language"
|
short_desc="Practical Extraction and Report Language"
|
||||||
@ -9,143 +9,131 @@ maintainer="Juan RP <xtraeme@gmail.com>"
|
|||||||
homepage="http://www.perl.org"
|
homepage="http://www.perl.org"
|
||||||
license="Artistic, GPL-1"
|
license="Artistic, GPL-1"
|
||||||
distfiles="http://www.cpan.org/src/5.0/perl-${version}.tar.gz"
|
distfiles="http://www.cpan.org/src/5.0/perl-${version}.tar.gz"
|
||||||
checksum=7cbed5ef11900e8f68041215eea0de5e443d53393f84c41d5c9c69c150a4982f
|
checksum=fef10210f9e6f4dc2d190be0aee8e1fa2af664630f1d415868d33eebca26d4b5
|
||||||
|
|
||||||
provides="
|
provides="perl-Archive-Tar-1.96_1
|
||||||
perl-Archive-Extract-0.68_1
|
perl-Attribute-Handlers-0.96_1
|
||||||
perl-Archive-Tar-1.90_1
|
perl-AutoLoader-5.74_1
|
||||||
perl-Attribute-Handlers-0.94_1
|
perl-B-Debug-1.19_1
|
||||||
perl-AutoLoader-5.73_1
|
perl-CGI-3.65_1
|
||||||
perl-B-Debug-1.18_1
|
perl-CPAN-2.05_1
|
||||||
perl-B-Deparse-1.20_1
|
perl-CPAN-Meta-2.140640_1
|
||||||
perl-B-Lint-1.17_1
|
perl-CPAN-Meta-Requirements-2.125_1
|
||||||
perl-CGI-3.63_1
|
perl-CPAN-Meta-YAML-0.012_1
|
||||||
perl-CPAN-2.00_1
|
perl-Carp-1.3301_1
|
||||||
perl-CPAN-Meta-2.120921_1
|
perl-Compress-Raw-Bzip2-2.064_1
|
||||||
perl-CPAN-Meta-Requirements-2.122_1
|
perl-Compress-Raw-Zlib-2.065_1
|
||||||
perl-CPAN-Meta-YAML-0.008_1
|
perl-Config-Perl-V-0.22_1
|
||||||
perl-CPANPLUS-0.9135_1
|
perl-DB_File-1.831_1
|
||||||
perl-CPANPLUS-Dist-Build-0.70_1
|
perl-Data-Dumper-2.151_1
|
||||||
perl-Carp-1.29_1
|
perl-Devel-PPPort-3.21_1
|
||||||
perl-Compress-Raw-Bzip2-2.060_1
|
|
||||||
perl-Compress-Raw-Zlib-2.060_1
|
|
||||||
perl-Config-Perl-V-0.17_1
|
|
||||||
perl-DB_File-1.827_1
|
|
||||||
perl-Data-Dumper-2.145_1
|
|
||||||
perl-Devel-PPPort-3.20_1
|
|
||||||
perl-Devel-SelfStubber-1.05_1
|
perl-Devel-SelfStubber-1.05_1
|
||||||
perl-Digest-1.17_1
|
perl-Digest-1.17_1
|
||||||
perl-Digest-MD5-2.52_1
|
perl-Digest-MD5-2.53_1
|
||||||
perl-Digest-SHA-5.84_01_1
|
perl-Digest-SHA-5.88_1
|
||||||
perl-Dumpvalue-1.17_1
|
perl-Dumpvalue-1.17_1
|
||||||
perl-Encode-2.49_1
|
perl-Encode-2.60_1
|
||||||
perl-Env-1.04_1
|
perl-Env-1.04_1
|
||||||
perl-Exporter-5.68_1
|
perl-Exporter-5.71_1
|
||||||
perl-ExtUtils-CBuilder-0.280210_1
|
perl-ExtUtils-CBuilder-0.280217_1
|
||||||
perl-ExtUtils-Command-1.17_1
|
perl-ExtUtils-Command-1.18_1
|
||||||
perl-ExtUtils-Constant-0.23_1
|
perl-ExtUtils-Constant-0.23_1
|
||||||
perl-ExtUtils-Install-1.59_1
|
perl-ExtUtils-Install-1.67_1
|
||||||
perl-ExtUtils-MakeMaker-6.66_1
|
perl-ExtUtils-MakeMaker-6.98_1
|
||||||
perl-ExtUtils-Manifest-1.63_1
|
perl-ExtUtils-Manifest-1.63_1
|
||||||
perl-ExtUtils-ParseXS-3.18_1
|
perl-ExtUtils-ParseXS-3.24_1
|
||||||
perl-File-CheckTree-4.42_1
|
perl-File-Fetch-0.48_1
|
||||||
perl-File-Fetch-0.38_1
|
|
||||||
perl-File-Path-2.09_1
|
perl-File-Path-2.09_1
|
||||||
perl-File-Temp-0.23_1
|
perl-File-Temp-0.2304_1
|
||||||
perl-Filter-Simple-0.89_1
|
perl-Filter-Simple-0.91_1
|
||||||
perl-Filter-Util-Call-1.45_1
|
perl-Filter-Util-Call-1.49_1
|
||||||
perl-Getopt-Long-2.39_1
|
perl-Getopt-Long-2.42_1
|
||||||
perl-HTTP-Tiny-0.025_1
|
perl-HTTP-Tiny-0.043_1
|
||||||
perl-I18N-Collate-1.02_1
|
perl-I18N-Collate-1.02_1
|
||||||
perl-I18N-LangTags-0.39_1
|
perl-I18N-LangTags-0.40_1
|
||||||
perl-IO-1.28_1
|
perl-IO-1.31_1
|
||||||
perl-IO-Compress-2.060_1
|
perl-IO-Compress-2.064_1
|
||||||
|
perl-IO-Socket-IP-0.29_1
|
||||||
perl-IO-Zlib-1.10_1
|
perl-IO-Zlib-1.10_1
|
||||||
perl-IPC-Cmd-0.80_1
|
perl-IPC-Cmd-0.92_1
|
||||||
perl-IPC-SysV-2.03_1
|
perl-IPC-SysV-2.04_1
|
||||||
perl-JSON-PP-2.27202_1
|
perl-JSON-PP-2.27203_1
|
||||||
perl-Locale-Codes-3.25_1
|
perl-Locale-Codes-3.30_1
|
||||||
perl-Locale-Maketext-1.23_1
|
perl-Locale-Maketext-1.25_1
|
||||||
perl-Locale-Maketext-Simple-0.21_1
|
perl-Locale-Maketext-Simple-0.21_1
|
||||||
perl-Log-Message-0.06_1
|
perl-MIME-Base64-3.14_1
|
||||||
perl-Log-Message-Simple-0.10_1
|
perl-Math-BigInt-1.9993_1
|
||||||
perl-MIME-Base64-3.13_1
|
perl-Math-BigInt-FastCalc-0.31_1
|
||||||
perl-Math-BigInt-1.9991_1
|
perl-Math-BigRat-0.2606_1
|
||||||
perl-Math-BigInt-FastCalc-0.30_1
|
|
||||||
perl-Math-BigRat-0.2604_1
|
|
||||||
perl-Math-Complex-1.59_1
|
perl-Math-Complex-1.59_1
|
||||||
perl-Memoize-1.03_1
|
perl-Memoize-1.03_1
|
||||||
perl-Module-Build-0.4003_1
|
perl-Module-Build-0.4205_1
|
||||||
perl-Module-CoreList-3.03_1
|
perl-Module-CoreList-5.020001_1
|
||||||
perl-Module-Load-0.24_1
|
perl-Module-Load-0.32_1
|
||||||
perl-Module-Load-Conditional-0.54_1
|
perl-Module-Load-Conditional-0.62_1
|
||||||
perl-Module-Loaded-0.08_1
|
perl-Module-Loaded-0.08_1
|
||||||
perl-Module-Metadata-1.000011_1
|
perl-Module-Metadata-1.000019_1
|
||||||
perl-Module-Pluggable-4.7_1
|
|
||||||
perl-NEXT-0.65_1
|
perl-NEXT-0.65_1
|
||||||
perl-Net-Ping-2.41_1
|
perl-Net-Ping-2.43_1
|
||||||
perl-Object-Accessor-0.46_1
|
perl-Package-Constants-0.04_1
|
||||||
perl-Package-Constants-0.02_1
|
perl-Params-Check-0.38_1
|
||||||
perl-Params-Check-0.36_1
|
perl-Parse-CPAN-Meta-1.4414_1
|
||||||
perl-Parse-CPAN-Meta-1.4404_1
|
perl-PathTools-3.48_1
|
||||||
perl-PathTools-3.40_1
|
perl-Perl-OSType-1.007_1
|
||||||
perl-Perl-OSType-1.003_1
|
|
||||||
perl-PerlIO-via-QuotedPrint-0.07_1
|
perl-PerlIO-via-QuotedPrint-0.07_1
|
||||||
perl-Pod-Checker-1.60_1
|
perl-Pod-Checker-1.60_1
|
||||||
perl-Pod-Escapes-1.04_1
|
perl-Pod-Escapes-1.06_1
|
||||||
perl-Pod-LaTeX-0.61_1
|
perl-Pod-Parser-1.62_1
|
||||||
perl-Pod-Parser-1.60_1
|
perl-Pod-Perldoc-3.23_1
|
||||||
perl-Pod-Perldoc-3.19_1
|
|
||||||
perl-Pod-Simple-3.28_1
|
perl-Pod-Simple-3.28_1
|
||||||
perl-Pod-Usage-1.61_1
|
perl-Pod-Usage-1.63_1
|
||||||
perl-Safe-2.35_1
|
perl-Safe-2.37_1
|
||||||
perl-Scalar-List-Utils-1.27_1
|
perl-Scalar-List-Utils-1.38_1
|
||||||
perl-Search-Dict-1.07_1
|
perl-Search-Dict-1.07_1
|
||||||
perl-SelfLoader-1.21_1
|
perl-SelfLoader-1.21_1
|
||||||
perl-Socket-2.009_1
|
perl-Socket-2.013_1
|
||||||
perl-Storable-2.41_1
|
perl-Storable-2.49_1
|
||||||
perl-Sys-Syslog-0.32_1
|
perl-Sys-Syslog-0.33_1
|
||||||
perl-Term-ANSIColor-4.02_1
|
perl-Term-ANSIColor-4.02_1
|
||||||
perl-Term-Cap-1.13_1
|
perl-Term-Cap-1.15_1
|
||||||
perl-Term-Complete-1.402_1
|
perl-Term-Complete-1.402_1
|
||||||
perl-Term-ReadLine-1.12_1
|
perl-Term-ReadLine-1.14_1
|
||||||
perl-Term-UI-0.34_1
|
|
||||||
perl-Test-1.26_1
|
perl-Test-1.26_1
|
||||||
perl-Test-Harness-3.26_1
|
perl-Test-Harness-3.30_1
|
||||||
perl-Test-Simple-0.98_1
|
perl-Test-Simple-1.001002_1
|
||||||
perl-Text-Abbrev-1.02_1
|
perl-Text-Abbrev-1.02_1
|
||||||
perl-Text-Balanced-2.02_1
|
perl-Text-Balanced-2.02_1
|
||||||
perl-Text-ParseWords-3.28_1
|
perl-Text-ParseWords-3.29_1
|
||||||
perl-Text-Soundex-3.04_1
|
perl-Text-Tabs-2013.0523_1
|
||||||
perl-Text-Tabs+Wrap-2012.0818_1
|
perl-Thread-Queue-3.05_1
|
||||||
perl-Thread-Queue-3.02_1
|
|
||||||
perl-Thread-Semaphore-2.12_1
|
perl-Thread-Semaphore-2.12_1
|
||||||
perl-Tie-File-0.99_1
|
perl-Tie-File-1.00_1
|
||||||
perl-Tie-RefHash-1.39_1
|
perl-Tie-RefHash-1.39_1
|
||||||
perl-Time-HiRes-1.9725_1
|
perl-Time-HiRes-1.9726_1
|
||||||
perl-Time-Local-1.2300_1
|
perl-Time-Local-1.2300_1
|
||||||
perl-Time-Piece-1.20_01_1
|
perl-Time-Piece-1.27_1
|
||||||
perl-Unicode-Collate-0.97_1
|
perl-Unicode-Collate-1.04_1
|
||||||
perl-Unicode-Normalize-1.16_1
|
perl-Unicode-Normalize-1.17_1
|
||||||
perl-Win32-0.47_1
|
perl-Win32-0.49_1
|
||||||
perl-Win32API-File-0.1201_1
|
perl-Win32API-File-0.1201_1
|
||||||
perl-XSLoader-0.16_1
|
perl-XSLoader-0.17_1
|
||||||
perl-autodie-2.13_1
|
perl-autodie-2.23_1
|
||||||
perl-autouse-1.07_1
|
perl-autouse-1.08_1
|
||||||
perl-base-2.18_1
|
perl-base-2.22_1
|
||||||
perl-bignum-0.33_1
|
perl-bignum-0.37_1
|
||||||
perl-constant-1.27_1
|
perl-constant-1.31_1
|
||||||
perl-encoding-warnings-0.11_1
|
perl-encoding-warnings-0.11_1
|
||||||
perl-if-0.0602_1
|
perl-experimental-0.007_1
|
||||||
|
perl-if-0.0603_1
|
||||||
perl-lib-0.63_1
|
perl-lib-0.63_1
|
||||||
perl-libnet-1.22_1
|
perl-libnet-1.25_1
|
||||||
perl-parent-0.225_1
|
perl-parent-0.228_1
|
||||||
perl-perlfaq-5.0150042_1
|
perl-perlfaq-5.0150044_1
|
||||||
perl-podlators-2.5.1_1
|
perl-podlators-2.5.3_1
|
||||||
perl-threads-1.86_1
|
perl-threads-1.93_1
|
||||||
perl-threads-shared-1.43_1
|
perl-threads-shared-1.46_1
|
||||||
perl-version-0.9902_1
|
perl-version-0.9909_1"
|
||||||
"
|
|
||||||
for f in ${provides}; do
|
for f in ${provides}; do
|
||||||
replaces+=" $($XBPS_UHELPER_CMD getpkgname ${f})>=0"
|
replaces+=" $($XBPS_UHELPER_CMD getpkgname ${f})>=0"
|
||||||
done
|
done
|
||||||
@ -239,7 +227,7 @@ do_install() {
|
|||||||
find ${DESTDIR} -type f -name \*.so -exec chmod 644 {} \;
|
find ${DESTDIR} -type f -name \*.so -exec chmod 644 {} \;
|
||||||
|
|
||||||
# Make a link from perl${version} to perl.
|
# Make a link from perl${version} to perl.
|
||||||
ln -sf /usr/bin/perl${version} ${DESTDIR}/usr/bin/perl
|
ln -sf perl${version} ${DESTDIR}/usr/bin/perl
|
||||||
|
|
||||||
### CPAN Settings ###
|
### CPAN Settings ###
|
||||||
# Set CPAN default config to use the site directories.
|
# Set CPAN default config to use the site directories.
|
||||||
@ -247,12 +235,6 @@ do_install() {
|
|||||||
-e '/(mbuildpl_arg =>/ s/""/"installdirs=site"/' \
|
-e '/(mbuildpl_arg =>/ s/""/"installdirs=site"/' \
|
||||||
-i ${DESTDIR}/usr/share/perl5/core_perl/CPAN/FirstTime.pm
|
-i ${DESTDIR}/usr/share/perl5/core_perl/CPAN/FirstTime.pm
|
||||||
|
|
||||||
### CPANPLUS Settings ###
|
|
||||||
# Set CPANPLUS default config to use the site directories.
|
|
||||||
sed -e "/{'makemakerflags'}/ s/'';/'INSTALLDIRS=site';/" \
|
|
||||||
-e "/{'buildflags'}/ s/'';/'installdirs=site';/" \
|
|
||||||
-i ${DESTDIR}/usr/share/perl5/core_perl/CPANPLUS/Config.pm
|
|
||||||
|
|
||||||
# Remove all pod files *except* those under
|
# Remove all pod files *except* those under
|
||||||
# /usr/share/perl5/core_perl/pod/ (FS#16488)
|
# /usr/share/perl5/core_perl/pod/ (FS#16488)
|
||||||
rm -f ${DESTDIR}/usr/share/perl5/core_perl/*.pod
|
rm -f ${DESTDIR}/usr/share/perl5/core_perl/*.pod
|
||||||
@ -265,6 +247,5 @@ do_install() {
|
|||||||
find ${DESTDIR} -name .packlist -delete
|
find ${DESTDIR} -name .packlist -delete
|
||||||
|
|
||||||
# Make a symlink so that libperl.so is accesible.
|
# Make a symlink so that libperl.so is accesible.
|
||||||
cd ${DESTDIR}/usr/lib && \
|
ln -sfr ${DESTDIR}/usr/lib/perl5/core_perl/CORE/libperl.so ${DESTDIR}/usr/lib/libperl.so
|
||||||
ln -sf ./perl5/core_perl/CORE/libperl.so libperl.so
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user