diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-10-27 22:15:15 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-10-27 22:15:15 +0000 |
commit | 74cfb115ac810480c0000dc742b20383c1578bac (patch) | |
tree | 316d96e5123617976f1637b143570c309a662045 /gnu/usr.bin/perl/Porting | |
parent | 453ade492b8e06c619009d6cd52a85cb04e8cf17 (diff) |
stock perl 5.8.0 from CPAN
Diffstat (limited to 'gnu/usr.bin/perl/Porting')
-rw-r--r-- | gnu/usr.bin/perl/Porting/apply | 71 | ||||
-rw-r--r-- | gnu/usr.bin/perl/Porting/check83.pl | 68 | ||||
-rw-r--r-- | gnu/usr.bin/perl/Porting/checkURL.pl | 86 | ||||
-rw-r--r-- | gnu/usr.bin/perl/Porting/checkVERSION.pl | 52 | ||||
-rw-r--r-- | gnu/usr.bin/perl/Porting/config.sh | 302 | ||||
-rw-r--r-- | gnu/usr.bin/perl/Porting/findrfuncs | 133 | ||||
-rw-r--r-- | gnu/usr.bin/perl/Porting/findvars | 1 | ||||
-rw-r--r-- | gnu/usr.bin/perl/Porting/genlog | 6 | ||||
-rw-r--r-- | gnu/usr.bin/perl/Porting/p4genpatch | 180 | ||||
-rw-r--r-- | gnu/usr.bin/perl/Porting/testall.atom | 91 | ||||
-rw-r--r-- | gnu/usr.bin/perl/Porting/thirdclean | 82 |
11 files changed, 992 insertions, 80 deletions
diff --git a/gnu/usr.bin/perl/Porting/apply b/gnu/usr.bin/perl/Porting/apply new file mode 100644 index 00000000000..c313ee60e6f --- /dev/null +++ b/gnu/usr.bin/perl/Porting/apply @@ -0,0 +1,71 @@ +#!/usr/bin/perl -w +my $file = pop(@ARGV); +my %meta; +$ENV{'P4PORT'} = 'bactrian:1667'; +$ENV{'P4CLIENT'} = 'camel-linux'; +open(FILE,$file) || die "Cannot open $file:$!"; +while (<FILE>) + { + if (/^(From|Subject|Date|Message-ID):(.*)$/i) + { + $meta{lc($1)} = $2; + } + } +my @results = `patch @ARGV <$file 2>&1`; +warn @results; +my $code = $?; +warn "$code from patch\n"; +foreach (@results) + { + if (/patching\s+file\s*(.*?)\s*$/) + { + push(@edit,$1); + } + } +my @have = `p4 have @edit`; + +if ($code == 0) + { + System("p4 edit @edit"); + open(PIPE,"|p4 change -i") || die "Cannot open pipe to p4:$!"; + print PIPE "Change: new\n"; + print PIPE "Description:\n"; + foreach my $key (qw(Subject From Date Message-Id)) + { + if (exists $meta{lc($key)}) + { + print PIPE "\t$key: ",$meta{lc($key)},"\n"; + print "$key: ",$meta{lc($key)},"\n"; + } + } + print PIPE "Files:\n"; + foreach (@have) + { + if (m,^(.*)#,) + { + print PIPE "\t$1\n" + } + } + close(PIPE); + } +else + { + if (@edit) + { + System("p4 refresh @edit"); + } + } + +sub System +{ + my $cmd = join(' ',@_); + warn "$cmd\n"; + if (fork) + { + wait; + } + else + { + _exit(exec $cmd); + } +} diff --git a/gnu/usr.bin/perl/Porting/check83.pl b/gnu/usr.bin/perl/Porting/check83.pl new file mode 100644 index 00000000000..7006d23c1fe --- /dev/null +++ b/gnu/usr.bin/perl/Porting/check83.pl @@ -0,0 +1,68 @@ +#!/usr/local/bin/perl + +# Check whether there are naming conflicts when names are truncated to +# the DOSish case-ignoring 8.3 format, plus other portability no-nos. + +# The "8.3 rule" is loose: "if reducing the directory entry names +# within one directory to lowercase and 8.3-truncated causes +# conflicts, that's a bad thing". So the rule is NOT the strict +# "no filename shall be longer than eight and a suffix if present +# not longer than three". + +# TODO: this doesn't actually check for *directory entries*, what this +# does is to check for *MANIFEST entries*, which are only files, not +# directories. In other words, a 8.3 conflict between a directory +# "abcdefghx" and a file "abcdefghy" wouldn't be noticed-- or even for +# a directory "abcdefgh" and a file "abcdefghy". + +sub eight_dot_three { + my ($dir, $base, $ext) = ($_[0] =~ m!^(?:(.+)/)?([^/.]+)(?:\.([^/.]+))?$!); + my $file = $base . defined $ext ? ".$ext" : ""; + $base = substr($base, 0, 8); + $ext = substr($ext, 0, 3) if defined $ext; + if ($dir =~ /\./) { + warn "$dir: directory name contains '.'\n"; + } + if ($file =~ /[^A-Za-z0-9\._-]/) { + warn "$file: filename contains non-portable characters\n"; + } + if (length $file > 30) { + warn "$file: filename longer than 30 characters\n"; # make up a limit + } + if (defined $dir) { + return ($dir, defined $ext ? "$dir/$base.$ext" : "$dir/$base"); + } else { + return ('.', defined $ext ? "$base.$ext" : $base); + } +} + +my %dir; + +if (open(MANIFEST, "MANIFEST")) { + while (<MANIFEST>) { + chomp; + s/\s.+//; + unless (-f) { + warn "$_: missing\n"; + next; + } + if (tr/././ > 1) { + print "$_: more than one dot\n"; + next; + } + my ($dir, $edt) = eight_dot_three($_); + ($dir, $edt) = map { lc } ($dir, $edt); + push @{$dir{$dir}->{$edt}}, $_; + } +} else { + die "$0: MANIFEST: $!\n"; +} + +for my $dir (sort keys %dir) { + for my $edt (keys %{$dir{$dir}}) { + my @files = @{$dir{$dir}->{$edt}}; + if (@files > 1) { + print "@files: directory $dir conflict $edt\n"; + } + } +} diff --git a/gnu/usr.bin/perl/Porting/checkURL.pl b/gnu/usr.bin/perl/Porting/checkURL.pl new file mode 100644 index 00000000000..db55c495366 --- /dev/null +++ b/gnu/usr.bin/perl/Porting/checkURL.pl @@ -0,0 +1,86 @@ +#!/usr/bin/perl + +use strict; +use warnings 'all'; + +use LWP::Simple qw /$ua getstore/; + +my %urls; + +my @dummy = qw( + http://something.here + http://www.pvhp.com + ); +my %dummy; + +@dummy{@dummy} = (); + +foreach my $file (<*/*.pod */*/*.pod */*/*/*.pod README README.* INSTALL>) { + open my $fh => $file or die "Failed to open $file: $!\n"; + while (<$fh>) { + if (m{(?:http|ftp)://(?:(?!\w<)[-\w~?@=.])+} && !exists $dummy{$&}) { + my $url = $&; + $url =~ s/\.$//; + $urls {$url} ||= { }; + $urls {$url} {$file} = 1; + } + } + close $fh; +} + +sub fisher_yates_shuffle { + my $deck = shift; # $deck is a reference to an array + my $i = @$deck; + while (--$i) { + my $j = int rand ($i+1); + @$deck[$i,$j] = @$deck[$j,$i]; + } +} + +my @urls = keys %urls; + +fisher_yates_shuffle(\@urls); + +sub todo { + warn "(", scalar @urls, " URLs)\n"; +} + +my $MAXPROC = 40; +my $MAXURL = 10; +my $MAXFORK = $MAXPROC < $MAXURL ? 1 : $MAXPROC / $MAXURL; + +select(STDERR); $| = 1; +select(STDOUT); $| = 1; + +while (@urls) { + my @list; + my $pid; + my $i; + + todo(); + + for ($i = 0; $i < $MAXFORK; $i++) { + $list[$i] = [ splice @urls, 0, $MAXURL ]; + $pid = fork; + die "Failed to fork: $!\n" unless defined $pid; + last unless $pid; # Child. + } + + if ($pid) { + # Parent. + warn "(waiting)\n"; + 1 until -1 == wait; # Reap. + } else { + # Child. + foreach my $url (@{$list[$i]}) { + my $code = getstore $url, "/dev/null"; + next if $code == 200; + my $f = join ", " => keys %{$urls {$url}}; + printf "%03d %s: %s\n" => $code, $url, $f; + } + + exit; + } +} + +__END__ diff --git a/gnu/usr.bin/perl/Porting/checkVERSION.pl b/gnu/usr.bin/perl/Porting/checkVERSION.pl new file mode 100644 index 00000000000..9ad2ff54d88 --- /dev/null +++ b/gnu/usr.bin/perl/Porting/checkVERSION.pl @@ -0,0 +1,52 @@ +#!/usr/bin/perl -w + +# +# Check the tree against missing VERSIONs. +# +# Originally by Larry Shatzer +# + +use strict; +use File::Find; + +find( + sub { + return unless -f; + if (/\.pm$/ && $File::Find::name !~ m:/t/:) { # pm but not in a test + unless (parse_file($_)) { + print "$File::Find::name\n"; + } + } + }, @ARGV ? shift : "."); + +sub parse_file { + my $parsefile = shift; + + my $result; + + open(FH,$parsefile) or warn "Could not open '$parsefile': $!"; + + my $inpod = 0; + while (<FH>) { + $inpod = /^=(?!cut)/ ? 1 : /^=cut/ ? 0 : $inpod; + next if $inpod || /^\s*\#/; + chomp; + next unless /([\$*])(([\w\:\']*)\bVERSION)\b.*\=/; + my $eval = qq{ + package ExtUtils::MakeMaker::_version; + no strict; + local $1$2; + \$$2=undef; do { + $_ + }; \$$2 + }; + no warnings; + $result = eval($eval); + warn "Could not eval '$eval' in $parsefile: $@" if $@; + $result = "undef" unless defined $result; + last; + } + close FH; + return $result; +} + diff --git a/gnu/usr.bin/perl/Porting/config.sh b/gnu/usr.bin/perl/Porting/config.sh index 297a3e269a3..6b5b7ba65b2 100644 --- a/gnu/usr.bin/perl/Porting/config.sh +++ b/gnu/usr.bin/perl/Porting/config.sh @@ -8,7 +8,7 @@ # Package name : perl5 # Source directory : . -# Configuration time: Sat Mar 3 01:13:55 EET 2001 +# Configuration time: Fri Jul 19 01:55:41 EET DST 2002 # Configured by : jhi # Target system : osf1 alpha.hut.fi v4.0 878 alpha @@ -27,24 +27,25 @@ _a='.a' _exe='' _o='.o' afs='false' +afsroot='/afs' alignbytes='8' ansi2knr='' aphostname='' api_revision='5' api_subversion='0' -api_version='5' -api_versionstring='5.005' +api_version='8' +api_versionstring='5.8.0' ar='ar' -archlib='/opt/perl/lib/5.6.1/alpha-dec_osf-thread' -archlibexp='/opt/perl/lib/5.6.1/alpha-dec_osf-thread' +archlib='/opt/perl/lib/5.8.0/alpha-dec_osf' +archlibexp='/opt/perl/lib/5.8.0/alpha-dec_osf' archname64='' -archname='alpha-dec_osf-thread' +archname='alpha-dec_osf' archobjs='' +asctime_r_proto='0' awk='awk' baserev='5.0' bash='' bin='/opt/perl/bin' -bincompat5005='undef' binexp='/opt/perl/bin' bison='bison' byacc='byacc' @@ -54,18 +55,18 @@ castflags='0' cat='cat' cc='cc' cccdlflags=' ' -ccdlflags=' -Wl,-rpath,/opt/perl/lib/5.6.1/alpha-dec_osf-thread/CORE' -ccflags='-pthread -std -DLANGUAGE_C' +ccdlflags=' -Wl,-rpath,/opt/perl/lib/5.8.0/alpha-dec_osf/CORE' +ccflags='-std -D_INTRINSICS -fprm d -ieee -DLANGUAGE_C' ccflags_uselargefiles='' ccname='cc' ccsymbols='__alpha=1 __LANGUAGE_C__=1 __osf__=1 __unix__=1 _LONGLONG=1 _SYSTYPE_BSD=1 SYSTYPE_BSD=1 unix=1' ccversion='V5.6-082' cf_by='jhi' cf_email='yourname@yourhost.yourplace.com' -cf_time='Sat Mar 3 01:13:55 EET 2001' +cf_time='Fri Jul 19 01:55:41 EET DST 2002' charsize='1' chgrp='' -chmod='' +chmod='chmod' chown='' clocktype='clock_t' comm='comm' @@ -76,16 +77,18 @@ cpio='' cpp='cpp' cpp_stuff='42' cppccsymbols='LANGUAGE_C=1' -cppflags='-pthread -std -DLANGUAGE_C' +cppflags='-std -D_INTRINSICS -ieee -DLANGUAGE_C' cpplast='' cppminus='' -cpprun='/usr/bin/cpp' +cpprun='/usr/local/bin/cpp' cppstdin='cppstdin' -cppsymbols='_AES_SOURCE=1 __alpha=1 __ALPHA=1 _ANSI_C_SOURCE=1 __LANGUAGE_C__=1 _LONGLONG=1 __osf__=1 _OSF_SOURCE=1 _POSIX_C_SOURCE=199506 _POSIX_SOURCE=1 _REENTRANT=1 __STDC__=1 _SYSTYPE_BSD=1 __unix__=1 _XOPEN_SOURCE=1' -crosscompile='undef' +cppsymbols='_AES_SOURCE=1 __alpha=1 __ALPHA=1 _ANSI_C_SOURCE=1 _INTRINSICS=1 __LANGUAGE_C__=1 _LONGLONG=1 __osf__=1 _OSF_SOURCE=1 _POSIX_C_SOURCE=199506 _POSIX_SOURCE=1 __STDC__=1 _SYSTYPE_BSD=1 __unix__=1 _XOPEN_SOURCE=1' +crypt_r_proto='0' cryptlib='' csh='csh' -d_Gconvert='gcvt((x),(n),(b))' +ctermid_r_proto='0' +ctime_r_proto='0' +d_Gconvert='sprintf((b),"%.*g",(n),(x))' d_PRIEUldbl='define' d_PRIFUldbl='define' d_PRIGUldbl='define' @@ -104,12 +107,12 @@ d_access='define' d_accessx='undef' d_alarm='define' d_archlib='define' +d_asctime_r='undef' d_atolf='undef' d_atoll='undef' d_attribut='undef' d_bcmp='define' d_bcopy='define' -d_bincompat5005='undef' d_bsd='undef' d_bsdgetpgrp='undef' d_bsdsetpgrp='define' @@ -120,29 +123,44 @@ d_charvspr='undef' d_chown='define' d_chroot='define' d_chsize='undef' +d_class='undef' d_closedir='define' +d_cmsghdr_s='define' d_const='define' d_crypt='define' +d_crypt_r='undef' d_csh='define' +d_ctermid_r='undef' +d_ctime_r='undef' d_cuserid='define' d_dbl_dig='define' +d_dbminitproto='undef' d_difftime='define' +d_dirfd='define' d_dirnamlen='define' d_dlerror='define' d_dlopen='define' d_dlsymun='undef' d_dosuid='undef' +d_drand48_r='undef' d_drand48proto='define' d_dup2='define' d_eaccess='undef' d_endgrent='define' +d_endgrent_r='undef' d_endhent='define' +d_endhostent_r='undef' d_endnent='define' +d_endnetent_r='undef' d_endpent='define' +d_endprotoent_r='undef' d_endpwent='define' +d_endpwent_r='undef' d_endsent='define' +d_endservent_r='undef' d_eofnblk='define' d_eunice='undef' +d_fchdir='define' d_fchmod='define' d_fchown='define' d_fcntl='define' @@ -151,10 +169,17 @@ d_fd_macros='define' d_fd_set='define' d_fds_bits='define' d_fgetpos='define' +d_finite='define' +d_finitel='define' d_flexfnam='define' d_flock='define' +d_flockproto='undef' d_fork='define' +d_fp_class='define' d_fpathconf='define' +d_fpclass='undef' +d_fpclassify='undef' +d_fpclassl='undef' d_fpos64_t='undef' d_frexpl='define' d_fs_data_s='undef' @@ -169,18 +194,29 @@ d_getcwd='define' d_getespwnam='undef' d_getfsstat='define' d_getgrent='define' +d_getgrent_r='undef' +d_getgrgid_r='undef' +d_getgrnam_r='undef' d_getgrps='define' d_gethbyaddr='define' d_gethbyname='define' d_gethent='define' d_gethname='define' +d_gethostbyaddr_r='undef' +d_gethostbyname_r='undef' +d_gethostent_r='undef' d_gethostprotos='define' +d_getitimer='define' d_getlogin='define' +d_getlogin_r='undef' d_getmnt='undef' d_getmntent='undef' d_getnbyaddr='define' d_getnbyname='define' d_getnent='define' +d_getnetbyaddr_r='undef' +d_getnetbyname_r='undef' +d_getnetent_r='undef' d_getnetprotos='define' d_getpagsz='define' d_getpbyname='define' @@ -191,30 +227,43 @@ d_getpgrp2='undef' d_getpgrp='define' d_getppid='define' d_getprior='define' +d_getprotobyname_r='undef' +d_getprotobynumber_r='undef' +d_getprotoent_r='undef' d_getprotoprotos='define' d_getprpwnam='undef' d_getpwent='define' +d_getpwent_r='undef' +d_getpwnam_r='undef' +d_getpwuid_r='undef' d_getsbyname='define' d_getsbyport='define' d_getsent='define' +d_getservbyname_r='undef' +d_getservbyport_r='undef' +d_getservent_r='undef' d_getservprotos='define' d_getspnam='undef' +d_getspnam_r='undef' d_gettimeod='define' +d_gmtime_r='undef' d_gnulibc='undef' d_grpasswd='define' d_hasmntopt='undef' d_htonl='define' -d_iconv='define' d_index='undef' d_inetaton='define' d_int64_t='undef' d_isascii='define' +d_isfinite='undef' +d_isinf='undef' d_isnan='define' d_isnanl='define' d_killpg='define' d_lchown='define' d_ldbl_dig='define' d_link='define' +d_localtime_r='undef' d_locconv='define' d_lockf='define' d_longdbl='define' @@ -237,7 +286,8 @@ d_mkstemp='define' d_mkstemps='undef' d_mktime='define' d_mmap='define' -d_modfl='define' +d_modfl='undef' +d_modfl_pow32_bug='undef' d_mprotect='define' d_msg='define' d_msg_ctrunc='define' @@ -247,14 +297,15 @@ d_msg_peek='define' d_msg_proxy='undef' d_msgctl='define' d_msgget='define' +d_msghdr_s='define' d_msgrcv='define' d_msgsnd='define' d_msync='define' d_munmap='define' d_mymalloc='undef' d_nice='define' +d_nl_langinfo='define' d_nv_preserves_uv='undef' -d_nv_preserves_uv_bits='53' d_off64_t='undef' d_old_pthread_create_joinable='undef' d_oldpthreads='undef' @@ -267,6 +318,8 @@ d_phostname='undef' d_pipe='define' d_poll='define' d_portable='define' +d_procselfexe='undef' +d_pthread_atfork='define' d_pthread_yield='undef' d_pwage='undef' d_pwchange='undef' @@ -278,12 +331,17 @@ d_pwpasswd='define' d_pwquota='define' d_qgcvt='undef' d_quad='define' +d_random_r='undef' +d_readdir64_r='undef' d_readdir='define' +d_readdir_r='undef' d_readlink='define' +d_readv='define' +d_recvmsg='define' d_rename='define' d_rewinddir='define' d_rmdir='define' -d_safebcpy='define' +d_safebcpy='undef' d_safemcpy='undef' d_sanemcmp='define' d_sbrkproto='define' @@ -297,21 +355,29 @@ d_semctl_semid_ds='define' d_semctl_semun='define' d_semget='define' d_semop='define' +d_sendmsg='define' d_setegid='define' d_seteuid='define' d_setgrent='define' +d_setgrent_r='undef' d_setgrps='define' d_sethent='define' +d_sethostent_r='undef' +d_setitimer='define' d_setlinebuf='define' d_setlocale='define' +d_setlocale_r='undef' d_setnent='define' +d_setnetent_r='undef' d_setpent='define' d_setpgid='define' d_setpgrp2='undef' d_setpgrp='define' d_setprior='define' d_setproctitle='undef' +d_setprotoent_r='undef' d_setpwent='define' +d_setpwent_r='undef' d_setregid='define' d_setresgid='undef' d_setresuid='undef' @@ -319,6 +385,7 @@ d_setreuid='define' d_setrgid='define' d_setruid='define' d_setsent='define' +d_setservent_r='undef' d_setsid='define' d_setvbuf='define' d_sfio='undef' @@ -329,12 +396,19 @@ d_shmctl='define' d_shmdt='define' d_shmget='define' d_sigaction='define' +d_sigprocmask='define' d_sigsetjmp='define' +d_sockatmark='undef' +d_sockatmarkproto='undef' d_socket='define' d_socklen_t='undef' d_sockpair='define' d_socks5_init='undef' d_sqrtl='define' +d_srand48_r='undef' +d_srandom_r='undef' +d_sresgproto='undef' +d_sresuproto='undef' d_statblks='define' d_statfs_f_flags='define' d_statfs_s='define' @@ -351,10 +425,13 @@ d_strcoll='define' d_strctcpy='define' d_strerrm='strerror(e)' d_strerror='define' +d_strerror_r='undef' +d_strftime='define' d_strtod='define' d_strtol='define' d_strtold='undef' d_strtoll='undef' +d_strtoq='undef' d_strtoul='define' d_strtoull='undef' d_strtouq='undef' @@ -362,6 +439,7 @@ d_strxfrm='define' d_suidsafe='undef' d_symlink='define' d_syscall='define' +d_syscallproto='undef' d_sysconf='define' d_sysernlst='' d_syserrlst='define' @@ -372,11 +450,20 @@ d_telldir='define' d_telldirproto='define' d_time='define' d_times='define' +d_tm_tm_gmtoff='define' +d_tm_tm_zone='define' +d_tmpnam_r='undef' d_truncate='define' +d_ttyname_r='undef' d_tzname='define' +d_u32align='define' +d_ualarm='define' d_umask='define' d_uname='define' d_union_semun='undef' +d_unordered='define' +d_usleep='define' +d_usleepproto='undef' d_ustat='define' d_vendorarch='undef' d_vendorbin='undef' @@ -391,26 +478,38 @@ d_wait4='define' d_waitpid='define' d_wcstombs='define' d_wctomb='define' +d_writev='define' d_xenix='undef' date='date' db_hashtype='u_int32_t' db_prefixtype='size_t' +db_version_major='1' +db_version_minor='0' +db_version_patch='0' defvoidused='15' direntrytype='struct dirent' dlext='so' dlsrc='dl_dlopen.xs' doublesize='8' drand01='drand48()' -dynamic_ext='B ByteLoader DB_File Data/Dumper Devel/DProf Devel/Peek Fcntl File/Glob IO IPC/SysV NDBM_File ODBM_File Opcode POSIX SDBM_File Socket Sys/Hostname Sys/Syslog Thread attrs re' +drand48_r_proto='0' +dynamic_ext='B ByteLoader Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Encode Fcntl File/Glob Filter/Util/Call I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 NDBM_File ODBM_File Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Time/HiRes Unicode/Normalize XS/APItest XS/Typemap attrs re threads threads/shared' eagain='EAGAIN' ebcdic='undef' echo='echo' egrep='egrep' emacs='' +endgrent_r_proto='0' +endhostent_r_proto='0' +endnetent_r_proto='0' +endprotoent_r_proto='0' +endpwent_r_proto='0' +endservent_r_proto='0' eunicefix=':' exe_ext='' expr='expr' -extensions='B ByteLoader DB_File Data/Dumper Devel/DProf Devel/Peek Fcntl File/Glob IO IPC/SysV NDBM_File ODBM_File Opcode POSIX SDBM_File Socket Sys/Hostname Sys/Syslog Thread attrs re Errno' +extensions='B ByteLoader Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Encode Fcntl File/Glob Filter/Util/Call I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 NDBM_File ODBM_File Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Time/HiRes Unicode/Normalize XS/APItest XS/Typemap attrs re threads threads/shared Errno' +extras='' fflushNULL='define' fflushall='undef' find='' @@ -419,16 +518,40 @@ flex='' fpossize='8' fpostype='fpos_t' freetype='void' +from=':' full_ar='/usr/bin/ar' full_csh='/usr/bin/csh' -full_sed='/usr/bin/sed' +full_sed='/usr/local/bin/sed' gccosandvers='' gccversion='' +getgrent_r_proto='0' +getgrgid_r_proto='0' +getgrnam_r_proto='0' +gethostbyaddr_r_proto='0' +gethostbyname_r_proto='0' +gethostent_r_proto='0' +getlogin_r_proto='0' +getnetbyaddr_r_proto='0' +getnetbyname_r_proto='0' +getnetent_r_proto='0' +getprotobyname_r_proto='0' +getprotobynumber_r_proto='0' +getprotoent_r_proto='0' +getpwent_r_proto='0' +getpwnam_r_proto='0' +getpwuid_r_proto='0' +getservbyname_r_proto='0' +getservbyport_r_proto='0' +getservent_r_proto='0' +getspnam_r_proto='0' gidformat='"u"' gidsign='1' gidsize='4' gidtype='gid_t' glibpth='/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib' +gmake='gmake' +gmtime_r_proto='0' +gnulibc_version='' grep='grep' groupcat='cat /etc/group' groupstype='gid_t' @@ -447,6 +570,7 @@ i8size='1' i8type='char' i_arpainet='define' i_bsdioctl='' +i_crypt='define' i_db='define' i_dbm='define' i_dirent='define' @@ -454,11 +578,13 @@ i_dld='undef' i_dlfcn='define' i_fcntl='undef' i_float='define' +i_fp='define' +i_fp_class='define' i_gdbm='undef' i_grp='define' -i_iconv='define' i_ieeefp='undef' i_inttypes='undef' +i_langinfo='define' i_libutil='undef' i_limits='define' i_locale='define' @@ -501,7 +627,7 @@ i_sysparam='define' i_sysresrc='define' i_syssecrt='define' i_sysselct='define' -i_syssockio='' +i_syssockio='undef' i_sysstat='define' i_sysstatfs='undef' i_sysstatvfs='define' @@ -529,28 +655,28 @@ inc_version_list=' ' inc_version_list_init='0' incpath='' inews='' -installarchlib='/opt/perl/lib/5.6.1/alpha-dec_osf-thread' +installarchlib='/opt/perl/lib/5.8.0/alpha-dec_osf' installbin='/opt/perl/bin' installman1dir='/opt/perl/man/man1' installman3dir='/opt/perl/man/man3' installprefix='/opt/perl' installprefixexp='/opt/perl' -installprivlib='/opt/perl/lib/5.6.1' +installprivlib='/opt/perl/lib/5.8.0' installscript='/opt/perl/bin' -installsitearch='/opt/perl/lib/site_perl/5.6.1/alpha-dec_osf-thread' +installsitearch='/opt/perl/lib/site_perl/5.8.0/alpha-dec_osf' installsitebin='/opt/perl/bin' -installsitelib='/opt/perl/lib/site_perl/5.6.1' +installsitelib='/opt/perl/lib/site_perl/5.8.0' installstyle='lib' installusrbinperl='define' installvendorarch='' installvendorbin='' installvendorlib='' intsize='4' -issymlink='-h' +issymlink='test -h' ivdformat='"ld"' ivsize='8' ivtype='long' -known_extensions='B ByteLoader DB_File Data/Dumper Devel/DProf Devel/Peek Fcntl File/Glob GDBM_File IO IPC/SysV NDBM_File ODBM_File Opcode POSIX SDBM_File Socket Sys/Hostname Sys/Syslog Thread attrs re' +known_extensions='B ByteLoader Cwd DB_File Data/Dumper Devel/DProf Devel/PPPort Devel/Peek Digest/MD5 Encode Fcntl File/Glob Filter/Util/Call GDBM_File I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 NDBM_File ODBM_File Opcode POSIX PerlIO/encoding PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Thread Time/HiRes Unicode/Normalize XS/APItest XS/Typemap attrs re threads threads/shared' ksh='' ld='ld' lddlflags='-shared -expect_unresolved "*" -msym -std -s' @@ -562,18 +688,19 @@ lib_ext='.a' libc='/usr/shlib/libc.so' libperl='libperl.so' libpth='/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /var/shlib' -libs='-lgdbm -ldbm -ldb -lm -liconv -lutil -lpthread -lexc' -libsdirs=' /usr/shlib /usr/ccs/lib' -libsfiles=' libgdbm.so libdbm.a libdb.so libm.so libiconv.so libutil.a libpthread.so libexc.so' -libsfound=' /usr/shlib/libgdbm.so /usr/ccs/lib/libdbm.a /usr/shlib/libdb.so /usr/shlib/libm.so /usr/shlib/libiconv.so /usr/ccs/lib/libutil.a /usr/shlib/libpthread.so /usr/shlib/libexc.so' +libs='-ldbm -ldb -lm -lutil' +libsdirs=' /usr/ccs/lib /usr/shlib' +libsfiles=' libdbm.a libdb.so libm.so libutil.a' +libsfound=' /usr/ccs/lib/libdbm.a /usr/shlib/libdb.so /usr/shlib/libm.so /usr/ccs/lib/libutil.a' libspath=' /usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /var/shlib' -libswanted='sfio socket bind inet nsl nm gdbm dbm db malloc dld ld sun m cposix posix ndir dir crypt sec ucb BSD x iconv util pthread exc' +libswanted='sfio socket bind inet nsl nm gdbm dbm db malloc dld ld sun m cposix posix ndir dir crypt sec ucb BSD x util' libswanted_uselargefiles='' line='' lint='' lkflags='' ln='ln' lns='/usr/bin/ln -s' +localtime_r_proto='0' locincpth='/usr/local/include /opt/local/include /usr/gnu/include /opt/gnu/include /usr/GNU/include /opt/GNU/include' loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib' longdblsize='8' @@ -609,6 +736,7 @@ mydomain='.yourplace.com' myhostname='yourhost' myuname='osf1 alpha.hut.fi v4.0 878 alpha ' n='' +need_va_copy='undef' netdb_hlen_type='int' netdb_host_type='const char *' netdb_name_type='const char *' @@ -621,6 +749,7 @@ nroff='nroff' nvEUformat='"E"' nvFUformat='"F"' nvGUformat='"G"' +nv_preserves_uv_bits='53' nveformat='"e"' nvfformat='"f"' nvgformat='"g"' @@ -629,20 +758,21 @@ nvtype='double' o_nonblock='O_NONBLOCK' obj_ext='.o' old_pthread_create_joinable='' -optimize='-O' +optimize='-O4' orderlib='false' osname='dec_osf' -osvers='4.0' +osvers='4.0d' otherlibdirs=' ' package='perl5' -pager='/c/bin/less' +pager='/usr/local/bin/less' passcat='cat /etc/passwd' -patchlevel='6' +patchlevel='8' path_sep=':' -perl5='/u/vieraat/vieraat/jhi/Perl/bin/perl' +perl5='perl' perl='' +perl_patchlevel='17634' perladmin='yourname@yourhost.yourplace.com' -perllibs='-lm -liconv -lutil -lpthread -lexc' +perllibs='-lm -lutil' perlpath='/opt/perl/bin/perl' pg='pg' phostname='' @@ -653,20 +783,25 @@ pmake='' pr='' prefix='/opt/perl' prefixexp='/opt/perl' -privlib='/opt/perl/lib/5.6.1' -privlibexp='/opt/perl/lib/5.6.1' +privlib='/opt/perl/lib/5.8.0' +privlibexp='/opt/perl/lib/5.8.0' +procselfexe='' prototype='define' ptrsize='8' quadkind='2' quadtype='long' randbits='48' randfunc='drand48' +random_r_proto='0' randseedtype='long' ranlib=':' rd_nodata='-1' +readdir64_r_proto='0' +readdir_r_proto='0' revision='5' rm='rm' rmail='' +run='' runnm='true' sPRIEUldbl='"E"' sPRIFUldbl='"F"' @@ -689,6 +824,13 @@ seedfunc='srand48' selectminbits='32' selecttype='fd_set *' sendmail='' +setgrent_r_proto='0' +sethostent_r_proto='0' +setlocale_r_proto='0' +setnetent_r_proto='0' +setprotoent_r_proto='0' +setpwent_r_proto='0' +setservent_r_proto='0' sh='/bin/sh' shar='' sharpbang='#!' @@ -701,14 +843,15 @@ sig_name='ZERO HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TE sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "EMT", "FPE", "KILL", "BUS", "SEGV", "SYS", "PIPE", "ALRM", "TERM", "IOINT", "STOP", "TSTP", "CONT", "CHLD", "TTIN", "TTOU", "AIO", "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "INFO", "USR1", "USR2", "RESV", "RTMIN", "NUM34", "NUM35", "NUM36", "NUM37", "NUM38", "NUM39", "NUM40", "NUM41", "NUM42", "NUM43", "NUM44", "NUM45", "NUM46", "NUM47", "MAX", "IOT", "LOST", "URG", "CLD", "IO", "POLL", "PTY", "PWR", "RTMAX", 0' sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 6 6 16 20 23 23 23 29 48 ' sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 6, 6, 16, 20, 23, 23, 23, 29, 48, 0' +sig_size='58' signal_t='void' -sitearch='/opt/perl/lib/site_perl/5.6.1/alpha-dec_osf-thread' -sitearchexp='/opt/perl/lib/site_perl/5.6.1/alpha-dec_osf-thread' +sitearch='/opt/perl/lib/site_perl/5.8.0/alpha-dec_osf' +sitearchexp='/opt/perl/lib/site_perl/5.8.0/alpha-dec_osf' sitebin='/opt/perl/bin' sitebinexp='/opt/perl/bin' -sitelib='/opt/perl/lib/site_perl/5.6.1' +sitelib='/opt/perl/lib/site_perl/5.8.0' sitelib_stem='/opt/perl/lib/site_perl' -sitelibexp='/opt/perl/lib/site_perl/5.6.1' +sitelibexp='/opt/perl/lib/site_perl/5.8.0' siteprefix='/opt/perl' siteprefixexp='/opt/perl' sizesize='8' @@ -722,7 +865,9 @@ socksizetype='int' sort='sort' spackage='Perl5' spitshell='cat' -src='/m/fs/work/work/permanent/perl/pp4/maint-5.6/perl' +srand48_r_proto='0' +srandom_r_proto='0' +src='.' ssizetype='ssize_t' startperl='#!/opt/perl/bin/perl' startsh='#!/bin/sh' @@ -734,21 +879,26 @@ stdio_cnt='((fp)->_cnt)' stdio_filbuf='' stdio_ptr='((fp)->_ptr)' stdio_stream_array='_iob' +strerror_r_proto='0' strings='/usr/include/string.h' submit='' -subversion='1' -sysman='/usr/man/man1' +subversion='0' +sysman='/usr/share/man/man1' tail='' tar='' +targetarch='' tbl='' tee='' test='test' timeincl='/usr/include/sys/time.h ' timetype='time_t' +tmpnam_r_proto='0' +to=':' touch='touch' tr='tr' trnl='\n' troff='' +ttyname_r_proto='0' u16size='2' u16type='unsigned short' u32size='4' @@ -764,9 +914,10 @@ uidtype='uid_t' uname='uname' uniq='uniq' uquadtype='unsigned long' -use5005threads='define' +use5005threads='undef' use64bitall='define' use64bitint='define' +usecrosscompile='undef' usedl='define' useithreads='undef' uselargefiles='define' @@ -776,12 +927,13 @@ usemultiplicity='undef' usemymalloc='n' usenm='true' useopcode='true' -useperlio='undef' +useperlio='define' useposix='true' +usereentrant='undef' usesfio='false' useshrplib='true' usesocks='undef' -usethreads='define' +usethreads='undef' usevendorprefix='undef' usevfork='false' usrinc='/usr/include' @@ -801,39 +953,37 @@ vendorlib_stem='' vendorlibexp='' vendorprefix='' vendorprefixexp='' -version='5.6.1' +version='5.8.0' +version_patchlevel_string='version 8 subversion 0 patch 17634' versiononly='undef' vi='' voidflags='15' xlibpth='/usr/lib/386 /lib/386' -xs_apiversion='5.6.1' -yacc='/u/vieraat/vieraat/jhi/Perl/bin/byacc' +xs_apiversion='5.8.0' +perl5='yacc' yaccflags='' zcat='' zip='zip' # Configure command line arguments. config_arg0='./Configure' -config_args='-Dprefix=/opt/perl -Doptimize=-O -Dusethreads -Duse5005threads -Duse64bitint -Duselargefiles -Dcf_by=yourname -Dcf_email=yourname@yourhost.yourplace.com -Dperladmin=yourname@yourhost.yourplace.com -Dmydomain=.yourplace.com -Dmyhostname=yourhost -dE -Dusedevel' -config_argc=13 +config_args='-Dprefix=/opt/perl -Duse64bitint -Duselargefiles -Dcf_by=yourname -Dcf_email=yourname@yourhost.yourplace.com -Dperladmin=yourname@yourhost.yourplace.com -Dmydomain=.yourplace.com -Dmyhostname=yourhost -dE' +config_argc=9 config_arg1='-Dprefix=/opt/perl' -config_arg2='-Doptimize=-O' -config_arg3='-Dusethreads' -config_arg4='-Duse5005threads' -config_arg5='-Duse64bitint' -config_arg6='-Duselargefiles' -config_arg7='-Dcf_by=yourname' -config_arg8='-Dcf_email=yourname@yourhost.yourplace.com' -config_arg9='-Dperladmin=yourname@yourhost.yourplace.com' -config_arg10='-Dmydomain=.yourplace.com' -config_arg11='-Dmyhostname=yourhost' -config_arg12='-dE' -config_arg13='-Dusedevel' +config_arg2='-Duse64bitint' +config_arg3='-Duselargefiles' +config_arg4='-Dcf_by=yourname' +config_arg5='-Dcf_email=yourname@yourhost.yourplace.com' +config_arg6='-Dperladmin=yourname@yourhost.yourplace.com' +config_arg7='-Dmydomain=.yourplace.com' +config_arg8='-Dmyhostname=yourhost' +config_arg9='-dE' PERL_REVISION=5 -PERL_VERSION=6 -PERL_SUBVERSION=1 +PERL_VERSION=8 +PERL_SUBVERSION=0 PERL_API_REVISION=5 -PERL_API_VERSION=5 +PERL_API_VERSION=8 PERL_API_SUBVERSION=0 -CONFIGDOTSH=true +PERL_PATCHLEVEL=17634 +PERL_CONFIG_SH=true # Variables propagated from previous config.sh file. pp_sys_cflags='ccflags="$ccflags -DNO_EFF_ONLY_OK"' diff --git a/gnu/usr.bin/perl/Porting/findrfuncs b/gnu/usr.bin/perl/Porting/findrfuncs new file mode 100644 index 00000000000..520f158381f --- /dev/null +++ b/gnu/usr.bin/perl/Porting/findrfuncs @@ -0,0 +1,133 @@ +#!/usr/bin/perl -ws + +# +# findrfuncs: find reentrant variants of functions used in an executable. +# +# Requires a functional "nm -u". Searches headers in /usr/include +# to find available *_r functions and looks for non-reentrant +# variants used in the supplied executable. +# +# Requires debug info in the shared libraries/executables. +# +# Gurusamy Sarathy +# gsar@ActiveState.com +# +# Hacked to automatically find the executable and shared objects. +# --jhi + +use strict; +use File::Find; + +my @EXES; +my $NMU = 'nm -u'; +my @INCDIRS = qw(/usr/include); +my $SO = 'so'; +my $EXE = ''; + +if (open(CONFIG, "config.sh")) { + local $/; + my $CONFIG = <CONFIG>; + $SO = $1 if $CONFIG =~ /^so='(\w+)'/m; + $EXE = $1 if $CONFIG =~ /^_exe='\.(\w+)'/m; + close(CONFIG); +} + +push @EXES, "perl$EXE"; + +find(sub {push @EXES, $File::Find::name if /\.$SO$/}, '.' ); + +push @EXES, @ARGV; + +if ($^O eq 'dec_osf') { + $NMU = 'nm -Bu'; +} elsif ($^O eq 'irix') { + $NMU = 'nm -pu'; +} + +my %rfuncs; +my @syms; +find(sub { + return unless -f $File::Find::name; + local *F; + open F, "<$File::Find::name" + or die "Can't open $File::Find::name: $!"; + my $line; + while (defined ($line = <F>)) { + if ($line =~ /\b(\w+_r)\b/) { + #warn "$1 => $File::Find::name\n"; + $rfuncs{$1}->{$File::Find::name}++; + } + } + close F; + }, @INCDIRS); + +# delete bogus symbols grepped out of comments and such +delete $rfuncs{setlocale_r} if $^O eq 'linux'; + +# delete obsolete (as promised by man pages) symbols +my $netdb_r_obsolete; +if ($^O eq 'hpux') { + delete $rfuncs{crypt_r}; + delete $rfuncs{drand48_r}; + delete $rfuncs{endgrent_r}; + delete $rfuncs{endpwent_r}; + delete $rfuncs{getgrent_r}; + delete $rfuncs{getpwent_r}; + delete $rfuncs{setlocale_r}; + delete $rfuncs{srand48_r}; + delete $rfuncs{strerror_r}; + $netdb_r_obsolete = 1; +} elsif ($^O eq 'dec_osf') { + delete $rfuncs{crypt_r}; + delete $rfuncs{strerror_r}; + $netdb_r_obsolete = 1; +} +if ($netdb_r_obsolete) { + delete @rfuncs{qw(endhostent_r + endnetent_r + endprotoent_r + endservent_r + gethostbyaddr_r + gethostbyname_r + gethostent_r + getnetbyaddr_r + getnetbyname_r + getnetent_r + getprotobyname_r + getprotobynumber_r + getprotoent_r + getservbyname_r + getservbyport_r + getservent_r + sethostent_r + setnetent_r + setprotoent_r + setservent_r)}; +} + +my %syms; + +for my $exe (@EXES) { + # warn "#--- $exe\n"; + for my $sym (`$NMU $exe 2>/dev/null`) { + chomp $sym; + $sym =~ s/^\s+//; + $sym =~ s/^([0-9A-Fa-f]+\s+)?[Uu]\s+//; + $sym =~ s/\s+[Uu]\s+-$//; + next if /\s/; + $sym =~ s/\@.*\z//; # remove @@GLIBC_2.0 etc + # warn "#### $sym\n"; + if (exists $rfuncs{"${sym}_r"} && ! $syms{"$sym:$exe"}++) { + push @syms, $sym; + } + } + + if (@syms) { + print "\nFollowing symbols in $exe have reentrant versions:\n"; + for my $sym (@syms) { + my @f = sort keys %{$rfuncs{$sym . '_r'}}; + print "$sym => $sym" . "_r (@f)\n"; + } + } + @syms = (); +} diff --git a/gnu/usr.bin/perl/Porting/findvars b/gnu/usr.bin/perl/Porting/findvars index 3cdb854614d..2d3a9a3b8f1 100644 --- a/gnu/usr.bin/perl/Porting/findvars +++ b/gnu/usr.bin/perl/Porting/findvars @@ -212,7 +212,6 @@ nice_chunk nice_chunk_size ninterps nomemok -nrs nthreads nthreads_cond numeric_local diff --git a/gnu/usr.bin/perl/Porting/genlog b/gnu/usr.bin/perl/Porting/genlog index e040b9ef2cf..0c5fec63618 100644 --- a/gnu/usr.bin/perl/Porting/genlog +++ b/gnu/usr.bin/perl/Porting/genlog @@ -39,8 +39,8 @@ my %branch_exclude; while (@ARGV) { $_ = shift; - if (/^(\d+)\.\.(\d+)$/) { - push @changes, $1 .. $2; + if (/^(\d+)\.\.(\d+)?$/) { + push @changes, $1 .. ($2 || (split(' ', `p4 changes -m 1`))[1]); } elsif (/^\d+$/) { push @changes, $_; @@ -105,7 +105,7 @@ else { } } } - next if not $change or $skip == $nbranch; + next if ((not $change) or $skip); print "_" x 76, "\n"; printf <<EOT, $change, $who, $date, $time; [%6s] By: %-25s on %9s %9s diff --git a/gnu/usr.bin/perl/Porting/p4genpatch b/gnu/usr.bin/perl/Porting/p4genpatch new file mode 100644 index 00000000000..ccedff1087e --- /dev/null +++ b/gnu/usr.bin/perl/Porting/p4genpatch @@ -0,0 +1,180 @@ +#!/usr/bin/perl -w + + +# p4genpatch - Generate a perl patch from the repository + +# Usage: $0 -h + +# andreas.koenig@anima.de + +use strict; +use File::Temp qw(tempdir); +use File::Compare; +use File::Spec; +use File::Spec::Unix; +use Time::Local; +use Getopt::Long; +use Cwd qw(cwd); + +sub correctmtime ($$$); +sub Usage (); + +$0 =~ s|^.*[\\/]||; +my $VERSION = '0.05'; +my $TOPDIR = cwd(); +my @P4opt; +our %OPT = ( "d" => "u", b => "//depot/perl", "D" => "diff" ); +Getopt::Long::Configure("no_ignore_case"); +GetOptions(\%OPT, "b=s", "p=s", "d=s", "D=s", "h", "v", "V") or die Usage; +print Usage and exit if $OPT{h}; +print "$VERSION\n" and exit if $OPT{V}; +die Usage unless @ARGV == 1 && $ARGV[0] =~ /^\d+$/; +my $CHANGE = shift; + +for my $p4opt (qw(p)) { + push @P4opt, "-$p4opt $OPT{$p4opt}" if $OPT{$p4opt}; +} + +my $system = "p4 @P4opt describe -s $CHANGE |"; +open my $p4, $system or die "Could not run $system"; +my @action; +while (<$p4>) { + print; + next unless m|($OPT{b})|; + my($prefix) = $1; + $prefix =~ s|/[^/]+$||; # up to the last "/" in the match is to be stripped + if (my($file,$action) = m|^\.\.\. (//depot.*)\s(\w+)$|) { + next if $action eq "delete"; + push @action, [$action, $file, $prefix]; + } +} +close $p4; + +my $tempdir; +my @unlink; +print "Differences ...\n"; +for my $a (@action) { + $tempdir ||= tempdir( "tmp-XXXX", CLEANUP => 1, TMPDIR => 1 ); + @unlink = (); + my($action,$file,$prefix) = @$a; + my($path,$basename,$number) = $file =~ m|\Q$prefix\E/(.+/)?([^/]+)#(\d+)|; + + my @splitdir = File::Spec::Unix->splitdir($path); + $path = File::Spec->catdir(@splitdir); + + my($depotfile) = $file =~ m|^(.+)#\d+\z|; + die "Panic: Could not parse file[$file]" unless $number; + $path = "" unless defined $path; + my($d1,$d2,$prev,$prevchange,$prevfile,$doadd,$t1,$t2); + $prev = $number-1; + $prevchange = $CHANGE-1; + # can't assume previous rev == $number-1 due to obliterated revisions + $prevfile = "$depotfile\@$prevchange"; + if ($number == 1 or $action =~ /^(add|branch)$/) { + $d1 = $^O eq 'MacOS' ? File::Spec->devnull : "/dev/null"; + $t1 = $d1; + ++$doadd; + } elsif ($action =~ /^(edit|integrate)$/) { + $d1 = File::Spec->catfile($path, "$basename-$prevchange"); + $t1 = File::Spec->catfile($tempdir, $d1); + warn "==> $d1 <==\n" if $OPT{v}; + my $system = qq[p4 @P4opt print -o "$t1" "$prevfile"]; + my $status = `$system`; + if ($?) { + warn "$0: system[$system] failed, status[$?]\n"; + next; + } + chmod 0644, $t1; + if ($status =~ /\#(\d+) \s - \s \w+ \s change \s (\d+) \s /x) { + ($prev,$prevchange) = ($1,$2); + $prevfile = "$depotfile#$prev"; + my $oldd1 = $d1; + $d1 =~ s/-\d+$/#$prev~$prevchange~/; + my $oldt1 = $t1; + $t1 = File::Spec->catfile($tempdir, $d1); + rename $oldt1, $t1; + } + push @unlink, $t1; + } else { + die "Unknown action[$action]"; + } + $d2 = File::Spec->catfile($path, $basename); + $t2 = File::Spec->catfile($tempdir, $d2); + push @unlink, $t2; + warn "==> $d2#$number <==\n" if $OPT{v}; + my $system = qq[p4 @P4opt print -o "$t2" "$file"]; + # warn "system[$system]"; + my $type = `$system`; + if ($?) { + warn "$0: `$system` failed, status[$?]\n"; + next; + } + chmod 0644, $t2; + $type =~ m|^//.*\((.+)\)$| or next; + $type = $1; + if ($doadd or File::Compare::compare($t1, $t2)) { + print "\n==== $file ($type) ====\n"; + unless ($type =~ /text/) { + next; + } + unless ($^O eq 'MacOS') { + $d1 =~ s,\\,/,g; + $d2 =~ s,\\,/,g; + } + print "Index: $d2\n"; + correctmtime($prevfile,$prev,$t1) unless $doadd; + correctmtime($file,$number,$t2); + chdir $tempdir or warn "Could not chdir '$tempdir': $!"; + $system = qq[$OPT{D} -$OPT{d} "$d1" "$d2"]; + system($system); # no return check because diff doesn't always return 0 + chdir $TOPDIR or warn "Could not chdir '$TOPDIR': $!"; + } +} +continue { + for (@unlink) { + unlink or warn "Could not unlink $_: $!" if -f; + } +} +print "End of Patch.\n"; + +my($tz_offset); +sub correctmtime ($$$) { + my($depotfile,$nr,$localfile) = @_; + my %fstat = map { /^\.\.\. (\w+) (.*)$/ } `p4 @P4opt fstat -s "$depotfile"`; + return unless exists($fstat{headRev}) and $fstat{headRev} == $nr; + + if ($^O eq 'MacOS') { # fix epoch ... still off by three hours (EDT->PDT) + require Time::Local; + $tz_offset ||= sprintf "%+0.4d\n", ( + Time::Local::timelocal(localtime) - Time::Local::timelocal(gmtime) + ); + $fstat{headTime} += 2082844801 + $tz_offset; + } + + utime $fstat{headTime}, $fstat{headTime}, $localfile; +} + +sub Usage () { + qq{Usage: $0 [OPTIONS] patchnumber + + -p host:port p4 port (e.g. myhost:1666) + -d diffopt option to pass to diff(1) + -D diff diff(1) to use + -b branch(es) which branches to include (regex); everything up + to the last slash of matched portion of path is + stripped on local copy (default: //depot/perl) + -v verbose + -h print this help and exit + -V print version number and exit + +Fetches all required files from the repository, puts them into a +temporary directory with sensible names and sensible modification +times and composes a patch to STDOUT using external diff command. +Requires repository access. + +Examples: + perl $0 12345 | gzip -c > 12345.gz + perl $0 -dc 12345 > change-12345.patch + perl $0 -b //depot/maint-5.6/perl -v 8571 > 8571 +}; +} diff --git a/gnu/usr.bin/perl/Porting/testall.atom b/gnu/usr.bin/perl/Porting/testall.atom new file mode 100644 index 00000000000..a709cfdb016 --- /dev/null +++ b/gnu/usr.bin/perl/Porting/testall.atom @@ -0,0 +1,91 @@ +#!/bin/sh + +# +# testall.atom +# +# This script creates all.Counts file that can be fed to prof(1) +# to produce various basic block counting profiles. +# +# This script needs to be run at the top level of the Perl build +# directory after the "make all" and "make test" targets have been run. +# +# You will also need to have perl.pixie built, +# which means that you will also have Configured with -Doptimize=-g. +# +# After the script has been run (this will take several minutes) +# you will have a file called all.Counts, which contains the cumulative +# basic block counting results over the whole Perl test suite. +# You can produce various reports using prof(1); +# +# prof -pixie -all -L. perl all.Counts +# prof -pixie -heavy -all -L. perl all.Counts +# prof -pixie -invocations -all -L. perl all.Counts +# prof -pixie -lines -all -L. perl all.Counts +# prof -pixie -testcoverage -all -L. perl all.Counts +# prof -pixie -zero -all -L. perl all.Counts +# +# io/openpid and op/fork core on me, I don't know why and haven't +# taken a look yet. +# +# jhi@iki.fi +# + +if test ! -f /usr/bin/atom +then + echo "$0: no /usr/bin/atom" + exit 1 +fi + +if test ! -f perl; then echo "$0: no perl"; exit 1; fi +if test ! -f perl.pixie; then echo "$0: no perl.pixie; exit 1; fi +if test ! -f t/perl; then echo "$0: no t/perl; exit 1; fi + +LD_LIBRARY_PATH=`pwd` +export LD_LIBRARY_PATH + +cd t || exit 1 + +ln -sf ../perl.pixie . + +if test $# = 0; then + the_t=`echo base/*.t comp/*.t cmd/*.t run/*.t io/*.t; echo op/*.t uni/*.t pod/*.t x2p/*.t; find ../ext ../lib -name '*.t' -print` +else + the_t=$@ +fi + +PERL_DESTRUCT_LEVEL=2 +export PERL_DESTRUCT_LEVEL +PERL_CORE=1 +export PERL_CORE + +rm -f all.Counts + +for t in $the_t +do + case "$t" in + ext/*|lib/*) t=../$t ;; + t/*) t=`echo $t|sed 's:^t/::'` ;; + esac + echo $t|sed 's:\.t$::' + sw='' + case "`head -1 $t|egrep -e '^#.* -.*T'`" in + *-*T*) sw="$sw -T" ;; + esac + case "`head -1 $t|egrep -e '^#.* -.*t'`" in + *-*t*) sw="$sw -t" ;; + esac + ./perl.pixie -I../lib $sw $t > /dev/null + if cd .. + then + if test -f all.Counts + then + prof -pixie -merge new.Counts -L. -incobj libperl.so perl t/perl.Counts all.Counts + mv new.Counts all.Counts + else + mv t/perl.Counts all.Counts + fi + cd t + fi +done + +exit 0 diff --git a/gnu/usr.bin/perl/Porting/thirdclean b/gnu/usr.bin/perl/Porting/thirdclean new file mode 100644 index 00000000000..c45de156178 --- /dev/null +++ b/gnu/usr.bin/perl/Porting/thirdclean @@ -0,0 +1,82 @@ +local $/; +$_ = <ARGV>; + +my @accv = /(^-+ \w+ -- \d+ --(?:.(?!^-))+)/msg; +my @leak = /(\d+ bytes? in \d+ leaks? .+? created at:(?:.(?!^[\d-]))+)/msg; + +$leak[ 0] =~ s/.* were found:\n\n//m; # Snip off totals. + +# Weed out the known access violations. + +@accv = grep { ! /-- ru[hs] --.+setlocale.+Perl_init_i18nl10n/s } @accv; +@accv = grep { ! /-- [rw][ui]s --.+_doprnt_dis/s } @accv; +@accv = grep { ! /-- (?:fon|ris) --.+__strxfrm/s } @accv; +@accv = grep { ! /-- rus --.+__catgets/s } @accv; +@accv = grep { ! /-- rus --.+__execvp/s } @accv; +@accv = grep { ! /-- rus --.+tmpnam.+tmpfile/s } @accv; +@accv = grep { ! /-- rus --.+__gethostbyname/s } @accv; +@accv = grep { ! /-- ris --.+__actual_atof/s } @accv; +@accv = grep { ! /-- ris --.+__strftime/s } @accv; + +# Weed out untraceable access violations. +@accv = grep { ! / ----- /s } @accv; +@accv = grep { ! /-- r[ui][hs] --.+proc_at_/s } @accv; +@accv = grep { ! /-- r[ui][hs] --.+pc = 0x/s } @accv; + +# The following look like being caused by the intrinsic inlined +# string handling functions reading one or few bytes beyond the +# actual length. +@accv = grep { ! /-- rih --.+(?:memmove|strcpy).+moreswitches/s } @accv; +@accv = grep { ! /-- (?:rih|rus) --.+strcpy.+gv_fetchfile/s } @accv; +@accv = grep { ! /-- rih --.+strcmp.+doopen_pmc/s } @accv; +@accv = grep { ! /-- rih --.+strcmp.+gv_fetchpv/s } @accv; +@accv = grep { ! /-- r[ui]h --.+strcmp.+gv_fetchmeth/s } @accv; +@accv = grep { ! /-- rih --.+memmove.+my_setenv/s } @accv; +@accv = grep { ! /-- rih --.+memmove.+catpvn_flags/s } @accv; + +# yyparse. +@accv = grep { ! /Perl_yyparse/s } @accv; + +# Weed out the known memory leaks. + +@leak = grep { ! /setlocale.+Perl_init_i18nl10n/s } @leak; +@leak = grep { ! /setlocale.+set_numeric_standard/s } @leak; +@leak = grep { ! /_findiop.+fopen/s } @leak; +@leak = grep { ! /_findiop.+__fdopen/s } @leak; +@leak = grep { ! /__localtime/s } @leak; +@leak = grep { ! /__get_libc_context/s } @leak; +@leak = grep { ! /__sia_init/s } @leak; + +# Weed out untraceable memory leaks. +@leak = grep { ! / ----- /s } @leak; +@leak = grep { ! /pc = 0x/s } @leak; +@leak = grep { ! /_pc_range_table/s } @leak; +@leak = grep { ! /_add_gp_range/s } @leak; + +# yyparse. +@leak = grep { ! /Perl_yyparse/s } @leak; + +# Output the cleaned up report. + +# Access violations. + +for (my $i = 0; $i < @accv; $i++) { + $_ = $accv[$i]; + s/\d+/$i/; + print; +} + +# Memory leaks. + +my ($leakb, $leakn, $leaks); + +for (my $i = 0; $i < @leak; $i++) { + $_ = $leak[$i]; + print $_, "\n"; + /^(\d+) bytes? in (\d+) leak/; + $leakb += $1; + $leakn += $2; + $leaks += $1 if /including (\d+) super/; +} + +print "Bytes $leakb Leaks $leakn Super $leaks\n" if $leakb; |