# see the -P and -I option in perl.man
++;# $Date = &ctime(time);
++
++CONFIG: {
++ package ctime;
++
++ @DoW = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
++ @MoY = ('Jan','Feb','Mar','Apr','May','Jun',
++ 'Jul','Aug','Sep','Oct','Nov','Dec');
++}
++
++sub ctime {
++ package ctime;
++
++ local($time) = @_;
++ local($[) = 0;
++ local($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst);
++
++ # Determine what time zone is in effect.
++ # Use GMT if TZ is defined as null, local time if TZ undefined.
++ # There's no portable way to find the system default timezone.
++
++ $TZ = defined($ENV{'TZ'}) ? ( $ENV{'TZ'} ? $ENV{'TZ'} : 'GMT' ) : '';
++ ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
++ ($TZ eq 'GMT') ? gmtime($time) : localtime($time);
++
++ # Hack to deal with 'PST8PDT' format of TZ
++ # Note that this can't deal with all the esoteric forms, but it
++ # does recognize the most common: [:]STDoff[DST[off][,rule]]
++
++ if($TZ=~/^([^:\d+\-,]{3,})([+-]?\d{1,2}(:\d{1,2}){0,2})([^\d+\-,]{3,})?/){
++ $TZ = $isdst ? $4 : $1;
++ }
++ $TZ .= ' ' unless $TZ eq '';
++
++ $year += 1900;
++ sprintf("%s %s %2d %2d:%02d:%02d %s%4d\n",
++ $DoW[$wday], $MoY[$mon], $mday, $hour, $min, $sec, $TZ, $year);
++}
++1;
+diff -ENwbur perl-5.16.3-orig/lib/dotsh.pl perl-5.16.3/lib/dotsh.pl
+--- perl-5.16.3-orig/lib/dotsh.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/dotsh.pl 2016-08-18 10:07:06.481442093 +0200
+@@ -0,0 +1,74 @@
++#
++# @(#)dotsh.pl 03/19/94
++#
++# This library is no longer being maintained, and is included for backward
++# compatibility with Perl 4 programs which may require it.
++#
++# In particular, this should not be used as an example of modern Perl
++# programming techniques.
++#
++#
++# Author: Charles Collins
++#
++# Description:
++# This routine takes a shell script and 'dots' it into the current perl
++# environment. This makes it possible to use existing system scripts
++# to alter environment variables on the fly.
++#
++# Usage:
++# &dotsh ('ShellScript', 'DependentVariable(s)');
++#
++# where
++#
++# 'ShellScript' is the full name of the shell script to be dotted
++#
++# 'DependentVariable(s)' is an optional list of shell variables in the
++# form VARIABLE=VALUE,VARIABLE=VALUE,... that 'ShellScript' is
++# dependent upon. These variables MUST be defined using shell syntax.
++#
++# Example:
++# &dotsh ('/foo/bar', 'arg1');
++# &dotsh ('/foo/bar');
++# &dotsh ('/foo/bar arg1 ... argN');
++#
++sub dotsh {
++ local(@sh) = @_;
++ local($tmp,$key,$shell,$command,$args,$vars) = '';
++ local(*dotsh);
++ undef *dotsh;
++ $dotsh = shift(@sh);
++ @dotsh = split (/\s/, $dotsh);
++ $command = shift (@dotsh);
++ $args = join (" ", @dotsh);
++ $vars = join ("\n", @sh);
++ open (_SH_ENV, "$command") || die "Could not open $dotsh!\n";
++ chop($_ = <_SH_ENV>);
++ $shell = "$1 -c" if ($_ =~ /^\#\!\s*(\S+(\/sh|\/ksh|\/zsh|\/csh))\s*$/);
++ close (_SH_ENV);
++ if (!$shell) {
++ if ($ENV{'SHELL'} =~ /\/sh$|\/ksh$|\/zsh$|\/bash$|\/csh$/) {
++ $shell = "$ENV{'SHELL'} -c";
++ } else {
++ print "SHELL not recognized!\nUsing /bin/sh...\n";
++ $shell = "/bin/sh -c";
++ }
++ }
++ if (length($vars) > 0) {
++ open (_SH_ENV, "$shell \"$vars && . $command $args && set \" |") || die;
++ } else {
++ open (_SH_ENV, "$shell \". $command $args && set \" |") || die;
++ }
++
++ while (<_SH_ENV>) {
++ chop;
++ m/^([^=]*)=(.*)/s;
++ $ENV{$1} = $2;
++ }
++ close (_SH_ENV);
++
++ foreach $key (keys(%ENV)) {
++ $tmp .= "\$$key = \$ENV{'$key'};" if $key =~ /^[A-Za-z]\w*$/;
++ }
++ eval $tmp;
++}
++1;
+diff -ENwbur perl-5.16.3-orig/lib/exceptions.pl perl-5.16.3/lib/exceptions.pl
+--- perl-5.16.3-orig/lib/exceptions.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/exceptions.pl 2016-08-18 10:07:06.491442049 +0200
+@@ -0,0 +1,61 @@
++# exceptions.pl
++# tchrist@convex.com
++#
++# This library is no longer being maintained, and is included for backward
++# compatibility with Perl 4 programs which may require it.
++#
++# In particular, this should not be used as an example of modern Perl
++# programming techniques.
++#
++#
++# Here's a little code I use for exception handling. It's really just
++# glorfied eval/die. The way to use use it is when you might otherwise
++# exit, use &throw to raise an exception. The first enclosing &catch
++# handler looks at the exception and decides whether it can catch this kind
++# (catch takes a list of regexps to catch), and if so, it returns the one it
++# caught. If it *can't* catch it, then it will reraise the exception
++# for someone else to possibly see, or to die otherwise.
++#
++# I use oddly named variables in order to make darn sure I don't conflict
++# with my caller. I also hide in my own package, and eval the code in his.
++#
++# The EXCEPTION: prefix is so you can tell whether it's a user-raised
++# exception or a perl-raised one (eval error).
++#
++# --tom
++#
++# examples:
++# if (&catch('/$user_input/', 'regexp', 'syntax error') {
++# warn "oops try again";
++# redo;
++# }
++#
++# if ($error = &catch('&subroutine()')) { # catches anything
++#
++# &throw('bad input') if /^$/;
++
++sub catch {
++ package exception;
++ local($__code__, @__exceptions__) = @_;
++ local($__package__) = caller;
++ local($__exception__);
++
++ eval "package $__package__; $__code__";
++ if ($__exception__ = &'thrown) {
++ for (@__exceptions__) {
++ return $__exception__ if /$__exception__/;
++ }
++ &'throw($__exception__);
++ }
++}
++
++sub throw {
++ local($exception) = @_;
++ die "EXCEPTION: $exception\n";
++}
++
++sub thrown {
++ $@ =~ /^(EXCEPTION: )+(.+)/ && $2;
++}
++
++1;
+diff -ENwbur perl-5.16.3-orig/lib/fastcwd.pl perl-5.16.3/lib/fastcwd.pl
+--- perl-5.16.3-orig/lib/fastcwd.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/fastcwd.pl 2016-08-18 10:07:06.501442005 +0200
+@@ -0,0 +1,43 @@
++# By John Bazik
++#
++# This library is no longer being maintained, and is included for backward
++# compatibility with Perl 4 programs which may require it.
++#
++# In particular, this should not be used as an example of modern Perl
++# programming techniques.
++#
++# Suggested alternative: Cwd
++#
++# Usage: $cwd = &fastcwd;
++#
++# This is a faster version of getcwd. It's also more dangerous because
++# you might chdir out of a directory that you can't chdir back into.
++
++sub fastcwd {
++ local($odev, $oino, $cdev, $cino, $tdev, $tino);
++ local(@path, $path);
++ local(*DIR);
++
++ ($cdev, $cino) = stat('.');
++ for (;;) {
++ ($odev, $oino) = ($cdev, $cino);
++ chdir('..');
++ ($cdev, $cino) = stat('.');
++ last if $odev == $cdev && $oino == $cino;
++ opendir(DIR, '.');
++ for (;;) {
++ $_ = readdir(DIR);
++ next if $_ eq '.';
++ next if $_ eq '..';
++
++ last unless $_;
++ ($tdev, $tino) = lstat($_);
++ last unless $tdev != $odev || $tino != $oino;
++ }
++ closedir(DIR);
++ unshift(@path, $_);
++ }
++ chdir($path = '/' . join('/', @path));
++ $path;
++}
++1;
+diff -ENwbur perl-5.16.3-orig/lib/find.pl perl-5.16.3/lib/find.pl
+--- perl-5.16.3-orig/lib/find.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/find.pl 2016-08-18 10:07:06.510441965 +0200
+@@ -0,0 +1,47 @@
++# Usage:
++# require "find.pl";
++#
++# &find('/foo','/bar');
++#
++# sub wanted { ... }
++# where wanted does whatever you want. $dir contains the
++# current directory name, and $_ the current filename within
++# that directory. $name contains "$dir/$_". You are cd'ed
++# to $dir when the function is called. The function may
++# set $prune to prune the tree.
++#
++# This library is primarily for find2perl, which, when fed
++#
++# find2perl / -name .nfs\* -mtime +7 -exec rm -f {} \; -o -fstype nfs -prune
++#
++# spits out something like this
++#
++# sub wanted {
++# /^\.nfs.*$/ &&
++# (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
++# int(-M _) > 7 &&
++# unlink($_)
++# ||
++# ($nlink || (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_))) &&
++# $dev < 0 &&
++# ($prune = 1);
++# }
++#
++# Set the variable $dont_use_nlink if you're using AFS, since AFS cheats.
++
++use File::Find ();
++
++*name = *File::Find::name;
++*prune = *File::Find::prune;
++*dir = *File::Find::dir;
++*topdir = *File::Find::topdir;
++*topdev = *File::Find::topdev;
++*topino = *File::Find::topino;
++*topmode = *File::Find::topmode;
++*topnlink = *File::Find::topnlink;
++
++sub find {
++ &File::Find::find(\&wanted, @_);
++}
++
++1;
+diff -ENwbur perl-5.16.3-orig/lib/finddepth.pl perl-5.16.3/lib/finddepth.pl
+--- perl-5.16.3-orig/lib/finddepth.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/finddepth.pl 2016-08-18 10:07:06.520441921 +0200
+@@ -0,0 +1,46 @@
++# Usage:
++# require "finddepth.pl";
++#
++# &finddepth('/foo','/bar');
++#
++# sub wanted { ... }
++# where wanted does whatever you want. $dir contains the
++# current directory name, and $_ the current filename within
++# that directory. $name contains "$dir/$_". You are cd'ed
++# to $dir when the function is called. The function may
++# set $prune to prune the tree.
++#
++# This library is primarily for find2perl, which, when fed
++#
++# find2perl / -name .nfs\* -mtime +7 -exec rm -f {} \; -o -fstype nfs -prune
++#
++# spits out something like this
++#
++# sub wanted {
++# /^\.nfs.*$/ &&
++# (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
++# int(-M _) > 7 &&
++# unlink($_)
++# ||
++# ($nlink || (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_))) &&
++# $dev < 0 &&
++# ($prune = 1);
++# }
++
++
++use File::Find ();
++
++*name = *File::Find::name;
++*prune = *File::Find::prune;
++*dir = *File::Find::dir;
++*topdir = *File::Find::topdir;
++*topdev = *File::Find::topdev;
++*topino = *File::Find::topino;
++*topmode = *File::Find::topmode;
++*topnlink = *File::Find::topnlink;
++
++sub finddepth {
++ &File::Find::finddepth(\&wanted, @_);
++}
++
++1;
+diff -ENwbur perl-5.16.3-orig/lib/flush.pl perl-5.16.3/lib/flush.pl
+--- perl-5.16.3-orig/lib/flush.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/flush.pl 2016-08-18 10:07:06.529441881 +0200
+@@ -0,0 +1,32 @@
++#
++# This library is no longer being maintained, and is included for backward
++# compatibility with Perl 4 programs which may require it.
++#
++# In particular, this should not be used as an example of modern Perl
++# programming techniques.
++#
++# Suggested alternative: IO::Handle
++#
++;# Usage: &flush(FILEHANDLE)
++;# flushes the named filehandle
++
++;# Usage: &printflush(FILEHANDLE, "prompt: ")
++;# prints arguments and flushes filehandle
++
++sub flush {
++ local($old) = select(shift);
++ $| = 1;
++ print "";
++ $| = 0;
++ select($old);
++}
++
++sub printflush {
++ local($old) = select(shift);
++ $| = 1;
++ print @_;
++ $| = 0;
++ select($old);
++}
++
++1;
+diff -ENwbur perl-5.16.3-orig/lib/getcwd.pl perl-5.16.3/lib/getcwd.pl
+--- perl-5.16.3-orig/lib/getcwd.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/getcwd.pl 2016-08-18 10:07:06.540441833 +0200
+@@ -0,0 +1,71 @@
++# By Brandon S. Allbery
++#
++# This library is no longer being maintained, and is included for backward
++# compatibility with Perl 4 programs which may require it.
++#
++# In particular, this should not be used as an example of modern Perl
++# programming techniques.
++#
++# Suggested alternative: Cwd
++#
++#
++# Usage: $cwd = &getcwd;
++
++sub getcwd
++{
++ local($dotdots, $cwd, @pst, @cst, $dir, @tst);
++
++ unless (@cst = stat('.'))
++ {
++ warn "stat(.): $!";
++ return '';
++ }
++ $cwd = '';
++ do
++ {
++ $dotdots .= '/' if $dotdots;
++ $dotdots .= '..';
++ @pst = @cst;
++ unless (opendir(getcwd'PARENT, $dotdots)) #'))
++ {
++ warn "opendir($dotdots): $!";
++ return '';
++ }
++ unless (@cst = stat($dotdots))
++ {
++ warn "stat($dotdots): $!";
++ closedir(getcwd'PARENT); #');
++ return '';
++ }
++ if ($pst[$[] == $cst[$[] && $pst[$[ + 1] == $cst[$[ + 1])
++ {
++ $dir = '';
++ }
++ else
++ {
++ do
++ {
++ unless (defined ($dir = readdir(getcwd'PARENT))) #'))
++ {
++ warn "readdir($dotdots): $!";
++ closedir(getcwd'PARENT); #');
++ return '';
++ }
++ unless (@tst = lstat("$dotdots/$dir"))
++ {
++ # warn "lstat($dotdots/$dir): $!";
++ # closedir(getcwd'PARENT); #');
++ # return '';
++ }
++ }
++ while ($dir eq '.' || $dir eq '..' || $tst[$[] != $pst[$[] ||
++ $tst[$[ + 1] != $pst[$[ + 1]);
++ }
++ $cwd = "$dir/$cwd";
++ closedir(getcwd'PARENT); #');
++ } while ($dir ne '');
++ chop($cwd);
++ $cwd;
++}
++
++1;
+diff -ENwbur perl-5.16.3-orig/lib/getopt.pl perl-5.16.3/lib/getopt.pl
+--- perl-5.16.3-orig/lib/getopt.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/getopt.pl 2016-08-18 10:07:06.548441797 +0200
+@@ -0,0 +1,49 @@
++;# $RCSfile: getopt.pl,v $$Revision: 4.1 $$Date: 92/08/07 18:23:58 $
++#
++# This library is no longer being maintained, and is included for backward
++# compatibility with Perl 4 programs which may require it.
++#
++# In particular, this should not be used as an example of modern Perl
++# programming techniques.
++#
++# Suggested alternatives: Getopt::Long or Getopt::Std
++#
++;# Process single-character switches with switch clustering. Pass one argument
++;# which is a string containing all switches that take an argument. For each
++;# switch found, sets $opt_x (where x is the switch name) to the value of the
++;# argument, or 1 if no argument. Switches which take an argument don't care
++;# whether there is a space between the switch and the argument.
++
++;# Usage:
++;# do Getopt('oDI'); # -o, -D & -I take arg. Sets opt_* as a side effect.
++
++sub Getopt {
++ local($argumentative) = @_;
++ local($_,$first,$rest);
++ local($[) = 0;
++
++ while (@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
++ ($first,$rest) = ($1,$2);
++ if (index($argumentative,$first) >= $[) {
++ if ($rest ne '') {
++ shift(@ARGV);
++ }
++ else {
++ shift(@ARGV);
++ $rest = shift(@ARGV);
++ }
++ ${"opt_$first"} = $rest;
++ }
++ else {
++ ${"opt_$first"} = 1;
++ if ($rest ne '') {
++ $ARGV[0] = "-$rest";
++ }
++ else {
++ shift(@ARGV);
++ }
++ }
++ }
++}
++
++1;
+diff -ENwbur perl-5.16.3-orig/lib/getopts.pl perl-5.16.3/lib/getopts.pl
+--- perl-5.16.3-orig/lib/getopts.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/getopts.pl 2016-08-18 10:07:06.557441758 +0200
+@@ -0,0 +1,66 @@
++;# getopts.pl - a better getopt.pl
++#
++# This library is no longer being maintained, and is included for backward
++# compatibility with Perl 4 programs which may require it.
++#
++# In particular, this should not be used as an example of modern Perl
++# programming techniques.
++#
++# Suggested alternatives: Getopt::Long or Getopt::Std
++#
++;# Usage:
++;# do Getopts('a:bc'); # -a takes arg. -b & -c not. Sets opt_* as a
++;# # side effect.
++
++sub Getopts {
++ local($argumentative) = @_;
++ local(@args,$_,$first,$rest);
++ local($errs) = 0;
++ local($[) = 0;
++
++ @args = split( / */, $argumentative );
++ while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
++ ($first,$rest) = ($1,$2);
++ $pos = index($argumentative,$first);
++ if($pos >= $[) {
++ if($args[$pos+1] eq ':') {
++ shift(@ARGV);
++ if($rest eq '') {
++ ++$errs unless(@ARGV);
++ $rest = shift(@ARGV);
++ }
++ eval "
++ push(\@opt_$first, \$rest);
++ if (!defined \$opt_$first or \$opt_$first eq '') {
++ \$opt_$first = \$rest;
++ }
++ else {
++ \$opt_$first .= ' ' . \$rest;
++ }
++ ";
++ }
++ else {
++ eval "\$opt_$first = 1";
++ if($rest eq '') {
++ shift(@ARGV);
++ }
++ else {
++ $ARGV[0] = "-$rest";
++ }
++ }
++ }
++ else {
++ print STDERR "Unknown option: $first\n";
++ ++$errs;
++ if($rest ne '') {
++ $ARGV[0] = "-$rest";
++ }
++ else {
++ shift(@ARGV);
++ }
++ }
++ }
++ $errs == 0;
++}
++
++1;
+diff -ENwbur perl-5.16.3-orig/lib/hostname.pl perl-5.16.3/lib/hostname.pl
+--- perl-5.16.3-orig/lib/hostname.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/hostname.pl 2016-08-18 10:07:06.567441713 +0200
+@@ -0,0 +1,31 @@
++# From: asherman@fmrco.com (Aaron Sherman)
++#
++# This library is no longer being maintained, and is included for backward
++# compatibility with Perl 4 programs which may require it.
++#
++# In particular, this should not be used as an example of modern Perl
++# programming techniques.
++#
++# Suggested alternative: Sys::Hostname
++#
++sub hostname
++{
++ local(*P,@tmp,$hostname,$_);
++ if (open(P,"hostname 2>&1 |") && (@tmp = ) && close(P))
++ {
++ chop($hostname = $tmp[$#tmp]);
++ }
++ elsif (open(P,"uname -n 2>&1 |") && (@tmp =
) && close(P))
++ {
++ chop($hostname = $tmp[$#tmp]);
++ }
++ else
++ {
++ die "$0: Cannot get hostname from 'hostname' or 'uname -n'\n";
++ }
++ @tmp = ();
++ close P; # Just in case we failed in an odd spot....
++ $hostname;
++}
++
++1;
+diff -ENwbur perl-5.16.3-orig/lib/importenv.pl perl-5.16.3/lib/importenv.pl
+--- perl-5.16.3-orig/lib/importenv.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/importenv.pl 2016-08-18 10:07:06.577441669 +0200
+@@ -0,0 +1,14 @@
++;# This file, when interpreted, pulls the environment into normal variables.
++;# Usage:
++;# require 'importenv.pl';
++;# or
++;# #include
++
++local($tmp,$key) = '';
++
++foreach $key (keys(%ENV)) {
++ $tmp .= "\$$key = \$ENV{'$key'};" if $key =~ /^[A-Za-z]\w*$/;
++}
++eval $tmp;
++
++1;
+diff -ENwbur perl-5.16.3-orig/lib/look.pl perl-5.16.3/lib/look.pl
+--- perl-5.16.3-orig/lib/look.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/look.pl 2016-08-18 10:07:06.586441630 +0200
+@@ -0,0 +1,50 @@
++;# Usage: &look(*FILEHANDLE,$key,$dict,$fold)
++#
++# This library is no longer being maintained, and is included for backward
++# compatibility with Perl 4 programs which may require it.
++#
++# In particular, this should not be used as an example of modern Perl
++# programming techniques.
++#
++;# Sets file position in FILEHANDLE to be first line greater than or equal
++;# (stringwise) to $key. Pass flags for dictionary order and case folding.
++
++sub look {
++ local(*FH,$key,$dict,$fold) = @_;
++ local($max,$min,$mid,$_);
++ local($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
++ $blksize,$blocks) = stat(FH);
++ $blksize = 8192 unless $blksize;
++ $key =~ s/[^\w\s]//g if $dict;
++ $key = lc $key if $fold;
++ $max = int($size / $blksize);
++ while ($max - $min > 1) {
++ $mid = int(($max + $min) / 2);
++ seek(FH,$mid * $blksize,0);
++ $_ = if $mid; # probably a partial line
++ $_ = ;
++ chop;
++ s/[^\w\s]//g if $dict;
++ $_ = lc $_ if $fold;
++ if ($_ lt $key) {
++ $min = $mid;
++ }
++ else {
++ $max = $mid;
++ }
++ }
++ $min *= $blksize;
++ seek(FH,$min,0);
++ if $min;
++ while () {
++ chop;
++ s/[^\w\s]//g if $dict;
++ $_ = lc $_ if $fold;
++ last if $_ ge $key;
++ $min = tell(FH);
++ }
++ seek(FH,$min,0);
++ $min;
++}
++
++1;
+diff -ENwbur perl-5.16.3-orig/lib/newgetopt.pl perl-5.16.3/lib/newgetopt.pl
+--- perl-5.16.3-orig/lib/newgetopt.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/newgetopt.pl 2016-08-18 10:07:06.595441590 +0200
+@@ -0,0 +1,75 @@
++# $Id: newgetopt.pl,v 1.18 2001/09/21 13:34:59 jv Exp $
++
++# This library is no longer being maintained, and is included for backward
++# compatibility with Perl 4 programs which may require it.
++# It is now just a wrapper around the Getopt::Long module.
++#
++# In particular, this should not be used as an example of modern Perl
++# programming techniques.
++#
++# Suggested alternative: Getopt::Long
++
++{ package newgetopt;
++
++ # Values for $order. See GNU getopt.c for details.
++ $REQUIRE_ORDER = 0;
++ $PERMUTE = 1;
++ $RETURN_IN_ORDER = 2;
++
++ # Handle POSIX compliancy.
++ if ( defined $ENV{"POSIXLY_CORRECT"} ) {
++ $autoabbrev = 0; # no automatic abbrev of options (???)
++ $getopt_compat = 0; # disallow '+' to start options
++ $option_start = "(--|-)";
++ $order = $REQUIRE_ORDER;
++ $bundling = 0;
++ $passthrough = 0;
++ }
++ else {
++ $autoabbrev = 1; # automatic abbrev of options
++ $getopt_compat = 1; # allow '+' to start options
++ $option_start = "(--|-|\\+)";
++ $order = $PERMUTE;
++ $bundling = 0;
++ $passthrough = 0;
++ }
++
++ # Other configurable settings.
++ $debug = 0; # for debugging
++ $ignorecase = 1; # ignore case when matching options
++ $argv_end = "--"; # don't change this!
++}
++
++use Getopt::Long;
++
++################ Subroutines ################
++
++sub NGetOpt {
++
++ $Getopt::Long::debug = $newgetopt::debug
++ if defined $newgetopt::debug;
++ $Getopt::Long::autoabbrev = $newgetopt::autoabbrev
++ if defined $newgetopt::autoabbrev;
++ $Getopt::Long::getopt_compat = $newgetopt::getopt_compat
++ if defined $newgetopt::getopt_compat;
++ $Getopt::Long::option_start = $newgetopt::option_start
++ if defined $newgetopt::option_start;
++ $Getopt::Long::order = $newgetopt::order
++ if defined $newgetopt::order;
++ $Getopt::Long::bundling = $newgetopt::bundling
++ if defined $newgetopt::bundling;
++ $Getopt::Long::ignorecase = $newgetopt::ignorecase
++ if defined $newgetopt::ignorecase;
++ $Getopt::Long::ignorecase = $newgetopt::ignorecase
++ if defined $newgetopt::ignorecase;
++ $Getopt::Long::passthrough = $newgetopt::passthrough
++ if defined $newgetopt::passthrough;
++
++ &GetOptions;
++}
++
++################ Package return ################
++
++1;
++
++################ End of newgetopt.pl ################
+diff -ENwbur perl-5.16.3-orig/lib/open2.pl perl-5.16.3/lib/open2.pl
+--- perl-5.16.3-orig/lib/open2.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/open2.pl 2016-08-18 10:07:06.605441546 +0200
+@@ -0,0 +1,12 @@
++# This is a compatibility interface to IPC::Open2. New programs should
++# do
++#
++# use IPC::Open2;
++#
++# instead of
++#
++# require 'open2.pl';
++
++package main;
++use IPC::Open2 'open2';
++1
+diff -ENwbur perl-5.16.3-orig/lib/open3.pl perl-5.16.3/lib/open3.pl
+--- perl-5.16.3-orig/lib/open3.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/open3.pl 2016-08-18 10:07:06.615441502 +0200
+@@ -0,0 +1,12 @@
++# This is a compatibility interface to IPC::Open3. New programs should
++# do
++#
++# use IPC::Open3;
++#
++# instead of
++#
++# require 'open3.pl';
++
++package main;
++use IPC::Open3 'open3';
++1
+diff -ENwbur perl-5.16.3-orig/lib/pwd.pl perl-5.16.3/lib/pwd.pl
+--- perl-5.16.3-orig/lib/pwd.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/pwd.pl 2016-08-18 10:07:06.625441458 +0200
+@@ -0,0 +1,67 @@
++;# pwd.pl - keeps track of current working directory in PWD environment var
++;#
++#
++# This library is no longer being maintained, and is included for backward
++# compatibility with Perl 4 programs which may require it.
++#
++# In particular, this should not be used as an example of modern Perl
++# programming techniques.
++#
++# Suggested alternative: Cwd
++#
++;# $RCSfile: pwd.pl,v $$Revision: 4.1 $$Date: 92/08/07 18:24:11 $
++;#
++;# $Log: pwd.pl,v $
++;#
++;# Usage:
++;# require "pwd.pl";
++;# &initpwd;
++;# ...
++;# &chdir($newdir);
++
++package pwd;
++
++sub main'initpwd {
++ if ($ENV{'PWD'}) {
++ local($dd,$di) = stat('.');
++ local($pd,$pi) = stat($ENV{'PWD'});
++ if (!defined $dd or !defined $pd or $di != $pi or $dd != $pd) {
++ chop($ENV{'PWD'} = `pwd`);
++ }
++ }
++ else {
++ chop($ENV{'PWD'} = `pwd`);
++ }
++ if ($ENV{'PWD'} =~ m|(/[^/]+(/[^/]+/[^/]+))(.*)|) {
++ local($pd,$pi) = stat($2);
++ local($dd,$di) = stat($1);
++ if (defined $pd and defined $dd and $di == $pi and $dd == $pd) {
++ $ENV{'PWD'}="$2$3";
++ }
++ }
++}
++
++sub main'chdir {
++ local($newdir) = shift;
++ $newdir =~ s|/{2,}|/|g;
++ if (chdir $newdir) {
++ if ($newdir =~ m#^/#) {
++ $ENV{'PWD'} = $newdir;
++ }
++ else {
++ local(@curdir) = split(m#/#,$ENV{'PWD'});
++ @curdir = '' unless @curdir;
++ foreach $component (split(m#/#, $newdir)) {
++ next if $component eq '.';
++ pop(@curdir),next if $component eq '..';
++ push(@curdir,$component);
++ }
++ $ENV{'PWD'} = join('/',@curdir) || '/';
++ }
++ }
++ else {
++ 0;
++ }
++}
++
++1;
+diff -ENwbur perl-5.16.3-orig/lib/shellwords.pl perl-5.16.3/lib/shellwords.pl
+--- perl-5.16.3-orig/lib/shellwords.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/shellwords.pl 2016-08-18 10:07:06.635441413 +0200
+@@ -0,0 +1,14 @@
++;# shellwords.pl
++;#
++;# Usage:
++;# require 'shellwords.pl';
++;# @words = shellwords($line);
++;# or
++;# @words = shellwords(@lines);
++;# or
++;# @words = shellwords(); # defaults to $_ (and clobbers it)
++
++require Text::ParseWords;
++*shellwords = \&Text::ParseWords::old_shellwords;
++
++1;
+diff -ENwbur perl-5.16.3-orig/lib/stat.pl perl-5.16.3/lib/stat.pl
+--- perl-5.16.3-orig/lib/stat.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/stat.pl 2016-08-18 10:07:06.644441374 +0200
+@@ -0,0 +1,29 @@
++;# Usage:
++;# require 'stat.pl';
++;# @ary = stat(foo);
++;# $st_dev = @ary[$ST_DEV];
++;#
++$ST_DEV = 0 + $[;
++$ST_INO = 1 + $[;
++$ST_MODE = 2 + $[;
++$ST_NLINK = 3 + $[;
++$ST_UID = 4 + $[;
++$ST_GID = 5 + $[;
++$ST_RDEV = 6 + $[;
++$ST_SIZE = 7 + $[;
++$ST_ATIME = 8 + $[;
++$ST_MTIME = 9 + $[;
++$ST_CTIME = 10 + $[;
++$ST_BLKSIZE = 11 + $[;
++$ST_BLOCKS = 12 + $[;
++
++;# Usage:
++;# require 'stat.pl';
++;# do Stat('foo'); # sets st_* as a side effect
++;#
++sub Stat {
++ ($st_dev,$st_ino,$st_mode,$st_nlink,$st_uid,$st_gid,$st_rdev,$st_size,
++ $st_atime,$st_mtime,$st_ctime,$st_blksize,$st_blocks) = stat(shift(@_));
++}
++
++1;
+diff -ENwbur perl-5.16.3-orig/lib/syslog.pl perl-5.16.3/lib/syslog.pl
+--- perl-5.16.3-orig/lib/syslog.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/syslog.pl 2016-08-18 10:07:06.656441321 +0200
+@@ -0,0 +1,199 @@
++#
++# syslog.pl
++#
++# $Log: syslog.pl,v $
++#
++# tom christiansen
++# modified to use sockets by Larry Wall
++# NOTE: openlog now takes three arguments, just like openlog(3)
++#
++# call syslog() with a string priority and a list of printf() args
++# like syslog(3)
++#
++# usage: require 'syslog.pl';
++#
++# then (put these all in a script to test function)
++#
++#
++# do openlog($program,'cons,pid','user');
++# do syslog('info','this is another test');
++# do syslog('mail|warning','this is a better test: %d', time);
++# do closelog();
++#
++# do syslog('debug','this is the last test');
++# do openlog("$program $$",'ndelay','user');
++# do syslog('notice','fooprogram: this is really done');
++#
++# $! = 55;
++# do syslog('info','problem was %m'); # %m == $! in syslog(3)
++
++package syslog;
++
++use warnings::register;
++
++$host = 'localhost' unless $host; # set $syslog'host to change
++
++if ($] >= 5 && warnings::enabled()) {
++ warnings::warn("You should 'use Sys::Syslog' instead; continuing");
++}
++
++require 'syslog.ph';
++
++ eval 'use Socket; 1' ||
++ eval { require "socket.ph" } ||
++ require "sys/socket.ph";
++
++$maskpri = &LOG_UPTO(&LOG_DEBUG);
++
++sub main'openlog {
++ ($ident, $logopt, $facility) = @_; # package vars
++ $lo_pid = $logopt =~ /\bpid\b/;
++ $lo_ndelay = $logopt =~ /\bndelay\b/;
++ $lo_cons = $logopt =~ /\bcons\b/;
++ $lo_nowait = $logopt =~ /\bnowait\b/;
++ &connect if $lo_ndelay;
++}
++
++sub main'closelog {
++ $facility = $ident = '';
++ &disconnect;
++}
++
++sub main'setlogmask {
++ local($oldmask) = $maskpri;
++ $maskpri = shift;
++ $oldmask;
++}
++
++sub main'syslog {
++ local($priority) = shift;
++ local($mask) = shift;
++ local($message, $whoami);
++ local(@words, $num, $numpri, $numfac, $sum);
++ local($facility) = $facility; # may need to change temporarily.
++
++ die "syslog: expected both priority and mask" unless $mask && $priority;
++
++ @words = split(/\W+/, $priority, 2);# Allow "level" or "level|facility".
++ undef $numpri;
++ undef $numfac;
++ foreach (@words) {
++ $num = &xlate($_); # Translate word to number.
++ if (/^kern$/ || $num < 0) {
++ die "syslog: invalid level/facility: $_\n";
++ }
++ elsif ($num <= &LOG_PRIMASK) {
++ die "syslog: too many levels given: $_\n" if defined($numpri);
++ $numpri = $num;
++ return 0 unless &LOG_MASK($numpri) & $maskpri;
++ }
++ else {
++ die "syslog: too many facilities given: $_\n" if defined($numfac);
++ $facility = $_;
++ $numfac = $num;
++ }
++ }
++
++ die "syslog: level must be given\n" unless defined($numpri);
++
++ if (!defined($numfac)) { # Facility not specified in this call.
++ $facility = 'user' unless $facility;
++ $numfac = &xlate($facility);
++ }
++
++ &connect unless $connected;
++
++ $whoami = $ident;
++
++ if (!$ident && $mask =~ /^(\S.*):\s?(.*)/) {
++ $whoami = $1;
++ $mask = $2;
++ }
++
++ unless ($whoami) {
++ ($whoami = getlogin) ||
++ ($whoami = getpwuid($<)) ||
++ ($whoami = 'syslog');
++ }
++
++ $whoami .= "[$$]" if $lo_pid;
++
++ $mask =~ s/%m/$!/g;
++ $mask .= "\n" unless $mask =~ /\n$/;
++ $message = sprintf ($mask, @_);
++
++ $sum = $numpri + $numfac;
++ unless (send(SYSLOG,"<$sum>$whoami: $message",0)) {
++ if ($lo_cons) {
++ if ($pid = fork) {
++ unless ($lo_nowait) {
++ do {$died = wait;} until $died == $pid || $died < 0;
++ }
++ }
++ else {
++ open(CONS,">/dev/console");
++ print CONS "<$facility.$priority>$whoami: $message\r";
++ exit if defined $pid; # if fork failed, we're parent
++ close CONS;
++ }
++ }
++ }
++}
++
++sub xlate {
++ local($name) = @_;
++ $name = uc $name;
++ $name = "LOG_$name" unless $name =~ /^LOG_/;
++ $name = "syslog'$name";
++ defined &$name ? &$name : -1;
++}
++
++sub connect {
++ $pat = 'S n C4 x8';
++
++ $af_unix = &AF_UNIX;
++ $af_inet = &AF_INET;
++
++ $stream = &SOCK_STREAM;
++ $datagram = &SOCK_DGRAM;
++
++ ($name,$aliases,$proto) = getprotobyname('udp');
++ $udp = $proto;
++
++ ($name,$aliases,$port,$proto) = getservbyname('syslog','udp');
++ $syslog = $port;
++
++ if (chop($myname = `hostname`)) {
++ ($name,$aliases,$addrtype,$length,@addrs) = gethostbyname($myname);
++ die "Can't lookup $myname\n" unless $name;
++ @bytes = unpack("C4",$addrs[0]);
++ }
++ else {
++ @bytes = (0,0,0,0);
++ }
++ $this = pack($pat, $af_inet, 0, @bytes);
++
++ if ($host =~ /^\d+\./) {
++ @bytes = split(/\./,$host);
++ }
++ else {
++ ($name,$aliases,$addrtype,$length,@addrs) = gethostbyname($host);
++ die "Can't lookup $host\n" unless $name;
++ @bytes = unpack("C4",$addrs[0]);
++ }
++ $that = pack($pat,$af_inet,$syslog,@bytes);
++
++ socket(SYSLOG,$af_inet,$datagram,$udp) || die "socket: $!\n";
++ bind(SYSLOG,$this) || die "bind: $!\n";
++ connect(SYSLOG,$that) || die "connect: $!\n";
++
++ local($old) = select(SYSLOG); $| = 1; select($old);
++ $connected = 1;
++}
++
++sub disconnect {
++ close SYSLOG;
++ $connected = 0;
++}
++
++1;
+diff -ENwbur perl-5.16.3-orig/lib/tainted.pl perl-5.16.3/lib/tainted.pl
+--- perl-5.16.3-orig/lib/tainted.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/tainted.pl 2016-08-18 10:07:06.670441259 +0200
+@@ -0,0 +1,9 @@
++# This subroutine returns true if its argument is tainted, false otherwise.
++
++sub tainted {
++ local($@);
++ eval { kill 0 * $_[0] };
++ $@ =~ /^Insecure/;
++}
++
++1;
+diff -ENwbur perl-5.16.3-orig/lib/termcap.pl perl-5.16.3/lib/termcap.pl
+--- perl-5.16.3-orig/lib/termcap.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/termcap.pl 2016-08-18 10:07:06.678441224 +0200
+@@ -0,0 +1,178 @@
++;# $RCSfile: termcap.pl,v $$Revision: 4.1 $$Date: 92/08/07 18:24:16 $
++#
++# This library is no longer being maintained, and is included for backward
++# compatibility with Perl 4 programs which may require it.
++#
++# In particular, this should not be used as an example of modern Perl
++# programming techniques.
++#
++# Suggested alternative: Term::Cap
++#
++;#
++;# Usage:
++;# require 'ioctl.pl';
++;# ioctl(TTY,$TIOCGETP,$foo);
++;# ($ispeed,$ospeed) = unpack('cc',$foo);
++;# require 'termcap.pl';
++;# &Tgetent('vt100'); # sets $TC{'cm'}, etc.
++;# &Tputs(&Tgoto($TC{'cm'},$col,$row), 0, 'FILEHANDLE');
++;# &Tputs($TC{'dl'},$affcnt,'FILEHANDLE');
++;#
++sub Tgetent {
++ local($TERM) = @_;
++ local($TERMCAP,$_,$entry,$loop,$field);
++
++ # warn "Tgetent: no ospeed set" unless $ospeed;
++ foreach $key (keys %TC) {
++ delete $TC{$key};
++ }
++ $TERM = $ENV{'TERM'} unless $TERM;
++ $TERM =~ s/(\W)/\\$1/g;
++ $TERMCAP = $ENV{'TERMCAP'};
++ $TERMCAP = '/etc/termcap' unless $TERMCAP;
++ if ($TERMCAP !~ m:^/:) {
++ if ($TERMCAP !~ /(^|\|)$TERM[:\|]/) {
++ $TERMCAP = '/etc/termcap';
++ }
++ }
++ if ($TERMCAP =~ m:^/:) {
++ $entry = '';
++ do {
++ $loop = "
++ open(TERMCAP,'<$TERMCAP') || die \"Can't open $TERMCAP\";
++ while () {
++ next if /^#/;
++ next if /^\t/;
++ if (/(^|\\|)${TERM}[:\\|]/) {
++ chop;
++ while (chop eq '\\\\') {
++ \$_ .= ;
++ chop;
++ }
++ \$_ .= ':';
++ last;
++ }
++ }
++ close TERMCAP;
++ \$entry .= \$_;
++ ";
++ eval $loop;
++ } while s/:tc=([^:]+):/:/ && ($TERM = $1);
++ $TERMCAP = $entry;
++ }
++
++ foreach $field (split(/:[\s:\\]*/,$TERMCAP)) {
++ if ($field =~ /^\w\w$/) {
++ $TC{$field} = 1;
++ }
++ elsif ($field =~ /^(\w\w)#(.*)/) {
++ $TC{$1} = $2 if $TC{$1} eq '';
++ }
++ elsif ($field =~ /^(\w\w)=(.*)/) {
++ $entry = $1;
++ $_ = $2;
++ s/\\E/\033/g;
++ s/\\(200)/pack('c',0)/eg; # NUL character
++ s/\\(0\d\d)/pack('c',oct($1))/eg; # octal
++ s/\\(0x[0-9A-Fa-f][0-9A-Fa-f])/pack('c',hex($1))/eg; # hex
++ s/\\(\d\d\d)/pack('c',$1 & 0177)/eg;
++ s/\\n/\n/g;
++ s/\\r/\r/g;
++ s/\\t/\t/g;
++ s/\\b/\b/g;
++ s/\\f/\f/g;
++ s/\\\^/\377/g;
++ s/\^\?/\177/g;
++ s/\^(.)/pack('c',ord($1) & 31)/eg;
++ s/\\(.)/$1/g;
++ s/\377/^/g;
++ $TC{$entry} = $_ if $TC{$entry} eq '';
++ }
++ }
++ $TC{'pc'} = "\0" if $TC{'pc'} eq '';
++ $TC{'bc'} = "\b" if $TC{'bc'} eq '';
++}
++
++@Tputs = (0,200,133.3,90.9,74.3,66.7,50,33.3,16.7,8.3,5.5,4.1,2,1,.5,.2);
++
++sub Tputs {
++ local($string,$affcnt,$FH) = @_;
++ local($ms);
++ if ($string =~ /(^[\d.]+)(\*?)(.*)$/) {
++ $ms = $1;
++ $ms *= $affcnt if $2;
++ $string = $3;
++ $decr = $Tputs[$ospeed];
++ if ($decr > .1) {
++ $ms += $decr / 2;
++ $string .= $TC{'pc'} x ($ms / $decr);
++ }
++ }
++ print $FH $string if $FH;
++ $string;
++}
++
++sub Tgoto {
++ local($string) = shift(@_);
++ local($result) = '';
++ local($after) = '';
++ local($code,$tmp) = @_;
++ local(@tmp);
++ @tmp = ($tmp,$code);
++ local($online) = 0;
++ while ($string =~ /^([^%]*)%(.)(.*)/) {
++ $result .= $1;
++ $code = $2;
++ $string = $3;
++ if ($code eq 'd') {
++ $result .= sprintf("%d",shift(@tmp));
++ }
++ elsif ($code eq '.') {
++ $tmp = shift(@tmp);
++ if ($tmp == 0 || $tmp == 4 || $tmp == 10) {
++ if ($online) {
++ ++$tmp, $after .= $TC{'up'} if $TC{'up'};
++ }
++ else {
++ ++$tmp, $after .= $TC{'bc'};
++ }
++ }
++ $result .= sprintf("%c",$tmp);
++ $online = !$online;
++ }
++ elsif ($code eq '+') {
++ $result .= sprintf("%c",shift(@tmp)+ord($string));
++ $string = substr($string,1,99);
++ $online = !$online;
++ }
++ elsif ($code eq 'r') {
++ ($code,$tmp) = @tmp;
++ @tmp = ($tmp,$code);
++ $online = !$online;
++ }
++ elsif ($code eq '>') {
++ ($code,$tmp,$string) = unpack("CCa99",$string);
++ if ($tmp[$[] > $code) {
++ $tmp[$[] += $tmp;
++ }
++ }
++ elsif ($code eq '2') {
++ $result .= sprintf("%02d",shift(@tmp));
++ $online = !$online;
++ }
++ elsif ($code eq '3') {
++ $result .= sprintf("%03d",shift(@tmp));
++ $online = !$online;
++ }
++ elsif ($code eq 'i') {
++ ($code,$tmp) = @tmp;
++ @tmp = ($code+1,$tmp+1);
++ }
++ else {
++ return "OOPS";
++ }
++ }
++ $result . $string . $after;
++}
++
++1;
+diff -ENwbur perl-5.16.3-orig/lib/timelocal.pl perl-5.16.3/lib/timelocal.pl
+--- perl-5.16.3-orig/lib/timelocal.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/timelocal.pl 2016-08-18 10:07:06.689441175 +0200
+@@ -0,0 +1,18 @@
++;# timelocal.pl
++;#
++;# Usage:
++;# $time = timelocal($sec,$min,$hours,$mday,$mon,$year);
++;# $time = timegm($sec,$min,$hours,$mday,$mon,$year);
++
++;# This file has been superseded by the Time::Local library module.
++;# It is implemented as a call to that module for backwards compatibility
++;# with code written for perl4; new code should use Time::Local directly.
++
++;# The current implementation shares with the original the questionable
++;# behavior of defining the timelocal() and timegm() functions in the
++;# namespace of whatever package was current when the first instance of
++;# C was executed in a program.
++
++use Time::Local;
++
++*timelocal::cheat = \&Time::Local::cheat;
+diff -ENwbur perl-5.16.3-orig/lib/validate.pl perl-5.16.3/lib/validate.pl
+--- perl-5.16.3-orig/lib/validate.pl 1970-01-01 01:00:00.000000000 +0100
++++ perl-5.16.3/lib/validate.pl 2016-08-18 10:07:06.696441144 +0200
+@@ -0,0 +1,102 @@
++;# The validate routine takes a single multiline string consisting of
++;# lines containing a filename plus a file test to try on it. (The
++;# file test may also be a 'cd', causing subsequent relative filenames
++;# to be interpreted relative to that directory.) After the file test
++;# you may put '|| die' to make it a fatal error if the file test fails.
++;# The default is '|| warn'. The file test may optionally have a ! prepended
++;# to test for the opposite condition. If you do a cd and then list some
++;# relative filenames, you may want to indent them slightly for readability.
++;# If you supply your own "die" or "warn" message, you can use $file to
++;# interpolate the filename.
++
++;# Filetests may be bunched: -rwx tests for all of -r, -w and -x.
++;# Only the first failed test of the bunch will produce a warning.
++
++;# The routine returns the number of warnings issued.
++
++;# Usage:
++;# require "validate.pl";
++;# $warnings += do validate('
++;# /vmunix -e || die
++;# /boot -e || die
++;# /bin cd
++;# csh -ex
++;# csh !-ug
++;# sh -ex
++;# sh !-ug
++;# /usr -d || warn "What happened to $file?\n"
++;# ');
++
++sub validate {
++ local($file,$test,$warnings,$oldwarnings);
++ foreach $check (split(/\n/,$_[0])) {
++ next if $check =~ /^#/;
++ next if $check =~ /^$/;
++ ($file,$test) = split(' ',$check,2);
++ if ($test =~ s/^(!?-)(\w{2,}\b)/$1Z/) {
++ $testlist = $2;
++ @testlist = split(//,$testlist);
++ }
++ else {
++ @testlist = ('Z');
++ }
++ $oldwarnings = $warnings;
++ foreach $one (@testlist) {
++ $this = $test;
++ $this =~ s/(-\w\b)/$1 \$file/g;
++ $this =~ s/-Z/-$one/;
++ $this .= ' || warn' unless $this =~ /\|\|/;
++ $this =~ s/^(.*\S)\s*\|\|\s*(die|warn)$/$1 || do valmess('$2','$1')/;
++ $this =~ s/\bcd\b/chdir (\$cwd = \$file)/g;
++ eval $this;
++ last if $warnings > $oldwarnings;
++ }
++ }
++ $warnings;
++}
++
++sub valmess {
++ local($disposition,$this) = @_;
++ $file = $cwd . '/' . $file unless $file =~ m|^/|;
++ if ($this =~ /^(!?)-(\w)\s+\$file\s*$/) {
++ $neg = $1;
++ $tmp = $2;
++ $tmp eq 'r' && ($mess = "$file is not readable by uid $>.");
++ $tmp eq 'w' && ($mess = "$file is not writable by uid $>.");
++ $tmp eq 'x' && ($mess = "$file is not executable by uid $>.");
++ $tmp eq 'o' && ($mess = "$file is not owned by uid $>.");
++ $tmp eq 'R' && ($mess = "$file is not readable by you.");
++ $tmp eq 'W' && ($mess = "$file is not writable by you.");
++ $tmp eq 'X' && ($mess = "$file is not executable by you.");
++ $tmp eq 'O' && ($mess = "$file is not owned by you.");
++ $tmp eq 'e' && ($mess = "$file does not exist.");
++ $tmp eq 'z' && ($mess = "$file does not have zero size.");
++ $tmp eq 's' && ($mess = "$file does not have non-zero size.");
++ $tmp eq 'f' && ($mess = "$file is not a plain file.");
++ $tmp eq 'd' && ($mess = "$file is not a directory.");
++ $tmp eq 'l' && ($mess = "$file is not a symbolic link.");
++ $tmp eq 'p' && ($mess = "$file is not a named pipe (FIFO).");
++ $tmp eq 'S' && ($mess = "$file is not a socket.");
++ $tmp eq 'b' && ($mess = "$file is not a block special file.");
++ $tmp eq 'c' && ($mess = "$file is not a character special file.");
++ $tmp eq 'u' && ($mess = "$file does not have the setuid bit set.");
++ $tmp eq 'g' && ($mess = "$file does not have the setgid bit set.");
++ $tmp eq 'k' && ($mess = "$file does not have the sticky bit set.");
++ $tmp eq 'T' && ($mess = "$file is not a text file.");
++ $tmp eq 'B' && ($mess = "$file is not a binary file.");
++ if ($neg eq '!') {
++ $mess =~ s/ is not / should not be / ||
++ $mess =~ s/ does not / should not / ||
++ $mess =~ s/ not / /;
++ }
++ print STDERR $mess,"\n";
++ }
++ else {
++ $this =~ s/\$file/'$file'/g;
++ print STDERR "Can't do $this.\n";
++ }
++ if ($disposition eq 'die') { exit 1; }
++ ++$warnings;
++}
++
++1;
diff --git a/SOURCES/perl-5.16.3-File-Glob-Dup-glob-state-in-CLONE.patch b/SOURCES/perl-5.16.3-File-Glob-Dup-glob-state-in-CLONE.patch
new file mode 100644
index 0000000..a26b585
--- /dev/null
+++ b/SOURCES/perl-5.16.3-File-Glob-Dup-glob-state-in-CLONE.patch
@@ -0,0 +1,177 @@
+From faa03ffb8ccbf754d38d041570fcf2ce8816f36b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20=C5=A0abata?=
+Date: Wed, 2 Sep 2015 16:24:58 +0200
+Subject: [PATCH] File::Glob: Dup glob state in CLONE()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+File::Glob: Dup glob state in CLONE()
+
+This solves [perl #119897] and [perl #117823], and restores the
+behavior of glob() in conjunction with threads of 5.14 and older.
+
+Since 5.16, code that used glob() inside a thread had been
+unintentionally sharing state between threads, which lead to things
+like this crashing and failing assertions:
+
+./perl -Ilib -Mthreads -e 'scalar glob("*"); threads->create(sub { glob("*") })->join();'
+
+Signed-off-by: Petr Šabata
+---
+ MANIFEST | 1 +
+ ext/File-Glob/Glob.xs | 33 ++++++++++++++++++++++
+ ext/File-Glob/t/threads.t | 71 +++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 105 insertions(+)
+ create mode 100644 ext/File-Glob/t/threads.t
+
+diff --git a/MANIFEST b/MANIFEST
+index 181bb3f..9771022 100644
+--- a/MANIFEST
++++ b/MANIFEST
+@@ -3683,6 +3683,7 @@ ext/File-Glob/t/global.t See if File::Glob works
+ ext/File-Glob/TODO File::Glob extension todo list
+ ext/File-Glob/t/rt114984.t See if File::Glob works
+ ext/File-Glob/t/taint.t See if File::Glob works
++ext/File-Glob/t/threads.t See if File::Glob + threads works
+ ext/GDBM_File/GDBM_File.pm GDBM extension Perl module
+ ext/GDBM_File/GDBM_File.xs GDBM extension external subroutines
+ ext/GDBM_File/hints/sco.pl Hint for GDBM_File for named architecture
+diff --git a/ext/File-Glob/Glob.xs b/ext/File-Glob/Glob.xs
+index d74e7a4..6c69aa6 100644
+--- a/ext/File-Glob/Glob.xs
++++ b/ext/File-Glob/Glob.xs
+@@ -9,6 +9,9 @@
+ #define MY_CXT_KEY "File::Glob::_guts" XS_VERSION
+
+ typedef struct {
++#ifdef USE_ITHREADS
++ tTHX interp;
++#endif
+ int x_GLOB_ERROR;
+ HV * x_GLOB_ENTRIES;
+ } my_cxt_t;
+@@ -380,6 +383,33 @@ PPCODE:
+ iterate(aTHX_ doglob_iter_wrapper);
+ SPAGAIN;
+
++#ifdef USE_ITHREADS
++
++void
++CLONE(...)
++INIT:
++ HV *glob_entries_clone = NULL;
++CODE:
++ PERL_UNUSED_ARG(items);
++ {
++ dMY_CXT;
++ if ( MY_CXT.x_GLOB_ENTRIES ) {
++ CLONE_PARAMS param;
++ param.stashes = NULL;
++ param.flags = 0;
++ param.proto_perl = MY_CXT.interp;
++
++ glob_entries_clone = MUTABLE_HV(sv_dup_inc((SV*)MY_CXT.x_GLOB_ENTRIES, ¶m));
++ }
++ }
++ {
++ MY_CXT_CLONE;
++ MY_CXT.x_GLOB_ENTRIES = glob_entries_clone;
++ MY_CXT.interp = aTHX;
++ }
++
++#endif
++
+ BOOT:
+ {
+ #ifndef PERL_EXTERNAL_GLOB
+@@ -394,6 +424,9 @@ BOOT:
+ {
+ dMY_CXT;
+ MY_CXT.x_GLOB_ENTRIES = NULL;
++#ifdef USE_ITHREADS
++ MY_CXT.interp = aTHX;
++#endif
+ }
+ }
+
+diff --git a/ext/File-Glob/t/threads.t b/ext/File-Glob/t/threads.t
+new file mode 100644
+index 0000000..141450a
+--- /dev/null
++++ b/ext/File-Glob/t/threads.t
+@@ -0,0 +1,71 @@
++#!./perl
++
++BEGIN {
++ chdir 't' if -d 't';
++ @INC = '../lib';
++ require Config; import Config;
++ if ($Config{'extensions'} !~ /\bFile\/Glob\b/i) {
++ print "1..0\n";
++ exit 0;
++ }
++}
++use strict;
++use warnings;
++# Test::More needs threads pre-loaded
++use if $Config{useithreads}, 'threads';
++use Test::More;
++
++BEGIN {
++ if (! $Config{'useithreads'}) {
++ plan skip_all => "Perl not compiled with 'useithreads'";
++ }
++}
++
++use File::Temp qw(tempdir);
++use File::Spec qw();
++use File::Glob qw(csh_glob);
++
++my($dir) = tempdir(CLEANUP => 1)
++ or die "Could not create temporary directory";
++
++my @temp_files = qw(1_file 2_file 3_file);
++for my $file (@temp_files) {
++ open my $fh, ">", File::Spec->catfile($dir, $file)
++ or die "Could not create file $dir/$file: $!";
++ close $fh;
++}
++my $cwd = Cwd::cwd();
++chdir $dir
++ or die "Could not chdir to $dir: $!";
++
++sub do_glob { scalar csh_glob("*") }
++# Stablish some glob state
++my $first_file = do_glob();
++is($first_file, $temp_files[0]);
++
++my @files;
++push @files, threads->create(\&do_glob)->join() for 1..5;
++is_deeply(
++ \@files,
++ [($temp_files[1]) x 5],
++ "glob() state is cloned for new threads"
++);
++
++@files = threads->create({'context' => 'list'},
++ sub {
++ return do_glob(), threads->create(\&do_glob)->join()
++ })->join();
++
++is_deeply(
++ \@files,
++ [@temp_files[1,2]],
++ "..and for new threads inside threads"
++);
++
++my $second_file = do_glob();
++is($second_file, $temp_files[1], "state doesn't leak from threads");
++
++chdir $cwd
++ or die "Could not chdir back to $cwd: $!";
++
++done_testing;
+--
+2.4.3
+
diff --git a/SOURCES/perl-5.16.3-Fix-incorrect-handling-of-CRLF-in-Net-FTP.patch b/SOURCES/perl-5.16.3-Fix-incorrect-handling-of-CRLF-in-Net-FTP.patch
new file mode 100644
index 0000000..eadad5b
--- /dev/null
+++ b/SOURCES/perl-5.16.3-Fix-incorrect-handling-of-CRLF-in-Net-FTP.patch
@@ -0,0 +1,38 @@
+From 7c8b0c1259db2bdd372cc1bdb63bf5b89a969a4a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?=
+Date: Tue, 27 Oct 2015 16:33:43 +0100
+Subject: [PATCH] Fix incorrect handling of CRLF in Net::FTP
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+libnet upstream commit ported to perl-5.16.3:
+
+From 24eb8619451c3d8529d903d9133d03a7f447488f Mon Sep 17 00:00:00 2001
+From: Steve Hay
+Date: Fri, 3 Jan 2014 17:41:55 +0000
+Subject: [PATCH] Fix incorrect handling of CRLF in Net::FTP
+
+Signed-off-by: Petr Písař
+---
+ cpan/libnet/Net/FTP/A.pm | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/cpan/libnet/Net/FTP/A.pm b/cpan/libnet/Net/FTP/A.pm
+index 427d02b..886d252 100644
+--- a/cpan/libnet/Net/FTP/A.pm
++++ b/cpan/libnet/Net/FTP/A.pm
+@@ -77,8 +77,8 @@ sub write {
+ my $timeout = @_ ? shift: $data->timeout;
+
+ my $nr = (my $tmp = substr($buf, 0, $size)) =~ tr/\r\n/\015\012/;
+- $tmp =~ s/([^\015])\012/$1\015\012/sg if $nr;
+- $tmp =~ s/^\012/\015\012/ unless ${*$data}{'net_ftp_outcr'};
++ $tmp =~ s/(?
+Date: Fri, 28 Aug 2015 14:17:00 -0300
+Subject: [PATCH] Properly duplicate PerlIO::encoding objects
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream commit ported to 5.16.3:
+
+commit 0ee3fa26f660ac426e3e082f77d806c9d1471f93
+Author: Vincent Pit
+Date: Fri Aug 28 14:17:00 2015 -0300
+
+ Properly duplicate PerlIO::encoding objects
+
+ PerlIO::encoding objects are usually initialized by calling Perl methods,
+ essentially from the pushed() and getarg() callbacks. During cloning, the
+ PerlIO API will by default call these methods to initialize the duplicate
+ struct when the PerlIOBase parent struct is itself duplicated. This does
+ not behave so well because the perl interpreter is not ready to call
+ methods at this point, for the stacks are not set up yet.
+
+ The proper way to duplicate the PerlIO::encoding object is to call sv_dup()
+ on its members from the dup() PerlIO callback. So the only catch is to make
+ the getarg() and pushed() calls implied by the duplication of the underlying
+ PerlIOBase object aware that they are called during cloning, and make them
+ wait that the control flow returns to the dup() callback. Fortunately,
+ getarg() knows since its param argument is then non-null, and its return
+ value is passed immediately to pushed(), so it is enough to tag this
+ returned value with a custom magic so that pushed() can see it is being
+ called during cloning.
+
+ This fixes [RT #31923].
+
+Signed-off-by: Petr Písař
+---
+ MANIFEST | 1 +
+ ext/PerlIO-encoding/encoding.xs | 25 +++++++++++++++++++++++--
+ ext/PerlIO-encoding/t/threads.t | 35 +++++++++++++++++++++++++++++++++++
+ 3 files changed, 59 insertions(+), 2 deletions(-)
+ create mode 100644 ext/PerlIO-encoding/t/threads.t
+
+diff --git a/MANIFEST b/MANIFEST
+index 02e8234..5caa981 100644
+--- a/MANIFEST
++++ b/MANIFEST
+@@ -3791,6 +3791,7 @@ ext/PerlIO-encoding/MANIFEST PerlIO::encoding list of files
+ ext/PerlIO-encoding/t/encoding.t See if PerlIO encoding conversion works
+ ext/PerlIO-encoding/t/fallback.t See if PerlIO fallbacks work
+ ext/PerlIO-encoding/t/nolooping.t Tests for PerlIO::encoding
++ext/PerlIO-encoding/t/threads.t Tests PerlIO::encoding and threads
+ ext/PerlIO-mmap/mmap.pm PerlIO layer for memory maps
+ ext/PerlIO-mmap/mmap.xs PerlIO layer for memory maps
+ ext/PerlIO-scalar/scalar.pm PerlIO layer for scalars
+diff --git a/ext/PerlIO-encoding/encoding.xs b/ext/PerlIO-encoding/encoding.xs
+index 98d89e9..d5efb62 100644
+--- a/ext/PerlIO-encoding/encoding.xs
++++ b/ext/PerlIO-encoding/encoding.xs
+@@ -49,13 +49,23 @@ typedef struct {
+
+ #define NEEDS_LINES 1
+
++static const MGVTBL PerlIOEncode_tag = { 0, 0, 0, 0, 0, 0, 0, 0 };
++
+ SV *
+ PerlIOEncode_getarg(pTHX_ PerlIO * f, CLONE_PARAMS * param, int flags)
+ {
+ PerlIOEncode *e = PerlIOSelf(f, PerlIOEncode);
+- SV *sv = &PL_sv_undef;
+- PERL_UNUSED_ARG(param);
++ SV *sv;
+ PERL_UNUSED_ARG(flags);
++ /* During cloning, return an undef token object so that _pushed() knows
++ * that it should not call methods and wait for _dup() to actually dup the
++ * encoding object. */
++ if (param) {
++ sv = newSV(0);
++ sv_magicext(sv, NULL, PERL_MAGIC_ext, &PerlIOEncode_tag, 0, 0);
++ return sv;
++ }
++ sv = &PL_sv_undef;
+ if (e->enc) {
+ dSP;
+ /* Not 100% sure stack swap is right thing to do during dup ... */
+@@ -86,6 +96,14 @@ PerlIOEncode_pushed(pTHX_ PerlIO * f, const char *mode, SV * arg, PerlIO_funcs *
+ IV code = PerlIOBuf_pushed(aTHX_ f, mode, Nullsv,tab);
+ SV *result = Nullsv;
+
++ if (SvTYPE(arg) >= SVt_PVMG
++ && mg_findext(arg, PERL_MAGIC_ext, &PerlIOEncode_tag)) {
++ e->enc = NULL;
++ e->chk = NULL;
++ e->inEncodeCall = 0;
++ return code;
++ }
++
+ PUSHSTACKi(PERLSI_MAGIC);
+ SPAGAIN;
+
+@@ -558,6 +576,9 @@ PerlIOEncode_dup(pTHX_ PerlIO * f, PerlIO * o,
+ if (oe->enc) {
+ fe->enc = PerlIO_sv_dup(aTHX_ oe->enc, params);
+ }
++ if (oe->chk) {
++ fe->chk = PerlIO_sv_dup(aTHX_ oe->chk, params);
++ }
+ }
+ return f;
+ }
+diff --git a/ext/PerlIO-encoding/t/threads.t b/ext/PerlIO-encoding/t/threads.t
+new file mode 100644
+index 0000000..64f0e55
+--- /dev/null
++++ b/ext/PerlIO-encoding/t/threads.t
+@@ -0,0 +1,35 @@
++#!perl
++
++use strict;
++use warnings;
++
++BEGIN {
++ use Config;
++ if ($Config{extensions} !~ /\bEncode\b/) {
++ print "1..0 # Skip: no Encode\n";
++ exit 0;
++ }
++ unless ($Config{useithreads}) {
++ print "1..0 # Skip: no threads\n";
++ exit 0;
++ }
++}
++
++use threads;
++
++use Test::More tests => 3 + 1;
++
++binmode *STDOUT, ':encoding(UTF-8)';
++
++SKIP: {
++ local $@;
++ my $ret = eval {
++ my $thread = threads->create(sub { pass 'in thread'; return 1 });
++ skip 'test thread could not be spawned' => 3 unless $thread;
++ $thread->join;
++ };
++ is $@, '', 'thread did not croak';
++ is $ret, 1, 'thread returned the right value';
++}
++
++pass 'passes at least one test';
+--
+2.5.5
+
diff --git a/SOURCES/perl-5.20.3-Don-t-leak-the-temp-utf8-copy-of-n.patch b/SOURCES/perl-5.20.3-Don-t-leak-the-temp-utf8-copy-of-n.patch
new file mode 100644
index 0000000..811584a
--- /dev/null
+++ b/SOURCES/perl-5.20.3-Don-t-leak-the-temp-utf8-copy-of-n.patch
@@ -0,0 +1,33 @@
+From 8d89c0509dd5eb1de58dc6617f6e08599eb24792 Mon Sep 17 00:00:00 2001
+From: Tony Cook
+Date: Mon, 10 Aug 2015 13:37:26 +0100
+Subject: [PATCH] [PATCH] [perl #123786] don't leak the temp utf8 copy of
+ namepv
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Petr Písař
+---
+ pad.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/pad.c b/pad.c
+index fed2892..f22c3c5 100644
+--- a/pad.c
++++ b/pad.c
+@@ -976,8 +976,10 @@ Perl_pad_findmy_pvn(pTHX_ const char *namepv, STRLEN namelen, U32 flags)
+
+ if (is_utf8)
+ flags |= padadd_UTF8_NAME;
+- else
++ else {
+ flags &= ~padadd_UTF8_NAME;
++ SAVEFREEPV(namepv);
++ }
+ }
+
+ offset = pad_findlex(namepv, namelen, flags,
+--
+2.4.3
+
diff --git a/SPECS/perl.spec b/SPECS/perl.spec
index 6be225d..ecf67b0 100644
--- a/SPECS/perl.spec
+++ b/SPECS/perl.spec
@@ -31,7 +31,7 @@
Name: perl
Version: %{perl_version}
# release number must be even higher, because dual-lived modules will be broken otherwise
-Release: 286%{?dist}
+Release: 291%{?dist}
Epoch: %{perl_epoch}
Summary: Practical Extraction and Report Language
Group: Development/Languages
@@ -151,6 +151,24 @@ Patch32: perl-5.16.3-t-op-taint.t-Perform-SHA-256-algorithm-by-crypt-if-d
# in upstream after 5.19.1
Patch33: perl-5.16.3-Benchmark.t-remove-CPU-speed-sensitive-test.patch
+# Make File::Glob work with threads again, bug #1223045
+# RT#119897, in upstream after 5.19.5
+Patch34: perl-5.16.3-File-Glob-Dup-glob-state-in-CLONE.patch
+
+# Fix CRLF conversion in ASCII FTP upload, bug #1263734, CPAN RT#41642
+Patch35: perl-5.16.3-Fix-incorrect-handling-of-CRLF-in-Net-FTP.patch
+
+# Don't leak the temp utf8 copy of namepv, bug #1063330, CPAN RT#123786
+Patch36: perl-5.20.3-Don-t-leak-the-temp-utf8-copy-of-n.patch
+
+# Fix duplicating PerlIO::encoding when spawning threads, bug #1344749,
+# RT#31923, in upstream after 5.23.3
+Patch37: perl-5.16.3-Properly-duplicate-PerlIO-encoding-objects.patch
+
+# Backported libraries historically supplied with Perl 4 from Perl 5.10.1.
+# It is used as a workaround before adding perl-Perl4-CoreLibs to RHEL 7
+Patch38: Backport-Perl4-CoreLibs.patch
+
# Update some of the bundled modules
# see http://fedoraproject.org/wiki/Perl/perl.spec for instructions
@@ -183,42 +201,10 @@ Provides: perl(:WITH_LARGEFILES)
# PerlIO provides
Provides: perl(:WITH_PERLIO)
# File provides
-Provides: perl(abbrev.pl)
-Provides: perl(assert.pl)
-Provides: perl(bigfloat.pl)
-Provides: perl(bigint.pl)
-Provides: perl(bigrat.pl)
Provides: perl(bytes_heavy.pl)
-Provides: perl(cacheout.pl)
-Provides: perl(complete.pl)
-Provides: perl(ctime.pl)
-Provides: perl(dotsh.pl)
Provides: perl(dumpvar.pl)
-Provides: perl(exceptions.pl)
-Provides: perl(fastcwd.pl)
-Provides: perl(find.pl)
-Provides: perl(finddepth.pl)
-Provides: perl(flush.pl)
-Provides: perl(ftp.pl)
-Provides: perl(getcwd.pl)
-Provides: perl(getopt.pl)
-Provides: perl(getopts.pl)
-Provides: perl(hostname.pl)
-Provides: perl(importenv.pl)
-Provides: perl(look.pl)
-Provides: perl(newgetopt.pl)
-Provides: perl(open2.pl)
-Provides: perl(open3.pl)
Provides: perl(perl5db.pl)
-Provides: perl(pwd.pl)
-Provides: perl(shellwords.pl)
-Provides: perl(stat.pl)
-Provides: perl(syslog.pl)
-Provides: perl(tainted.pl)
-Provides: perl(termcap.pl)
-Provides: perl(timelocal.pl)
Provides: perl(utf8_heavy.pl)
-Provides: perl(validate.pl)
# suidperl isn't created by upstream since 5.12.0
Obsoletes: perl-suidperl <= 4:5.12.2
@@ -1390,6 +1376,61 @@ Parse::CPAN::Meta is a parser for META.yml files, based on the parser half of
YAML::Tiny.
%endif
+%package Perl4-CoreLibs
+Summary: Libraries historically supplied with Perl 4
+Version: 0.001
+Epoch: 0
+License: GPL+ or Artistic
+Group: Development/Libraries
+BuildArch: noarch
+Requires: %perl_compat
+Requires: perl(File::Find)
+Requires: perl(IPC::Open2)
+Requires: perl(IPC::Open3)
+Requires: perl(Socket)
+Requires: perl(Text::ParseWords) >= 3.25
+Requires: perl(Time::Local)
+Requires: perl(warnings::register)
+Provides: perl(abbrev.pl)
+Provides: perl(assert.pl)
+Provides: perl(bigfloat.pl)
+Provides: perl(bigint.pl)
+Provides: perl(bigrat.pl)
+Provides: perl(cacheout.pl)
+Provides: perl(complete.pl)
+Provides: perl(ctime.pl)
+Provides: perl(dotsh.pl)
+Provides: perl(exceptions.pl)
+Provides: perl(fastcwd.pl)
+Provides: perl(find.pl)
+Provides: perl(finddepth.pl)
+Provides: perl(flush.pl)
+Provides: perl(getcwd.pl)
+Provides: perl(getopt.pl)
+Provides: perl(getopts.pl)
+Provides: perl(hostname.pl)
+Provides: perl(importenv.pl)
+Provides: perl(look.pl)
+Provides: perl(newgetopt.pl)
+Provides: perl(open2.pl)
+Provides: perl(open3.pl)
+Provides: perl(pwd.pl)
+Provides: perl(shellwords.pl)
+Provides: perl(stat.pl)
+Provides: perl(syslog.pl)
+Provides: perl(tainted.pl)
+Provides: perl(termcap.pl)
+Provides: perl(timelocal.pl)
+Provides: perl(validate.pl)
+
+%description Perl4-CoreLibs
+This is a collection of .pl files that have historically been bundled with the
+Perl core and were removed from perl 5.16. These files should not be used by
+new code. Functionally, most have been directly superseded by modules in the
+Perl 5 style. This collection exists to support old Perl programs that
+predates satisfactory replacements.
+
+
%if %{dual_life} || %{rebuild_from_scratch}
%package Perl-OSType
Summary: Map Perl operating system names to generic types
@@ -1968,6 +2009,11 @@ tarball from perl.org.
%patch31 -p1
%patch32 -p1
%patch33 -p1
+%patch34 -p1
+%patch35 -p1
+%patch36 -p1
+%patch37 -p1
+%patch38 -p1
%if !%{defined perl_bootstrap}
# Local patch tracking
@@ -2003,6 +2049,11 @@ perl -x patchlevel.h \
'RHEL Patch31: Make *DBM_File desctructors thread-safe (RT#61912)' \
'RHEL Patch32: Use stronger algorithm needed for FIPS in t/op/taint.t (RT#123338)' \
'RHEL Patch33: Remove CPU-speed-sensitive test in Benchmark test' \
+ 'RHEL Patch34: Make File::Glob work with threads again' \
+ 'RHEL Patch35: Fix CRLF conversion in ASCII FTP upload (CPAN RT#41642)' \
+ 'RHEL Patch36: Do not leak the temp utf8 copy of namepv (CPAN RT#123786)' \
+ 'RHEL Patch37: Fix duplicating PerlIO::encoding when spawning threads (RT#31923)' \
+ 'RHEL Patch38: Backported libraries historically supplied with Perl 4' \
%{nil}
%endif
@@ -2708,6 +2759,40 @@ sed \
%exclude %{privlib}/Params/
%exclude %{_mandir}/man3/Params::Check*
+# Perl4-CoreLibs
+%exclude %{privlib}/abbrev.pl
+%exclude %{privlib}/assert.pl
+%exclude %{privlib}/bigfloat.pl
+%exclude %{privlib}/bigint.pl
+%exclude %{privlib}/bigrat.pl
+%exclude %{privlib}/cacheout.pl
+%exclude %{privlib}/complete.pl
+%exclude %{privlib}/ctime.pl
+%exclude %{privlib}/dotsh.pl
+%exclude %{privlib}/exceptions.pl
+%exclude %{privlib}/fastcwd.pl
+%exclude %{privlib}/find.pl
+%exclude %{privlib}/finddepth.pl
+%exclude %{privlib}/flush.pl
+%exclude %{privlib}/getcwd.pl
+%exclude %{privlib}/getopt.pl
+%exclude %{privlib}/getopts.pl
+%exclude %{privlib}/hostname.pl
+%exclude %{privlib}/importenv.pl
+%exclude %{privlib}/look.pl
+%exclude %{privlib}/newgetopt.pl
+%exclude %{privlib}/open2.pl
+%exclude %{privlib}/open3.pl
+%exclude %{privlib}/pwd.pl
+%exclude %{privlib}/shellwords.pl
+%exclude %{privlib}/stat.pl
+%exclude %{privlib}/syslog.pl
+%exclude %{privlib}/tainted.pl
+%exclude %{privlib}/termcap.pl
+%exclude %{privlib}/timelocal.pl
+%exclude %{privlib}/validate.pl
+
+
# Perl-OSType
%exclude %{privlib}/Perl/OSType.pm
%exclude %{_mandir}/man3/Perl::OSType.3pm*
@@ -3443,6 +3528,39 @@ sed \
%{_mandir}/man3/Parse::CPAN::Meta.3*
%endif
+%files Perl4-CoreLibs
+%{privlib}/abbrev.pl
+%{privlib}/assert.pl
+%{privlib}/bigfloat.pl
+%{privlib}/bigint.pl
+%{privlib}/bigrat.pl
+%{privlib}/cacheout.pl
+%{privlib}/complete.pl
+%{privlib}/ctime.pl
+%{privlib}/dotsh.pl
+%{privlib}/exceptions.pl
+%{privlib}/fastcwd.pl
+%{privlib}/find.pl
+%{privlib}/finddepth.pl
+%{privlib}/flush.pl
+%{privlib}/getcwd.pl
+%{privlib}/getopt.pl
+%{privlib}/getopts.pl
+%{privlib}/hostname.pl
+%{privlib}/importenv.pl
+%{privlib}/look.pl
+%{privlib}/newgetopt.pl
+%{privlib}/open2.pl
+%{privlib}/open3.pl
+%{privlib}/pwd.pl
+%{privlib}/shellwords.pl
+%{privlib}/stat.pl
+%{privlib}/syslog.pl
+%{privlib}/tainted.pl
+%{privlib}/termcap.pl
+%{privlib}/timelocal.pl
+%{privlib}/validate.pl
+
%if %{dual_life} || %{rebuild_from_scratch}
%files parent
%{privlib}/parent.pm
@@ -3685,6 +3803,23 @@ sed \
# Old changelog entries are preserved in CVS.
%changelog
+* Wed Aug 17 2016 Jitka Plesnikova - 4:5.16.3-291
+- Backported and sub-packaged libraries historically supplied with Perl 4
+ into perl-Perl4-CoreLibs
+
+* Tue Aug 16 2016 Jitka Plesnikova - 4:5.16.3-290
+- Removed deprecated files from provides (bug #1365991)
+
+* Mon Jun 13 2016 Petr Pisar - 4:5.16.3-289
+- Fix duplicating PerlIO::encoding when spawning threads (bug #1344749)
+
+* Wed Mar 02 2016 Jitka Plesnikova - 4:5.16.3-288
+- Fix CRLF conversion in ASCII FTP upload (bug #1263734)
+- Don't leak the temp utf8 copy of namepv (bug #1063330)
+
+* Wed Mar 02 2016 Petr Šabata - 4:5.16.3-287
+- Make File::Glob work with threads again (bug #1223045)
+
* Thu Jul 02 2015 Petr Pisar - 4:5.16.3-286
- Remove CPU-speed-sensitive test in Benchmark test (bug #1238567)
- Rebuild with corrected binutils to fix systemtap support (bug #1238472)