diff options
author | Patrick J Volkerding <volkerdi@slackware.com> | 2018-05-25 23:29:36 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2018-05-31 15:10:50 -0700 |
commit | 329684b59b8d55dd403c2c59f76d37210ba2f517 (patch) | |
tree | 10421c6ee3bf179d50915cc00d4c15c1b83cb77a /patches/source/perl | |
parent | b76270bf9e6dd375e495fec92140a79a79415d27 (diff) | |
download | current-329684b59b8d55dd403c2c59f76d37210ba2f517.tar.gz |
Fri May 25 23:29:36 UTC 201813.1
patches/packages/glibc-zoneinfo-2018e-noarch-2_slack13.1.txz: Rebuilt.
Handle removal of US/Pacific-New timezone. If we see that the machine is
using this, it will be automatically switched to US/Pacific.
Diffstat (limited to 'patches/source/perl')
-rw-r--r-- | patches/source/perl/10_hash.t | 38 | ||||
-rw-r--r-- | patches/source/perl/hash.t | 46 | ||||
-rw-r--r-- | patches/source/perl/hv.c | 61 | ||||
-rwxr-xr-x | patches/source/perl/perl.SlackBuild | 296 | ||||
-rw-r--r-- | patches/source/perl/perl.configure.multilib.patch | 35 | ||||
-rw-r--r-- | patches/source/perl/slack-desc | 19 |
6 files changed, 495 insertions, 0 deletions
diff --git a/patches/source/perl/10_hash.t b/patches/source/perl/10_hash.t new file mode 100644 index 00000000..e051528b --- /dev/null +++ b/patches/source/perl/10_hash.t @@ -0,0 +1,38 @@ +X-Git-Url: http://perl5.git.perl.org/perl.git/blobdiff_plain/ca8de220718ba91d5a5fdd9779497cd5b0250258..f14269908e5f8b4cab4b55643d7dd9de577e7918:/ext/Hash-Util-FieldHash/t/10_hash.t + +diff --git a/ext/Hash-Util-FieldHash/t/10_hash.t b/ext/Hash-Util-FieldHash/t/10_hash.t +index 29c2f4d..c266b6a 100644 +--- a/ext/Hash-Util-FieldHash/t/10_hash.t ++++ b/ext/Hash-Util-FieldHash/t/10_hash.t +@@ -46,15 +46,29 @@ use constant START => "a"; + + # some initial hash data + fieldhash my %h2; +-%h2 = map {$_ => 1} 'a'..'cc'; ++my $counter= "a"; ++$h2{$counter++}++ while $counter ne 'cd'; + + ok (!Internals::HvREHASH(%h2), + "starting with pre-populated non-pathological hash (rehash flag if off)"); + + my @keys = get_keys(\%h2); ++my $buckets= buckets(\%h2); + $h2{$_}++ for @keys; ++$h2{$counter++}++ while buckets(\%h2) == $buckets; # force a split + ok (Internals::HvREHASH(%h2), +- scalar(@keys) . " colliding into the same bucket keys are triggering rehash"); ++ scalar(@keys) . " colliding into the same bucket keys are triggering rehash after split"); ++ ++# returns the number of buckets in a hash ++sub buckets { ++ my $hr = shift; ++ my $keys_buckets= scalar(%$hr); ++ if ($keys_buckets=~m!/([0-9]+)\z!) { ++ return 0+$1; ++ } else { ++ return 8; ++ } ++} + + sub get_keys { + my $hr = shift; diff --git a/patches/source/perl/hash.t b/patches/source/perl/hash.t new file mode 100644 index 00000000..6d6d61eb --- /dev/null +++ b/patches/source/perl/hash.t @@ -0,0 +1,46 @@ +X-Git-Url: http://perl5.git.perl.org/perl.git/blobdiff_plain/ca8de220718ba91d5a5fdd9779497cd5b0250258..f14269908e5f8b4cab4b55643d7dd9de577e7918:/t/op/hash.t + +diff --git a/t/op/hash.t b/t/op/hash.t +index 9bde518..45eb782 100644 +--- a/t/op/hash.t ++++ b/t/op/hash.t +@@ -39,22 +39,36 @@ use constant THRESHOLD => 14; + use constant START => "a"; + + # some initial hash data +-my %h2 = map {$_ => 1} 'a'..'cc'; ++my %h2; ++my $counter= "a"; ++$h2{$counter++}++ while $counter ne 'cd'; + + ok (!Internals::HvREHASH(%h2), + "starting with pre-populated non-pathological hash (rehash flag if off)"); + + my @keys = get_keys(\%h2); ++my $buckets= buckets(\%h2); + $h2{$_}++ for @keys; ++$h2{$counter++}++ while buckets(\%h2) == $buckets; # force a split + ok (Internals::HvREHASH(%h2), +- scalar(@keys) . " colliding into the same bucket keys are triggering rehash"); ++ scalar(@keys) . " colliding into the same bucket keys are triggering rehash after split"); ++ ++# returns the number of buckets in a hash ++sub buckets { ++ my $hr = shift; ++ my $keys_buckets= scalar(%$hr); ++ if ($keys_buckets=~m!/([0-9]+)\z!) { ++ return 0+$1; ++ } else { ++ return 8; ++ } ++} + + sub get_keys { + my $hr = shift; + + # the minimum of bits required to mount the attack on a hash + my $min_bits = log(THRESHOLD)/log(2); +- + # if the hash has already been populated with a significant amount + # of entries the number of mask bits can be higher + my $keys = scalar keys %$hr; diff --git a/patches/source/perl/hv.c b/patches/source/perl/hv.c new file mode 100644 index 00000000..71819e9b --- /dev/null +++ b/patches/source/perl/hv.c @@ -0,0 +1,61 @@ +X-Git-Url: http://perl5.git.perl.org/perl.git/blobdiff_plain/ca8de220718ba91d5a5fdd9779497cd5b0250258..f14269908e5f8b4cab4b55643d7dd9de577e7918:/hv.c + +diff --git a/hv.c b/hv.c +index 5d0f2f8..6bfedd5 100644 +--- a/hv.c ++++ b/hv.c +@@ -35,7 +35,8 @@ holds the key and hash value. + #define PERL_HASH_INTERNAL_ACCESS + #include "perl.h" + +-#define HV_MAX_LENGTH_BEFORE_SPLIT 14 ++#define HV_MAX_LENGTH_BEFORE_REHASH 14 ++#define SHOULD_DO_HSPLIT(xhv) ((xhv)->xhv_keys > (xhv)->xhv_max) /* HvTOTALKEYS(hv) > HvMAX(hv) */ + + static const char S_strtab_error[] + = "Cannot modify shared string table in hv_%s"; +@@ -818,23 +819,8 @@ Perl_hv_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen, + xhv->xhv_keys++; /* HvTOTALKEYS(hv)++ */ + if (!counter) { /* initial entry? */ + xhv->xhv_fill++; /* HvFILL(hv)++ */ +- } else if (xhv->xhv_keys > (IV)xhv->xhv_max) { ++ } else if ( SHOULD_DO_HSPLIT(xhv) ) { + hsplit(hv); +- } else if(!HvREHASH(hv)) { +- U32 n_links = 1; +- +- while ((counter = HeNEXT(counter))) +- n_links++; +- +- if (n_links > HV_MAX_LENGTH_BEFORE_SPLIT) { +- /* Use only the old HvKEYS(hv) > HvMAX(hv) condition to limit +- bucket splits on a rehashed hash, as we're not going to +- split it again, and if someone is lucky (evil) enough to +- get all the keys in one list they could exhaust our memory +- as we repeatedly double the number of buckets on every +- entry. Linear search feels a less worse thing to do. */ +- hsplit(hv); +- } + } + } + +@@ -1180,7 +1166,7 @@ S_hsplit(pTHX_ HV *hv) + + + /* Pick your policy for "hashing isn't working" here: */ +- if (longest_chain <= HV_MAX_LENGTH_BEFORE_SPLIT /* split worked? */ ++ if (longest_chain <= HV_MAX_LENGTH_BEFORE_REHASH /* split worked? */ + || HvREHASH(hv)) { + return; + } +@@ -2506,8 +2492,8 @@ S_share_hek_flags(pTHX_ const char *str, I32 len, register U32 hash, int flags) + xhv->xhv_keys++; /* HvTOTALKEYS(hv)++ */ + if (!next) { /* initial entry? */ + xhv->xhv_fill++; /* HvFILL(hv)++ */ +- } else if (xhv->xhv_keys > (IV)xhv->xhv_max /* HvKEYS(hv) > HvMAX(hv) */) { +- hsplit(PL_strtab); ++ } else if ( SHOULD_DO_HSPLIT(xhv) ) { ++ hsplit(PL_strtab); + } + } + diff --git a/patches/source/perl/perl.SlackBuild b/patches/source/perl/perl.SlackBuild new file mode 100755 index 00000000..15fe8a20 --- /dev/null +++ b/patches/source/perl/perl.SlackBuild @@ -0,0 +1,296 @@ +#!/bin/sh + +# Copyright 2009 Patrick J. Volkerding, Sebeka, MN, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +# originally by: David Cantrell <david@slackware.com> +# maintained by: <volkerdi@slackware.com> + +VERSION=5.10.1 +# IMPORTANT: also update -Dinc_version_list in ./configure below! + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i486 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi +BUILD=${BUILD:-2_slack13.1} + +NUMJOBS=${NUMJOBS:--j6} + +CWD=$(pwd) +TMP=${TMP:-/tmp} +PKG=$TMP/package-perl + +# Additional required modules: +DBDMYSQL=4.013 +DBI=1.609 +URI=1.40 +XMLPARSER=2.36 +XMLSIMPLE=2.18 + +if [ "$ARCH" = "i386" ]; then + SLKCFLAGS="-O2 -march=i386 -mcpu=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +fi + +if [ -x /usr/bin/perl ]; then + echo "Perl detected." + echo + echo "It's a good idea to remove your existing perl first." + echo + sleep 15 +fi + +# Clear build location: +rm -rf $PKG +mkdir -p $PKG + +# Extract the source code: +cd $TMP +rm -rf perl-$VERSION +tar xvf $CWD/perl-$VERSION.tar.?z* || exit 1 + +# Change into the source directory: +cd perl-$VERSION + +zcat $CWD/10_hash.t.gz | patch -p1 --verbose || exit 1 +zcat $CWD/hash.t.gz | patch -p1 --verbose || exit 1 +zcat $CWD/hv.c.gz | patch -p1 --verbose || exit 1 + +# Adjust owner/perms to standard values: +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# If after all this time you still don't trust threads, comment +# out the variable below: +# +USE_THREADS="-Dusethreads -Duseithreads" + +if [ "$ARCH" = "x86_64" ]; then # adopted from "Cross Linux From Scratch" + # Configure must be told to also use lib64: + zcat $CWD/perl.configure.multilib.patch.gz | patch -p1 --verbose || exit 1 + # "perl -V" should report that libc is in /lib64 + sed -i -e '/libc/s#/lib/#/lib64/#' hints/linux.sh + # make perl use lib64: + echo 'installstyle="lib64/perl5"' >>hints/linux.sh +fi + +# We no longer include suidperl. To quote the INSTALL file: +# +# Because of the buggy history of suidperl, and the difficulty +# of properly security auditing as large and complex piece of +# software as Perl, we cannot recommend using suidperl and the feature +# should be considered deprecated. +# Instead use for example 'sudo': http://www.courtesan.com/sudo/ + +# Configure perl: +./Configure -de \ + -Dprefix=/usr \ + -Dvendorprefix=/usr \ + -Dcccdlflags='-fPIC' \ + -Dinstallprefix=/usr \ + -Dlibpth="/usr/local/lib${LIBDIRSUFFIX} /usr/lib${LIBDIRSUFFIX} /lib${LIBDIRSUFFIX}" \ + -Doptimize="$SLKCFLAGS" \ + $USE_THREADS \ + -Dpager='/usr/bin/less -isr' \ + -Dinc_version_list='5.10.0 5.8.8 5.8.7 5.8.6 5.8.5 5.8.4 5.8.3 5.8.2 5.8.1 5.8.0' \ + -Darchname=$ARCH-linux + +# Kludge for gcc-4.2.4's needlessly changed output: +cat makefile | grep -v '\<command-line\>' > foo +mv foo makefile +cat x2p/makefile | grep -v '\<command-line\>' > foo +mv foo x2p/makefile + +# Build perl +make $NUMJOBS || exit 1 +make test + +# Install perl (needed to build modules): +make install +( cd /usr/bin + ln -sf perl$VERSION perl + ln -sf c2ph pstruct + ln -sf s2p psed +) +mkdir -p /usr/lib${LIBDIRSUFFIX}/perl5/vendor_perl/${VERSION}/${ARCH}-linux-thread-multi + +# Install perl package: +make install DESTDIR=$PKG +mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/perl5/vendor_perl/${VERSION}/${ARCH}-linux-thread-multi + +# Add additional modules: +( cd ext + ( tar xzvf $CWD/DBI-${DBI}.tar.gz + cd DBI-${DBI} + chown -R root:root . + perl Makefile.PL INSTALLDIRS=vendor + make + make test + make install + make install DESTDIR=$PKG + mkdir -p $PKG/usr/doc/perl-$VERSION/DBI-${DBI} + cp -a README $PKG/usr/doc/perl-$VERSION/DBI-${DBI} + chmod 644 $PKG/usr/doc/perl-$VERSION/DBI-${DBI}/README + ) + ( tar xzvf $CWD/DBD-mysql-${DBDMYSQL}.tar.gz + cd DBD-mysql-${DBDMYSQL} + chown -R root:root . + perl Makefile.PL INSTALLDIRS=vendor + make + make test + make install + make install DESTDIR=$PKG + mkdir -p $PKG/usr/doc/perl-$VERSION/DBD-mysql-${DBDMYSQL} + cp -a INSTALL.html README TODO $PKG/usr/doc/perl-$VERSION/DBD-mysql-${DBDMYSQL} + chmod 644 $PKG/usr/doc/perl-$VERSION/DBD-mysql-${DBDMYSQL}/* + ) + ( tar xzvf $CWD/XML-Parser-${XMLPARSER}.tar.gz + cd XML-Parser-${XMLPARSER} + chown -R root:root . + perl Makefile.PL INSTALLDIRS=vendor + make + make test + make install + make install DESTDIR=$PKG + mkdir -p $PKG/usr/doc/perl-$VERSION/XML-Parser-${XMLPARSER} + cp -a README $PKG/usr/doc/perl-$VERSION/XML-Parser-${XMLPARSER} + chmod 644 $PKG/usr/doc/perl-$VERSION/XML-Parser-${XMLPARSER}/* + ) + ( tar xzvf $CWD/XML-Simple-${XMLSIMPLE}.tar.gz + cd XML-Simple-${XMLSIMPLE} + chown -R root:root . + perl Makefile.PL INSTALLDIRS=vendor + make + make test + make install + make install DESTDIR=$PKG + mkdir -p $PKG/usr/doc/perl-$VERSION/XML-Simple${XMLSIMPLE} + cp -a README $PKG/usr/doc/perl-$VERSION/XML-Simple${XMLSIMPLE} + chmod 644 $PKG/usr/doc/perl-$VERSION/XML-Simple${XMLSIMPLE}/* + ) + ( tar xzvf $CWD/URI-${URI}.tar.gz + cd URI-${URI} + chown -R root:root . + perl Makefile.PL INSTALLDIRS=vendor + make + make test + make install + make install DESTDIR=$PKG + mkdir -p $PKG/usr/doc/perl-$VERSION/URI-${URI} + cp -a README $PKG/usr/doc/perl-$VERSION/URI-${URI} + chmod 644 $PKG/usr/doc/perl-$VERSION/URI-${URI}/* + ) +) + +# Strip everything: +( cd $PKG + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null +) + +# There are also miniperl and microperl. +# I haven't had any requests for them, but would be willing +# to consider adding one or both to the package if anyone +# actually needs them for some reason. +#make microperl + +# Symlinks that replace hard links +( cd $PKG/usr/bin + ln -sf perl$VERSION perl + ln -sf c2ph pstruct + ln -sf s2p psed ) + +# Install documentation +mkdir -p $PKG/usr/doc/perl-$VERSION +cp -a \ + AUTHORS Artistic Copying INSTALL MANIFEST README README.Y2K README.cn \ + README.jp README.ko README.micro README.tw Todo.micro \ + $PKG/usr/doc/perl-$VERSION + +# We follow LSB with symlinks in /usr/share: +( cd $PKG/usr/share + mv man .. ) +( cd $PKG/usr/man/man1 + mkdir foo + cp *.1 foo + rm *.1 + mv foo/* . + rmdir foo + gzip -9 * + ln -sf c2ph.1.gz pstruct.1.gz + ln -sf s2p.1.gz psed.1.gz ) +( cd $PKG/usr/man/man3 + gzip -9 * ) + +chmod 755 $PKG/usr/bin/* +chmod 644 $PKG/usr/man/man?/* +rmdir $PKG/usr/share + +# This file shouldn't get clobbered: +if [ -r $PKG/usr/lib${LIBDIRSUFFIX}/perl5/${VERSION}/${ARCH}-linux-thread-multi/perllocal.pod ]; then + mv $PKG/usr/lib${LIBDIRSUFFIX}/perl5/${VERSION}/${ARCH}-linux-thread-multi/perllocal.pod $PKG/usr/lib${LIBDIRSUFFIX}/perl5/${VERSION}/${ARCH}-linux-thread-multi/perllocal.pod.new +fi + +# Insert the slack-desc: +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + + +cat << EOF | sed -e "s#/lib/#/lib${LIBDIRSUFFIX}/#" | sed -e "s#i486#$ARCH#" \ + > $PKG/install/doinst.sh +#!/bin/sh +config() { + NEW="\$1" + OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r \$OLD ]; then + mv \$NEW \$OLD + elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then # toss the redundant copy + rm \$NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} +config usr/lib/perl5/${VERSION}/i486-linux-thread-multi/perllocal.pod.new +EOF + +# Build the package: +cd $PKG +/sbin/makepkg -l y -c n $TMP/perl-$VERSION-$ARCH-$BUILD.txz + diff --git a/patches/source/perl/perl.configure.multilib.patch b/patches/source/perl/perl.configure.multilib.patch new file mode 100644 index 00000000..c86ce65f --- /dev/null +++ b/patches/source/perl/perl.configure.multilib.patch @@ -0,0 +1,35 @@ +Submitted By: Ryan Oliver <ryan(dot)oliver(at)pha(dot)com(dot)au> +Date: 2005-10-20 +Initial Package Version: 5.8.7 +Origin: Ryan Oliver +Description: this patch allows perl to be installed in /usr/lib32 or /usr/lib64 instead of /usr/lib. + +--- perl-5.8.7/Configure-ORIG 2005-10-20 11:49:47.571389008 +1000 ++++ perl-5.8.7/Configure 2005-10-20 12:30:35.571236464 +1000 +@@ -5930,6 +5930,8 @@ + : The default "style" setting is made in installstyle.U + case "$installstyle" in + *lib/perl5*) set dflt privlib lib/$package/$version ;; ++*lib32/perl5*) set dflt privlib lib32/$package/$version ;; ++*lib64/perl5*) set dflt privlib lib64/$package/$version ;; + *) set dflt privlib lib/$version ;; + esac + eval $prefixit +@@ -6433,6 +6435,8 @@ + case "$sitelib" in + '') case "$installstyle" in + *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;; ++ *lib32/perl5*) dflt=$siteprefix/lib32/$package/site_$prog/$version ;; ++ *lib64/perl5*) dflt=$siteprefix/lib64/$package/site_$prog/$version ;; + *) dflt=$siteprefix/lib/site_$prog/$version ;; + esac + ;; +@@ -6560,6 +6564,8 @@ + prog=`echo $package | $sed 's/-*[0-9.]*$//'` + case "$installstyle" in + *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;; ++ *lib32/perl5*) dflt=$vendorprefix/lib32/$package/vendor_$prog/$version ;; ++ *lib64/perl5*) dflt=$vendorprefix/lib64/$package/vendor_$prog/$version ;; + *) dflt=$vendorprefix/lib/vendor_$prog/$version ;; + esac + ;; diff --git a/patches/source/perl/slack-desc b/patches/source/perl/slack-desc new file mode 100644 index 00000000..e28cf941 --- /dev/null +++ b/patches/source/perl/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +perl: perl (Practical Extraction and Report Language) +perl: +perl: Larry Wall's "Practical Extraction and Report Language". Perl is a +perl: language optimized for scanning arbitrary text files, extracting +perl: information from those text files, and printing reports based on that +perl: information. It's also a good language for many system management +perl: tasks. The language is intended to be practical (easy to use, +perl: efficient, complete) rather than beautiful (tiny, elegant, minimal). +perl: +perl: +perl: |