summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2011-09-30 23:14:37 +0000
committerroot <root@rshg054.dnsready.net>2011-09-30 23:14:37 +0000
commit22b22c6e016b2a86a0d25e68eeb3fdec286f5352 (patch)
tree93ecb94f6ea9f0bb18ce99406827ed2d633cd13b /core
parent0abb1942e8be584d56a1b35b2d1911cbe9f5bbd1 (diff)
Fri Sep 30 23:14:37 UTC 2011
Diffstat (limited to 'core')
-rw-r--r--core/logrotate/PKGBUILD14
-rw-r--r--core/logrotate/logrotate-3.8.1-noasprintf.patch53
-rw-r--r--core/perl/PKGBUILD14
-rw-r--r--core/perl/perl.install8
-rw-r--r--core/perl/provides.pl286
5 files changed, 356 insertions, 19 deletions
diff --git a/core/logrotate/PKGBUILD b/core/logrotate/PKGBUILD
index 901a55b64..c59ae4eca 100644
--- a/core/logrotate/PKGBUILD
+++ b/core/logrotate/PKGBUILD
@@ -1,10 +1,10 @@
-# $Id: PKGBUILD 136351 2011-08-27 04:08:31Z allan $
+# $Id: PKGBUILD 139123 2011-09-30 02:57:48Z eric $
# Maintainer: Aaron Griffin <aaron@archlinux.org>
# Contributor: Judd Vinet <jvinet@zeroflux.org>
pkgname=logrotate
-pkgver=3.8.0
-pkgrel=2
+pkgver=3.8.1
+pkgrel=1
pkgdesc="Rotates system logs automatically"
arch=('i686' 'x86_64')
url="https://fedorahosted.org/logrotate/"
@@ -13,18 +13,18 @@ groups=('base')
depends=('popt' 'cron' 'gzip')
backup=('etc/logrotate.conf')
source=(https://fedorahosted.org/releases/l/o/logrotate/logrotate-${pkgver}.tar.gz
- logrotate-3.8.0-noasprintf.patch
+ logrotate-3.8.1-noasprintf.patch
logrotate.conf
logrotate.cron.daily)
-md5sums=('590f77c13077a4c384dbec7ca9c5f242'
- '624801859beb9abe7958b6392c854d72'
+md5sums=('bd2e20d8dc644291b08f9215397d28a5'
+ 'fc8e4e15211d8aefd431d0e2e96223c4'
'462a5f364717461537eb2ae6394ad23e'
'8e23d5d4cc29b1e055b24df87e355cdc')
build() {
cd "$srcdir/${pkgname}-${pkgver}"
- patch -Np1 -i "$srcdir"/logrotate-3.8.0-noasprintf.patch
+ patch -p1 -i "$srcdir"/logrotate-3.8.1-noasprintf.patch
sed -i 's|#define DEFAULT_MAIL_COMMAND .*|#define DEFAULT_MAIL_COMMAND "/usr/bin/mail"|'\
config.h
diff --git a/core/logrotate/logrotate-3.8.1-noasprintf.patch b/core/logrotate/logrotate-3.8.1-noasprintf.patch
new file mode 100644
index 000000000..be0c08062
--- /dev/null
+++ b/core/logrotate/logrotate-3.8.1-noasprintf.patch
@@ -0,0 +1,53 @@
+--- logrotate-3.8.0.orig/config.c 2011-06-21 04:12:02.000000000 -0400
++++ logrotate-3.8.0/config.c 2011-07-12 13:47:36.274319050 -0400
+@@ -41,39 +41,6 @@
+ #include "asprintf.c"
+ #endif
+
+-#if !defined(asprintf)
+-#include <stdarg.h>
+-
+-int asprintf(char **string_ptr, const char *format, ...)
+-{
+- va_list arg;
+- char *str;
+- int size;
+- int rv;
+-
+- va_start(arg, format);
+- size = vsnprintf(NULL, 0, format, arg);
+- size++;
+- va_start(arg, format);
+- str = malloc(size);
+- if (str == NULL) {
+- va_end(arg);
+- /*
+- * Strictly speaking, GNU asprintf doesn't do this,
+- * but the caller isn't checking the return value.
+- */
+- fprintf(stderr, "failed to allocate memory\\n");
+- exit(1);
+- }
+- rv = vsnprintf(str, size, format, arg);
+- va_end(arg);
+-
+- *string_ptr = str;
+- return (rv);
+-}
+-
+-#endif
+-
+ #if !defined(strndup)
+ char *strndup(const char *s, size_t n)
+ {
+--- logrotate-3.8.0.orig/logrotate.h 2011-06-21 04:12:02.000000000 -0400
++++ logrotate-3.8.0/logrotate.h 2011-07-12 13:47:38.949285608 -0400
+@@ -66,8 +66,5 @@ extern int numLogs;
+ extern int debug;
+
+ int readAllConfigPaths(const char **paths);
+-#if !defined(asprintf)
+-int asprintf(char **string_ptr, const char *format, ...);
+-#endif
+
+ #endif
diff --git a/core/perl/PKGBUILD b/core/perl/PKGBUILD
index d25f2aae4..46ca72ef2 100644
--- a/core/perl/PKGBUILD
+++ b/core/perl/PKGBUILD
@@ -1,11 +1,11 @@
-# $Id: PKGBUILD 129898 2011-06-29 17:25:10Z foutrelis $
+# $Id: PKGBUILD 139103 2011-09-29 12:44:13Z angvp $
# Maintainer: Angel Velasquez <angvp@archlinux.org>
# Contributor: kevin <kevin.archlinux.org>
# Contributor: judd <jvinet.zeroflux.org>
# Contributor: francois <francois.archlinux.org>
pkgname=perl
-pkgver=5.14.1
-pkgrel=3
+pkgver=5.14.2
+pkgrel=2
pkgdesc="A highly capable, feature-rich programming language"
arch=(i686 x86_64)
license=('GPL' 'PerlArtistic')
@@ -16,12 +16,14 @@ changelog=ChangeLog
source=(http://www.cpan.org/src/5.0/perl-${pkgver}.tar.bz2
perlbin.sh
perlbin.csh
+provides.pl
0001-Append-CFLAGS-and-LDFLAGS-to-their-Config.pm-counter.patch)
install=perl.install
options=('!makeflags' '!purge')
-md5sums=('97cd306a2c22929cc141a09568f43bb0'
+md5sums=('04a4c5d3c1f9f19d77daff8e8cd19a26'
'5ed2542fdb9a60682f215bd33701e61a'
'1f0cbbee783e8a6d32f01be5118e0d5e'
+ '31fc0b5bb4935414394c5cfbec2cb8e5'
'c25d86206d649046538c3daab7874564')
build() {
@@ -52,6 +54,10 @@ build() {
make
}
package() {
+ # hack to work around makepkg running the subshell in check_sanity()
+ new_provides=($(cd "$srcdir/perl-$pkgver"; LD_PRELOAD=./libperl.so ./perl -Ilib "$srcdir/provides.pl" .))
+ provides=(${new_provides[@]})
+
cd ${srcdir}/${pkgname}-${pkgver}
make install
diff --git a/core/perl/perl.install b/core/perl/perl.install
index 3f7d58f23..a355c5bbe 100644
--- a/core/perl/perl.install
+++ b/core/perl/perl.install
@@ -8,11 +8,3 @@ post_install() {
return 0
}
-post_upgrade() {
- echo '- The directories /usr/lib/perl5/current, /usr/lib/perl5/site_perl/current,'
- echo ' /usr/lib/perl5/site_perl/5.10.1, and /usr/share/perl5/site_perl/5.10.1'
- echo ' have been removed from @INC.'
-
- echo '- The script/binary directories are now /usr/bin/*_perl instead of'
- echo ' /usr/lib/perl5/*_perl/bin which will be eventually removed.'
-}
diff --git a/core/perl/provides.pl b/core/perl/provides.pl
new file mode 100644
index 000000000..3bf369577
--- /dev/null
+++ b/core/perl/provides.pl
@@ -0,0 +1,286 @@
+# provides.pl
+##
+# Script for printing out a provides list of every CPAN distribution
+# that is bundled with perl.
+#
+# Justin Davis <jrcd83@gmail.com>
+
+use warnings 'FATAL' => 'all';
+use strict;
+
+package Common;
+
+sub evalver
+{
+ my ($path, $mod) = @_;
+ $mod ||= "";
+
+ open my $fh, '<', $path or die "open $path: $!";
+
+ while (<$fh>) {
+ next unless /\s*(?:\$${mod}::|\$)VERSION\s*=\s*(.+)/;
+ my $ver = eval $1;
+ return $ver unless $@;
+ warn qq{$path:$. bad version string "$ver"\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.appspot.com/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/;
+ 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) || 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;
+
+ # Package names should be lowercase and consist of alphanumeric
+ # characters only (and hyphens!)...
+ $name =~ tr/A-Z/a-z/;
+ $name =~ tr/_+/-/; # _ and +'s converted to - (ie Tabbed-Text+Wrap)
+ $name =~ tr/-a-z0-9+//cd; # Delete all other chars.
+ $name =~ tr/-/-/s;
+
+ # 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;
+
+ # Remove developer versions because pacman has no special logic
+ # to compare them to regular versions like perl does.
+ $version =~ s/_[^_]+\z//;
+
+ $version =~ tr/_//d; # delete other underscores
+ $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\n";
+}