diff options
Diffstat (limited to 'lang/perl5.16/files')
-rw-r--r-- | lang/perl5.16/files/patch-INST_PREFIX.t | 20 | ||||
-rw-r--r-- | lang/perl5.16/files/patch-MM_Any.pm | 18 | ||||
-rw-r--r-- | lang/perl5.16/files/patch-freebsd.sh | 66 | ||||
-rw-r--r-- | lang/perl5.16/files/patch-makedepend | 10 | ||||
-rw-r--r-- | lang/perl5.16/files/patch-perl.c | 58 | ||||
-rw-r--r-- | lang/perl5.16/files/patch-utf-regcomp | 95 | ||||
-rw-r--r-- | lang/perl5.16/files/perl-after-upgrade | 629 | ||||
-rw-r--r-- | lang/perl5.16/files/use.perl | 268 |
8 files changed, 0 insertions, 1164 deletions
diff --git a/lang/perl5.16/files/patch-INST_PREFIX.t b/lang/perl5.16/files/patch-INST_PREFIX.t deleted file mode 100644 index 9520ef26890c..000000000000 --- a/lang/perl5.16/files/patch-INST_PREFIX.t +++ /dev/null @@ -1,20 +0,0 @@ ---- lib/ExtUtils/t/INST_PREFIX.t.orig Wed Feb 15 12:46:31 2006 -+++ lib/ExtUtils/t/INST_PREFIX.t Wed Feb 15 12:46:52 2006 -@@ -16,7 +16,7 @@ BEGIN { - } - - use strict; --use Test::More tests => 52; -+use Test::More tests => 51; - use MakeMaker::Test::Utils; - use MakeMaker::Test::Setup::BFD; - use ExtUtils::MakeMaker; -@@ -62,7 +62,7 @@ like( $stdout->read, qr{ - Writing\ $Makefile\ for\ Big::Dummy\n - }x ); - --is( $mm->{PREFIX}, '$(SITEPREFIX)', 'PREFIX set based on INSTALLDIRS' ); -+## is( $mm->{PREFIX}, '$(SITEPREFIX)', 'PREFIX set based on INSTALLDIRS' ); - - isa_ok( $mm, 'ExtUtils::MakeMaker' ); - diff --git a/lang/perl5.16/files/patch-MM_Any.pm b/lang/perl5.16/files/patch-MM_Any.pm deleted file mode 100644 index 4e50627b00a8..000000000000 --- a/lang/perl5.16/files/patch-MM_Any.pm +++ /dev/null @@ -1,18 +0,0 @@ ---- lib/ExtUtils/MM_Any.pm.orig Wed Feb 15 12:20:43 2006 -+++ lib/ExtUtils/MM_Any.pm Wed Feb 15 12:22:29 2006 -@@ -1069,13 +1069,14 @@ sub init_INSTALL_from_PREFIX { - ('$(PREFIX)') x 3; - } - else { -+ $self->{PREFIX} ||= $iprefix; - $self->{PERLPREFIX} ||= $iprefix; - $self->{SITEPREFIX} ||= $sprefix; - $self->{VENDORPREFIX} ||= $vprefix; - - # Lots of MM extension authors like to use $(PREFIX) so we - # put something sensible in there no matter what. -- $self->{PREFIX} = '$('.uc $self->{INSTALLDIRS}.'PREFIX)'; -+ #$self->{PREFIX} = '$('.uc $self->{INSTALLDIRS}.'PREFIX)'; - } - - my $arch = $Config{archname}; diff --git a/lang/perl5.16/files/patch-freebsd.sh b/lang/perl5.16/files/patch-freebsd.sh deleted file mode 100644 index ca8fa5a82cfb..000000000000 --- a/lang/perl5.16/files/patch-freebsd.sh +++ /dev/null @@ -1,66 +0,0 @@ ---- hints/freebsd.sh.orig Wed Mar 24 22:47:33 2004 -+++ hints/freebsd.sh Mon Feb 19 20:53:50 2007 -@@ -88,6 +88,8 @@ case "$osvers" in - esac - libswanted=`echo $libswanted | sed 's/ malloc / /'` - libswanted=`echo $libswanted | sed 's/ bind / /'` -+ libswanted=`echo $libswanted | sed 's/ dl / /'` -+ libswanted=`echo $libswanted | sed 's/ c / /'` - # iconv gone in Perl 5.8.1, but if someone compiles 5.8.0 or earlier. - libswanted=`echo $libswanted | sed 's/ iconv / /'` - d_setregid='define' -@@ -102,6 +104,10 @@ case "$osvers" in - ;; - esac - libswanted=`echo $libswanted | sed 's/ malloc / /'` -+ libswanted=`echo $libswanted | sed 's/ bind / /'` -+ libswanted=`echo $libswanted | sed 's/ dl / /'` -+ libswanted=`echo $libswanted | sed 's/ iconv / /'` -+ libswanted=`echo $libswanted | sed 's/ c / /'` - ;; - esac - -@@ -116,17 +122,17 @@ case "$osvers" in - - *) - objformat=`/usr/bin/objformat` -- if [ x$objformat = xelf ]; then -- libpth="/usr/lib /usr/local/lib" -- glibpth="/usr/lib /usr/local/lib" -- ldflags="-Wl,-E " -- lddlflags="-shared " -- else -+ if [ x$objformat = xaout ]; then - if [ -e /usr/lib/aout ]; then - libpth="/usr/lib/aout /usr/local/lib /usr/lib" - glibpth="/usr/lib/aout /usr/local/lib /usr/lib" - fi - lddlflags='-Bshareable' -+ else -+ libpth="/usr/lib /usr/local/lib" -+ glibpth="/usr/lib /usr/local/lib" -+ ldflags="%%PTHREAD_LIBS%% -Wl,-E" -+ lddlflags="-shared " - fi - cccdlflags='-DPIC -fPIC' - ;; -@@ -136,7 +142,7 @@ case "$osvers" in - 0*|1*|2*|3*) ;; - - *) -- ccflags="${ccflags} -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H" -+ ccflags="${ccflags} %%PTHREAD_CFLAGS%% -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H" - if /usr/bin/file -L /usr/lib/libc.so | /usr/bin/grep -vq "not stripped" ; then - usenm=false - fi -@@ -183,7 +189,9 @@ esac - - # This script UU/usethreads.cbu will get 'called-back' by Configure - # after it has prompted the user for whether to use threads. --cat > UU/usethreads.cbu <<'EOCBU' -+## not quite - modern FreeBSD perl port is supposed to take care of that -+## we just add extra libraries and cflags nowadays -+cat > /dev/null <<'EOCBU' - case "$usethreads" in - $define|true|[yY]*) - lc_r=`/sbin/ldconfig -r|grep ':-lc_r'|awk '{print $NF}'|sed -n '$p'` diff --git a/lang/perl5.16/files/patch-makedepend b/lang/perl5.16/files/patch-makedepend deleted file mode 100644 index 4a79cc4ecbd3..000000000000 --- a/lang/perl5.16/files/patch-makedepend +++ /dev/null @@ -1,10 +0,0 @@ ---- makedepend.SH.orig Wed May 2 22:37:13 2007 -+++ makedepend.SH Wed May 2 22:38:48 2007 -@@ -167,6 +167,7 @@ - -e '/^#.*<builtin>/d' \ - -e '/^#.*<built-in>/d' \ - -e '/^#.*<command line>/d' \ -+ -e '/^#.*<command-line>/d' \ - -e '/^#.*"-"/d' \ - -e '/: file path prefix .* never used$/d' \ - -e 's#\.[0-9][0-9]*\.c#'"$file.c#" \ diff --git a/lang/perl5.16/files/patch-perl.c b/lang/perl5.16/files/patch-perl.c deleted file mode 100644 index 918c773b8ccb..000000000000 --- a/lang/perl5.16/files/patch-perl.c +++ /dev/null @@ -1,58 +0,0 @@ ---- perl.c.orig Fri Apr 22 16:14:27 2005 -+++ perl.c Thu Dec 22 12:47:28 2005 -@@ -4397,6 +4397,27 @@ S_init_perllib(pTHX) - incpush(APPLLIB_EXP, TRUE, TRUE, TRUE); - #endif - -+#ifdef SITEARCH_EXP -+ /* sitearch is always relative to sitelib on Windows for -+ * DLL-based path intuition to work correctly */ -+# if !defined(WIN32) -+ incpush(SITEARCH_EXP, FALSE, FALSE, TRUE); -+# endif -+#endif -+ -+#ifdef SITELIB_EXP -+# if defined(WIN32) -+ /* this picks up sitearch as well */ -+ incpush(SITELIB_EXP, TRUE, FALSE, TRUE); -+# else -+ incpush(SITELIB_EXP, FALSE, FALSE, TRUE); -+# endif -+#endif -+ -+#ifdef SITELIB_STEM /* Search for version-specific dirs below here */ -+ incpush(SITELIB_STEM, FALSE, TRUE, TRUE); -+#endif -+ - #ifdef ARCHLIB_EXP - incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE); - #endif -@@ -4428,27 +4449,6 @@ S_init_perllib(pTHX) - incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE); - #else - incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE); --#endif -- --#ifdef SITEARCH_EXP -- /* sitearch is always relative to sitelib on Windows for -- * DLL-based path intuition to work correctly */ --# if !defined(WIN32) -- incpush(SITEARCH_EXP, FALSE, FALSE, TRUE); --# endif --#endif -- --#ifdef SITELIB_EXP --# if defined(WIN32) -- /* this picks up sitearch as well */ -- incpush(SITELIB_EXP, TRUE, FALSE, TRUE); --# else -- incpush(SITELIB_EXP, FALSE, FALSE, TRUE); --# endif --#endif -- --#ifdef SITELIB_STEM /* Search for version-specific dirs below here */ -- incpush(SITELIB_STEM, FALSE, TRUE, TRUE); - #endif - - #ifdef PERL_VENDORARCH_EXP diff --git a/lang/perl5.16/files/patch-utf-regcomp b/lang/perl5.16/files/patch-utf-regcomp deleted file mode 100644 index 44c9a55de49a..000000000000 --- a/lang/perl5.16/files/patch-utf-regcomp +++ /dev/null @@ -1,95 +0,0 @@ ---- regcomp.c.orig 2006-01-08 21:59:27.000000000 +0100 -+++ regcomp.c 2007-11-06 22:48:26.000000000 +0100 -@@ -135,7 +135,10 @@ typedef struct RExC_state_t { - I32 extralen; - I32 seen_zerolen; - I32 seen_evals; -- I32 utf8; -+ I32 utf8; /* whether the pattern is utf8 or not */ -+ I32 orig_utf8; /* whether the pattern was originally in utf8 */ -+ /* XXX use this for future optimisation of case -+ * where pattern must be upgraded to utf8. */ - #if ADD_TO_REGEXEC - char *starttry; /* -Dr: where regtry was called. */ - #define RExC_starttry (pRExC_state->starttry) -@@ -161,6 +164,7 @@ typedef struct RExC_state_t { - #define RExC_seen_zerolen (pRExC_state->seen_zerolen) - #define RExC_seen_evals (pRExC_state->seen_evals) - #define RExC_utf8 (pRExC_state->utf8) -+#define RExC_orig_utf8 (pRExC_state->orig_utf8) - - #define ISMULT1(c) ((c) == '*' || (c) == '+' || (c) == '?') - #define ISMULT2(s) ((*s) == '*' || (*s) == '+' || (*s) == '?' || \ -@@ -1749,15 +1753,16 @@ Perl_pregcomp(pTHX_ char *exp, char *xen - if (exp == NULL) - FAIL("NULL regexp argument"); - -- RExC_utf8 = pm->op_pmdynflags & PMdf_CMP_UTF8; -+ RExC_utf8 = RExC_orig_utf8 = pm->op_pmdynflags & PMdf_CMP_UTF8; - -- RExC_precomp = exp; - DEBUG_r({ - if (!PL_colorset) reginitcolors(); - PerlIO_printf(Perl_debug_log, "%sCompiling REx%s `%s%*s%s'\n", - PL_colors[4],PL_colors[5],PL_colors[0], -- (int)(xend - exp), RExC_precomp, PL_colors[1]); -+ (int)(xend - exp), exp, PL_colors[1]); - }); -+redo_first_pass: -+ RExC_precomp = exp; - RExC_flags = pm->op_pmflags; - RExC_sawback = 0; - -@@ -1783,6 +1788,25 @@ Perl_pregcomp(pTHX_ char *exp, char *xen - RExC_precomp = Nullch; - return(NULL); - } -+ if (RExC_utf8 && !RExC_orig_utf8) { -+ /* It's possible to write a regexp in ascii that represents unicode -+ codepoints outside of the byte range, such as via \x{100}. If we -+ detect such a sequence we have to convert the entire pattern to utf8 -+ and then recompile, as our sizing calculation will have been based -+ on 1 byte == 1 character, but we will need to use utf8 to encode -+ at least some part of the pattern, and therefore must convert the whole -+ thing. -+ XXX: somehow figure out how to make this less expensive... -+ -- dmq */ -+ STRLEN len = xend-exp; -+ DEBUG_r(PerlIO_printf(Perl_debug_log, -+ "UTF8 mismatch! Converting to utf8 for resizing and compile\n")); -+ exp = (char*)Perl_bytes_to_utf8(aTHX_ (U8*)exp, &len); -+ xend = exp + len; -+ RExC_orig_utf8 = RExC_utf8; -+ SAVEFREEPV(exp); -+ goto redo_first_pass; -+ } - DEBUG_r(PerlIO_printf(Perl_debug_log, "size %"IVdf" ", (IV)RExC_size)); - - /* Small enough for pointer-storage convention? ---- t/op/pat.t.orig 2006-01-07 13:53:32.000000000 +0100 -+++ t/op/pat.t 2007-11-06 21:52:30.000000000 +0100 -@@ -6,7 +6,7 @@ - - $| = 1; - --print "1..1187\n"; -+print "1..1189\n"; - - BEGIN { - chdir 't' if -d 't'; -@@ -3395,5 +3395,14 @@ ok(("foba ba$s" =~ qr/(foo|BaSS|bar)/i) - "# assigning to original string should not corrupt match vars"); - } - --# last test 1187 -+{ -+ use warnings; -+ my @w; -+ local $SIG{__WARN__}=sub{push @w,"@_"}; -+ my $c=qq(\x{DF}); -+ ok($c=~/${c}|\x{100}/, "ASCII pattern that really is utf8"); -+ ok(@w==0, "ASCII pattern that really is utf8"); -+} -+ -+# last test 1189 - diff --git a/lang/perl5.16/files/perl-after-upgrade b/lang/perl5.16/files/perl-after-upgrade deleted file mode 100644 index fd787edab1e8..000000000000 --- a/lang/perl5.16/files/perl-after-upgrade +++ /dev/null @@ -1,629 +0,0 @@ -#! %%PERL%% -w -# ---------------------------------------------------------------------------- -# "THE BEER-WARE LICENSE" (Revision 42) -# <tobez@FreeBSD.org> wrote this file. As long as you retain this notice you -# can do whatever you want with this stuff. If we meet some day, and you think -# this stuff is worth it, you can buy me a beer in return. Anton Berezin -# ---------------------------------------------------------------------------- -# -# $FreeBSD$ -# $Id: perl-after-upgrade,v 1.11 2005/06/23 19:39:00 tobez Exp $ -# -=pod - -=head1 NAME - -perl-after-upgrade -- fixup FreeBSD packages that depend on perl - -=head1 SYNOPSIS - - perl-after-upgrade - perl-after-upgrade -f - perl-after-upgrade -v - -=head1 DESCRIPTION - -The standard procedure after a perl port (either lang/perl5 or -lang/perl5.8) upgrade is to basically reinstall all other packages that -depend on perl. This is always a painful exercise. The -perl-after-upgrade utility makes this process mostly unnecessary. - -The tool goes through the list of installed packages, looks for those -that depend on perl, moves files around, modifies shebang lines in those -scripts in which it is necessary to do so, tries its best to adjust -dynamically linked binaries that link with libperl.so in the old path, -and updates the package database. - -After installation of the new perl is complete, either by hand from the -ports collection, or from a package, or via portupgrade, do the -following: - -=over 4 - -=item o go root; - -=item o run perl-after-upgrade utility. - -Do not specify any arguments at first, so it does nothing destructive. -Pay attention to the produced output and especially to errorlist at the -end, if any; - -=item o run the utility again, with B<-f> command line option. - -This will actually do the work. Again, pay attention to the output -produced; - -=item o fix any reported errors; - -=item o reinstall required packages: - -The utility will tell you what packages that depend on perl it could not -handle. It will also tell you why it happened (for example, they were -compiled against a binary incompatible perl). If you want such packages -to remain operational, you will have to reinstall then by hand or via -portupgrade. - -=item o review the files left in the older perl installation. - -This is typically /usr/local/lib/perl5/site_perl/5.X.Y/. There should -be very little, if any, files in that directory and its subdirectories, -excepting a number of .ph files; - -=item o check that things work as they should; - -=item o remove backup files from the package database. - -Those will be /var/db/pkg/*/+CONTENTS.bak; - -=item o that's all. - -=back - -=head1 COPYRIGHT AND LICENSE - -Copyright 2005 by Anton Berezin - - "THE BEER-WARE LICENSE" (Revision 42) - <tobez@FreeBSD.org> wrote this module. As long as you retain this - notice you can do whatever you want with this stuff. If we meet some - day, and you think this stuff is worth it, you can buy me a beer in - return. - - Anton Berezin - -NO WARRANTY OF ANY KIND, USE AT YOUR OWN RISK. - -=head1 HISTORY - -The first version of this utility was not bundled with perl package on -FreeBSD. It was dumber than the current version in several important -areas. It was faster. - -=head1 CREDITS - -Thanks to Mathieu Arnold for discussion. - -=head1 SEE ALSO - -perl(1). - -=cut - -my $debug = 0; - -# |/-\ -my $pchar = "|"; -my $do_progress = -t *STDOUT; -sub progress -{ - if ($do_progress) { - print STDERR "$pchar"; - $pchar =~ tr<|/\\-><-|/\\>; - } -} - -package FreeBSD::Package; -use IO::File; -use File::Copy; - -sub new -{ - my ($pkg, %p) = @_; - my $pkgdir = $p{pkgdir} || return undef; - my $name = $pkgdir; - $name =~ s|.*/||; - main::progress(); - my $c = IO::File->new("< $pkgdir/+CONTENTS"); - return undef unless $c; - my @lines; - while (<$c>) { - chomp; - push @lines, $_; - } - my $me = bless { - pkgdir => $pkgdir, - lines => \@lines, - name => $name, - }, $pkg; - return $me; -} - -sub name -{ - return $_[0]->{name}; -} - -sub lines -{ - my $me = shift; - if (@_ && @_ == 1 && ref(@_) eq 'ARRAY') { - $me->{lines} = [@{$_[0]}]; - $me->{changed} = 1; - } elsif (@_) { - $me->{lines} = [@_]; - $me->{changed} = 1; - } else { - return @{$me->{lines}}; - } -} - -sub write_back -{ - my ($me) = @_; - - return unless $me->{changed}; - main::progress(); - my $file = "$me->{pkgdir}/+CONTENTS"; - copy($file, "$file.bak"); - my $c = IO::File->new("> $file"); - return unless $c; - for (@{$me->{lines}}) { - print $c "$_\n"; - } -} - -package FreeBSD::Package::DB; -use strict; - -sub new -{ - my ($pkg, %p) = @_; - my $me = bless { - dbdir => $p{dbdir} || $ENV{PKG_DBDIR} || "/var/db/pkg", - }, $pkg; - $me->{packages} = [ grep { -d } glob "$me->{dbdir}/*" ]; - $me->reset; - return $me; -} - -sub next -{ - my ($me) = @_; - while (1) { - $me->{current}++; - if ($me->{current} >= @{$me->{packages}}) { - $me->reset; - return undef; - } - my $pkg = FreeBSD::Package->new(pkgdir => $me->{packages}->[$me->{current}]); - return $pkg if $pkg; - } -} - -sub reset -{ - my ($me) = @_; - $me->{current} = -1; -} - -package main; -use Config; -use File::Temp qw/tempfile/; -use File::Copy; - -my $dry_run = 1; -my @tmpl; -my $VERSION = "1.2"; - -while (@ARGV) { - my $opt = shift; - if ($opt eq "-f") { - $dry_run = 0; - } elsif ($opt eq "-d") { - $debug = 1; - } elsif ($opt eq "-v") { - $_ = $0; - s|.*/||; - print "$_ version $VERSION\n"; - exit 0; - } elsif ($opt =~ /^-/) { - $_ = $0; - s|.*/||; - print "Unknown option `$opt'\n"; - print "Usage:\n"; - print "\t$_\n\t$_ -v\n\t$_ -f\n"; - exit 1; - } else { - push @tmpl, $opt; - } -} - -my $target = - $Config::Config{PERL_REVISION} . "." . - $Config::Config{PERL_VERSION} . "." . - $Config::Config{PERL_SUBVERSION}; -my $source = ""; -my $api_revision = $Config::Config{api_revision} || 0; -my $api_version = $Config::Config{api_version} || 0; -my $api_subversion = $Config::Config{api_subversion} || 0; -if ($api_revision < $Config::Config{PERL_REVISION}) { - $source = ".["; - for ($api_revision .. $Config::Config{PERL_REVISION}) { - $source .= $_; - } - $source .= "]\\.\\d+\\.\\d+"; -} elsif ($api_revision > $Config::Config{PERL_REVISION}) { - die "internal error, this perl is too old\n"; -} else { - $source .= "$Config::Config{PERL_REVISION}\\."; - if ($api_version < $Config::Config{PERL_VERSION}) { - $source .= "["; - for ($api_version .. $Config::Config{PERL_VERSION}) { - $source .= $_; - } - $source .= "]\\.\\d+"; - } elsif ($api_version > $Config::Config{PERL_VERSION}) { - die "internal error, this perl is too old\n"; - } else { - $source .= "$Config::Config{PERL_VERSION}\\."; - if ($api_subversion < $Config::Config{PERL_SUBVERSION}) { - $source .= "["; - for ($api_subversion .. $Config::Config{PERL_SUBVERSION}) { - $source .= $_; - } - $source .= "]"; - } elsif ($api_subversion > $Config::Config{PERL_SUBVERSION}) { - die "internal error, this perl is too old\n"; - } else { - $source .= "$Config::Config{PERL_SUBVERSION}\\."; - } - } -} -print STDERR "- Source re: <$source>\n" if $debug; - -my $fuzzy_source = "5\\.[\\d._]+"; -print STDERR "- Fuzzy source re: <$fuzzy_source>\n" if $debug; - -my @errors; -my @notes; - -sub fix_script -{ - my ($file, $target) = @_; - - main::progress(); - return 1 if $dry_run; - my $sf = IO::File->new("< $file"); - return "" unless $sf; - my $line = <$sf>; - my $md5 = ""; - if ($line && $line =~ s|^(\s*#!\s*[\w/]+perl)$fuzzy_source\b|$1$target|) { - my $dir = $file; - $dir =~ s|/[^/]+$||; - my ($fh, $fn) = tempfile(DIR=> $dir); - if ($fh) { - print $fh $line; - while (<$sf>) { - print $fh $_; - } - close $fh; - $md5 = `/sbin/md5 -q $fn`; - chomp $md5; - my $mode = (stat($file))[2] & 07777; - unlink $file or do { - push @errors, "Failed to unlink $file: $!"; - unlink $fn; - return ""; - }; - rename $fn, $file or do { - push @errors, "Failed to rename $fn to $file: $!"; - return ""; - }; - chmod $mode, $file; - } else { - push @errors, "Failed to modify $file: $!"; - } - } - return $md5; -} - -sub fix_binary -{ - my ($file, $target) = @_; - - main::progress(); - my $sf = IO::File->new("< $file"); - return "" unless $sf; - my $was = $dry_run ? "would be" : "was"; - push @notes, "The $file binary $was modified, make sure it works"; - return 1 if $dry_run; - my $md5 = ""; - - my $dir = $file; - $dir =~ s|/[^/]+$||; - my ($fh, $fn) = tempfile(DIR=> $dir); - unless ($fn) { - push @errors, "Failed to modify $file: $!"; - return ""; - } - - while (<$sf>) { - s|/lib/perl5/$fuzzy_source/mach/CORE|/lib/perl5/$target/mach/CORE|g; - print $fh $_; - } - close $fh; - $md5 = `/sbin/md5 -q $fn`; - chomp $md5; - my $mode = (stat($file))[2] & 07777; - unlink $file or do { - push @errors, "Failed to unlink $file: $!"; - unlink $fn; - return ""; - }; - rename $fn, $file or do { - push @errors, "Failed to rename $fn to $file: $!"; - return ""; - }; - chmod $mode, $file; - return $md5; -} - -sub mkdir_recur -{ - my ($dir) = @_; - - main::progress(); - $dir =~ s|/+$||; - my $orig = $dir; - if ($dir =~ m|^$|) { - return 1; - } else { - $dir =~ s|/[^/]+$||; - my $r = mkdir_recur($dir); - return $r unless $r; - mkdir $orig, 0777; - my $e = $!; - unless (-d $orig) { - push @errors, "Could not create directory $orig: $e"; - return 0; - } - return 1; - } -} - -sub might_need_to_fix -{ - my ($pkg) = @_; - my $pkg_name = $pkg->name; - - main::progress(); - if ($pkg_name =~ /^bsdpan-/) { - return 1; - } - for ($pkg->lines) { - if (/^\@pkgdep\s+perl-(threaded-)?($fuzzy_source)\S*\s*$/) { - return 1; - } - } - return 0; -} - -sub fixable_binary -{ - my ($file, $name) = @_; - - main::progress(); - my $fixable = 0; - for (`/usr/bin/ldd $file 2>&1`) { - if (/^\s+libperl\.so\s+=>/) { - my $found; - for (`strings $file`) { - if (m</lib/perl5/($fuzzy_source)/mach/CORE>) { - $found++; - if (length($1) != length($target)) { - push @notes, "$name cannot be fixed up (and has to be reinstalled): cannot patch $file due to length difference"; - print STDERR "- Skipping $name: cannot patch $file due to length difference\n" if $debug; - return undef; - } - print STDERR "- $name: fixable binary $file\n" if $debug && $found < 2; - $fixable = 1 if $1 ne $target; - } - } - if (!$found) { - push @notes, "$name cannot be fixed up (and has to be reinstalled): $file is using unknown libperl"; - print STDERR "- Skipping $name: $file is using unknown libperl\n" if $debug; - return undef; - } - } - } - return $fixable; -} - -sub fixable_shared_lib -{ - my ($file, $name) = @_; - - main::progress(); - my ($old); - for (`strings $file`) { - if (/^perl_get_sv$/) { - push @notes, "$name cannot be fixed up (and has to be reinstalled): $file uses an old perl API"; - print STDERR "- Skipping $name: $file uses an old perl API\n" if $debug; - return 0; - } - } - return 1; -} - -sub cannot_be_fixed -{ - my ($pkg, $binaries, $scripts) = @_; - my $pkg_name = $pkg->name; - my $prefix = ""; - - main::progress(); - - for ($pkg->lines) { - if (/^\@cwd\s+(\S+)\s*$/) { - $prefix = $1; - next; - } - my $file = "$prefix/$_"; - next if -l $file; - next if $file =~ /\.gz$/; - next if $file =~ /\.bz2$/; - my $sf = IO::File->new("< $file"); - next unless $sf; - my $line; - sysread $sf, $line, 256; - - # binary executable - if ($line && $line =~ /^\177ELF.\x01.\x09.{8}\x02\0/) { - my $fixable = fixable_binary($file, $pkg_name); - return 0 unless defined $fixable; - push @$binaries, $file if $fixable; - # shared library - can prevent us from being able to upgrade - } elsif ($line && $line =~ /^\177ELF.\x01.\x09.{8}\x03\0/) { - return 0 unless fixable_shared_lib($file, $pkg_name); - } elsif ($line && $line =~ m<^\s*#!\s*[\w/]+perl($fuzzy_source)\b>) { - print STDERR "- $pkg_name: fixable script $file\n" if $debug; - push @$scripts, $file if $1 ne $target; - } - main::progress(); - } -} - -# -my $db = FreeBSD::Package::DB->new; -my ($fixed, $skipped, $tot_moved, $tot_modified) = (0,0,0,0); -while (my $pkg = $db->next) { - my @lines; - my $new_md5; - my ($adjusted, $moved, $modified) = (0,0,0); - - my $pkg_name = $pkg->name; - if (@tmpl) { - my $ok; - for (@tmpl) { - if ($pkg_name =~ /^$_/) { - $ok = 1; - last; - } - } - next unless $ok; - } - - unless (might_need_to_fix($pkg)) { - $skipped++; - print STDERR "- Skipping $pkg_name, it does not depend on perl\n" if $debug; - next; - } - - my (@binaries_to_fix, @scripts_to_fix); - if (cannot_be_fixed($pkg, \@binaries_to_fix, \@scripts_to_fix)) { - $skipped++; - next; - } - if ($debug) { - print STDERR "- $pkg_name: ", scalar(@binaries_to_fix), " binaries to fix\n" if @binaries_to_fix; - print STDERR "- $pkg_name: ", scalar(@scripts_to_fix), " scripts to fix\n" if @scripts_to_fix; - } - my %binaries = map { $_ => 1 } @binaries_to_fix; - my %scripts = map { $_ => 1 } @scripts_to_fix; - - my $prefix = ""; - my $pcnt = 0; - for ($pkg->lines) { - if (/^([^@]\S+)\s*$/) { - my $from = "$prefix/$_"; - local $_; # we'll need it later - $new_md5 = ""; - unless (-l $from) { # skip symlinks - if ($binaries{$from}) { - $new_md5 = fix_binary($from, $target); - } elsif ($scripts{$from}) { - $new_md5 = fix_script($from, $target); - } - $modified++ if $new_md5; - } - my $to = $from; - if ($to =~ s|/perl5/$fuzzy_source/|/perl5/$target/|g or $to =~ s|/perl5/site_perl/$fuzzy_source/|/perl5/site_perl/$target/|g) { - if ($to ne $from) { - my $dir = $to; - $dir =~ s|/[^/]+$||; - main::progress(); - unless ($dry_run) { - if (mkdir_recur($dir)) { - move($from, $to); - } else { - push @errors, " could not move $from to $to"; - } - } - $moved++; - print STDERR "- move: $from => $to\n" if $debug; - } - } - } elsif (/^\@comment\s+MD5:[\da-f]+\s*$/ && $new_md5) { - s|MD5:(\S+)|MD5:$new_md5|; - $new_md5 = ""; - } else { - $new_md5 = ""; - } - if (/^\@cwd\s+(\S+)\s*$/) { - $prefix = $1; - } elsif (/^\@pkgdep\s+perl-(threaded-)?($fuzzy_source)\S*\s*$/) { - if ($target ne $2) { - my $perlver = $2; - s|perl-(threaded-)?\Q$perlver\E|perl-$target|; - } - } - my $old = $_; - if (s|/perl5/$fuzzy_source/|/perl5/$target/|g || s|/perl5/site_perl/$fuzzy_source/|/perl5/site_perl/$target/|g) { - if ($old ne $_) { - $adjusted++; - print STDERR "- adjust: $_\n" if $debug; - } - } - push @lines, $_; - main::progress() if $pcnt++ % 250 == 0; - } - unless ($dry_run) { - $pkg->lines(@lines); - $pkg->write_back; - } - $fixed++ if $moved || $modified || $adjusted; - $tot_modified += $modified; - $tot_moved += $moved; - print "$pkg_name: $moved moved, $modified modified, $adjusted adjusted\n"; -} -print "\n---\n"; -print "Fixed $fixed packages ($tot_moved files moved, $tot_modified files modified)\n"; -print "Skipped $skipped packages\n"; -if (@errors) { - print "\n**** The script has encountered following problems:\n"; - for (@errors) { - print "$_\n"; - } - print "\n--- Repeating summary:\n"; - print "Fixed $fixed packages ($tot_moved files moved, $tot_modified files modified)\n"; - print "Skipped $skipped packages\n"; -} -if (@notes) { - print "\n**** In addition, please pay attention to the following:\n"; - for (@notes) { - print "$_\n"; - } - print "\n--- Repeating summary:\n"; - print "Fixed $fixed packages ($tot_moved files moved, $tot_modified files modified)\n"; - print "Skipped $skipped packages\n"; -} diff --git a/lang/perl5.16/files/use.perl b/lang/perl5.16/files/use.perl deleted file mode 100644 index eca7811f3a85..000000000000 --- a/lang/perl5.16/files/use.perl +++ /dev/null @@ -1,268 +0,0 @@ -#!/bin/sh - -# $FreeBSD$ - -this=`echo -n $0 | /usr/bin/sed -e 's!^.*/!!'` -PERL_VERSION="%%PERL_VERSION%%" -MAKE_CONF=%%MAKE_CONF%% -banner=`date +"%F %T"` -banner="# added by use.perl $banner" -if [ -z "${OSVERSION}" ]; then - if [ -f /sbin/sysctl -a -x /sbin/sysctl ] ; then - osreldate=`/sbin/sysctl -n kern.osreldate` - else - osreldate=`/usr/sbin/sysctl -n kern.osreldate` - fi -else - osreldate=${OSVERSION} -fi - -if [ "x$this" = "xuse.perl" ]; then - PKG_PREFIX="%%PREFIX%%" - if [ "$1" = "port" ] ; then - need_remove_links=yes - need_create_links=yes - need_cleanup_make_conf=yes - need_cleanup_manpath=yes - need_spam_make_conf=yes - need_spam_manpath=yes - elif [ "$1" = "system" ] ; then - need_remove_links=yes - if [ $osreldate -lt 500036 ] ; then - need_base_system_perl=yes - fi - need_cleanup_make_conf=yes - need_cleanup_manpath=yes - else - echo "Usage: - ${0##*/} port -> /usr/bin/perl is the perl5 port - ${0##*/} system -> /usr/bin/perl is the system perl" - exit 2; - fi -else - if [ "$2" = "POST-INSTALL" ] ; then - need_remove_links=yes - if [ $osreldate -ge 500036 ] ; then - need_create_links=yes - need_cleanup_make_conf=yes - need_cleanup_manpath=yes - need_spam_make_conf=yes - need_spam_manpath=yes - fi - need_post_install=yes - elif [ "$2" = "POST-DEINSTALL" ] ; then - need_remove_links=yes - if [ $osreldate -lt 500036 ] ; then - need_base_system_perl=yes - fi - need_cleanup_make_conf=yes - need_cleanup_manpath=yes - else - exit 0; - fi -fi - -link_list=" - a2p - c2ph - find2perl - h2ph - h2xs - perlbug - perlcc - perldoc - pl2pm - pod2html - pod2latex - pod2man - pod2text - s2p - splain - suidperl" -if [ $osreldate -ge 500036 ] ; then - link_list="" -fi -special_link_list=" - perl - perl5" - -do_remove_links() -{ - echo "Removing stale symlinks from /usr/bin..." - for binary in $link_list $special_link_list - do - if [ -L "/usr/bin/$binary" ] ; then - echo " Removing /usr/bin/$binary" - /bin/rm -f "/usr/bin/$binary" - else - echo " Skipping /usr/bin/$binary" - fi - done - bins=`/bin/ls /usr/bin/*perl*5.* ${PKG_PREFIX}/bin/*perl*5.* 2>/dev/null` - for binary in $bins - do - if [ -L "$binary" ] ; then - echo " Removing $binary installed by an older perl port" - /bin/rm -f "$binary" - fi - done - echo "Done." -} - -do_create_links() -{ - echo "Creating various symlinks in /usr/bin..." - for binary in $link_list - do - if [ -f "/usr/bin/$binary" ] ; then - echo " Backing up /usr/bin/$binary as /usr/bin/$binary.freebsd" - /bin/mv -f "/usr/bin/$binary" "/usr/bin/$binary.freebsd" - fi - if [ -e "/usr/bin/$binary" ] ; then - echo " *** /usr/bin/$binary is still there, which should not happen" - elif [ -e "$PKG_PREFIX/bin/$binary" ] ; then - echo " Symlinking $PKG_PREFIX/bin/$binary to /usr/bin/$binary" - /bin/ln -sf "$PKG_PREFIX/bin/$binary" "/usr/bin/$binary" - else - echo " *** $PKG_PREFIX/bin/$binary is not there, a symlink won't do any good" - fi - done - for binary in $special_link_list - do - if [ -f "/usr/bin/$binary" ] ; then - echo " Backing up /usr/bin/$binary as /usr/bin/$binary.freebsd" - /bin/mv -f "/usr/bin/$binary" "/usr/bin/$binary.freebsd" - fi - bin=`echo $binary | /usr/bin/sed -e 's!perl5!perl!'` - if [ -e "/usr/bin/$binary" ] ; then - echo " *** /usr/bin/$binary is still there, which should not happen" - elif [ -e "$PKG_PREFIX/bin/${bin}%%PERL_VERSION%%" ] ; then - echo " Symlinking $PKG_PREFIX/bin/${bin}%%PERL_VERSION%% to /usr/bin/$binary" - /bin/ln -sf "$PKG_PREFIX/bin/${bin}%%PERL_VERSION%%" "/usr/bin/$binary" - else - echo " *** $PKG_PREFIX/bin/${bin}%%PERL_VERSION%% is not there, a symlink won't do any good" - fi - done - echo "Done." -} - -do_base_system_perl() -{ - echo "Restoring base system perl binaries..." - for binary in $link_list - do - if [ -e "/usr/bin/$binary" ] ; then - echo " *** /usr/bin/$binary is there, which should not happen" - else - if [ -f "/usr/bin/$binary.freebsd" ] ; then - echo " Moving /usr/bin/$binary.freebsd to /usr/bin/$binary" - /bin/mv -f "/usr/bin/$binary.freebsd" "/usr/bin/$binary" - else - echo " *** /usr/bin/$binary.freebsd is NOT there, nothing to restore" - fi - fi - done - for binary in $special_link_list - do - if [ -e "/usr/bin/$binary" ] ; then - echo " *** /usr/bin/$binary is there, which should not happen" - else - bin=`echo $binary | /usr/bin/sed -e 's!perl5!perl!'` - bin=`echo $bin | /usr/bin/sed -e 's!suidperl!sperl!'` - bins=`/bin/ls /usr/bin/${bin}5.* 2>/dev/null | /usr/bin/sort` - bin="" - for b in $bins - do - if [ -f $b -a ! -L $b ] ; then - bin=$b - fi - done - if [ -z $bin ] ; then - echo " *** cannot find what /usr/bin/$binary shall be restored FROM" - elif [ -f $bin ] ; then - echo " Hardlinking $bin to /usr/bin/$binary" - ln -f "$bin" "/usr/bin/$binary" - else - echo " *** $bin is NOT there, nothing to restore" - fi - if [ -f "/usr/bin/$binary.freebsd" ] ; then - echo " Removing backup copy /usr/bin/$binary.freebsd" - rm -f "/usr/bin/$binary.freebsd" - fi - fi - done - echo "Done." -} - -do_post_install() -{ - INCLUDEDIR=/usr/include - install -d ${PKG_PREFIX}/lib/perl5/site_perl/%%PERL_VERSION%%/%%PERL_ARCH%%/auto - install -d ${PKG_PREFIX}/lib/perl5/site_perl/%%PERL_VERSION%%/auto - install -d ${PKG_PREFIX}/lib/perl5/%%PERL_VERSION%%/man/man3 - cd ${INCLUDEDIR} && ${PKG_PREFIX}/bin/h2ph *.h machine/*.h sys/*.h >/dev/null -} - -do_cleanup_make_conf() -{ - echo -n "Cleaning up ${MAKE_CONF}..." - if [ -f ${MAKE_CONF} ] ; then - /usr/bin/awk 's=0; - /^#.*use.perl/ { s=1; mode=1 } - /^#/ { s=1; if (mode != 1) { mode=0 } } - /.*PERL.*=/ { s=1; if (mode == 1) { mode=2 } } - /^$/ { s=1; if (mode != 2) { mode = 0 } } - { if (s != 1) { mode = 0 } if (mode == 0) print }' ${MAKE_CONF} >${MAKE_CONF}.new - /bin/mv ${MAKE_CONF} ${MAKE_CONF}.bak - /bin/mv ${MAKE_CONF}.new ${MAKE_CONF} - fi - echo " Done." -} - -do_cleanup_manpath() -{ - echo -n "Cleaning up /etc/manpath.config..." - if [ -f /etc/manpath.config ] ; then - /usr/bin/awk 's=0; - /^#.*use.perl/ { s=1; mode=1 } - /^#/ { s=1; if (mode != 1) { mode=0 } } - /^OPTIONAL_MANPATH.*perl5/ { s=1; if (mode == 1) { mode=2 } } - /^$/ { s=1; if (mode != 2) { mode = 0 } } - { if (s != 1) { mode = 0 } if (mode == 0) print }' /etc/manpath.config >/etc/manpath.config.new - /bin/mv /etc/manpath.config /etc/manpath.config.bak - /bin/mv /etc/manpath.config.new /etc/manpath.config - fi - echo " Done." -} - -do_spam_make_conf() -{ - echo -n "Spamming ${MAKE_CONF}..." - echo "$banner" >>${MAKE_CONF} - echo "PERL_VER=%%PERL_VER%%" >>${MAKE_CONF} - echo "PERL_VERSION=%%PERL_VERSION%%" >>${MAKE_CONF} - if [ $osreldate -lt 500036 ] ; then - echo "NOPERL=yes" >>${MAKE_CONF} - fi - echo " Done." -} - -do_spam_manpath() -{ - echo -n "Spamming /etc/manpath.config..." - echo "$banner" >>/etc/manpath.config - echo "OPTIONAL_MANPATH ${PKG_PREFIX}/lib/perl5/%%PERL_VERSION%%/man" >>/etc/manpath.config - echo "OPTIONAL_MANPATH ${PKG_PREFIX}/lib/perl5/%%PERL_VERSION%%/perl/man" >>/etc/manpath.config - echo " Done." -} - -[ $need_remove_links ] && do_remove_links -[ $need_create_links ] && do_create_links -[ $need_base_system_perl ] && do_base_system_perl -[ $need_post_install ] && do_post_install -[ $need_cleanup_make_conf ] && do_cleanup_make_conf -[ $need_spam_make_conf ] && do_spam_make_conf -[ $need_cleanup_manpath ] && do_cleanup_manpath -[ $need_spam_manpath ] && do_spam_manpath - -exit 0 |