From 0b166b6635cf199f072db516b2a523ee659394d5 Mon Sep 17 00:00:00 2001 From: Ilya Zakharevich Date: Mon, 28 Jul 1997 16:23:32 +1200 Subject: Perldoc tiny patch to avoid $0 Editing $0 may be not-so-portable. Enjoy, p5p-msgid: 199709122141.RAA16846@monk.mps.ohio-state.edu --- utils/perldoc.PL | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/utils/perldoc.PL b/utils/perldoc.PL index 38ea9ee5ca..0f43c36c1b 100644 --- a/utils/perldoc.PL +++ b/utils/perldoc.PL @@ -45,10 +45,11 @@ print OUT <<'!NO!SUBS!'; # the perl manuals, though it too is written in perl. if(@ARGV<1) { - $0 =~ s,.*/,,; + $me = $0; # Editing $0 is unportable + $me =~ s,.*/,,; die < Date: Wed, 20 Aug 1997 09:43:32 +1200 Subject: h2ph broken in 5.004_02 > The h2ph in perl5.00402 generates perl code that the interpeter > chokes on. For example, running h2ph on /usr/include/sys/errno.h > (under openbsd) transforms this: > > #define EPERM 1 /* Operation not permitted */ > > into this: > > unless(defined(&EPERM) { > sub EPERM () {1;} > } > > which in turn causes this: > > syntax error at - line 2, near "sub EPERM ()" > > I'm not exactly sure why h2ph is worried about avoiding redefinition . . . It's not a redefinition problem; errno.ph is missing a right paren. Here is a patch, tested against 5.004_02: Credited: David Mazieres p5p-msgid: 199708201700.KAA02621@www.chapin.edu --- utils/h2ph.PL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/h2ph.PL b/utils/h2ph.PL index d48571f00f..7c36f21079 100644 --- a/utils/h2ph.PL +++ b/utils/h2ph.PL @@ -132,7 +132,7 @@ foreach $file (@ARGV) { print OUT $t,"eval 'sub $name () {",$new,";}' unless defined(\&$name);\n"; } else { - print OUT $t,"unless(defined(\&$name) {\nsub $name () {",$new,";}\n}\n"; + print OUT $t,"unless(defined(\&$name)) {\nsub $name () {",$new,";}\n}\n"; } } } -- cgit v1.2.1 From 0806a92ffc3a74ca70aa81051cdf2a306cd0a8af Mon Sep 17 00:00:00 2001 From: Tony Sanders Date: Sun, 24 Aug 1997 10:17:29 +1200 Subject: eg/sysvipc/ipcsem bug, new hints/bsdos.sh There appears to be a bug in the example ipcsem with the number of arguments to the SYSV IPC semop() function -- the POD's agree that it only takes two arguments now. The version of hints/bsdos.sh below has been cleaned up and updated for the next BSD/OS release. p5p-msgid: 199708272301.RAA12803@austin.bsdi.com --- eg/sysvipc/ipcsem | 4 +- hints/bsdos.sh | 162 ++++++++++++++++++------------------------------------ 2 files changed, 54 insertions(+), 112 deletions(-) diff --git a/eg/sysvipc/ipcsem b/eg/sysvipc/ipcsem index 4d871b901a..e0dc551bc5 100644 --- a/eg/sysvipc/ipcsem +++ b/eg/sysvipc/ipcsem @@ -18,7 +18,7 @@ print "semaphore id: $id\n"; if ($signal) { while () { print "Signalling\n"; - unless (semop($id, 0, pack("sss", 0, 1, 0))) { + unless (semop($id, pack("sss", 0, 1, 0))) { die "Can't signal semaphore: $!\n"; } } @@ -26,7 +26,7 @@ if ($signal) { else { $SIG{'INT'} = $SIG{'QUIT'} = "leave"; for (;;) { - unless (semop($id, 0, pack("sss", 0, -1, 0))) { + unless (semop($id, pack("sss", 0, -1, 0))) { die "Can't wait for semaphore: $!\n"; } print "Unblocked\n"; diff --git a/hints/bsdos.sh b/hints/bsdos.sh index ef98ace43f..53adfa3b50 100644 --- a/hints/bsdos.sh +++ b/hints/bsdos.sh @@ -1,39 +1,60 @@ # hints/bsdos.sh # -# hints file for BSD/OS 2.x (adapted from bsd386.sh) -# Original by Neil Bowers -# Tue Oct 4 12:01:34 EDT 1994 -# Updated by Tony Sanders -# Mon Nov 27 17:25:51 CST 1995 +# hints file for BSD/OS (adapted from bsd386.sh) +# Original by Neil Bowers ; Tue Oct 4 12:01:34 EDT 1994 +# Updated by Tony Sanders ; Sat Aug 23 12:47:45 MDT 1997 +# Added 3.1 with ELF dynamic libraries +# SYSV IPC tested Ok so I re-enabled. # -# You can override the compiler and loader on the Configure command line: -# ./Configure -Dcc=shlicc2 -Dld=shlicc2 - -# filename extension for shared library objects -so='o' +# To override the compiler on the command line: +# ./Configure -Dcc=gcc2 +# +# The BSD/OS distribution is built with: +# ./Configure -des -Dbsdos_distribution=defined -# Don't use this for Perl 5.002, which needs parallel sig_name and sig_num lists -#sig_name='ZERO HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM URG STOP TSTP CONT CHLD TTIN TTOU IO XCPU XFSZ VTALRM PROF WINCH INFO USR1 USR2 ' signal_t='void' d_voidsig='define' +usemymalloc='n' + +# setre?[ug]id() have been replaced by the _POSIX_SAVED_IDS versions. +# See http://www.bsdi.com/bsdi-man?setuid(2) +d_setregid='undef' +d_setreuid='undef' +d_setrgid='undef' +d_setruid='undef' + # we don't want to use -lnm, since exp() is busted (in 1.1 anyway) set `echo X "$libswanted "| sed -e 's/ nm / /'` shift libswanted="$*" -# BSD/OS X libraries are in their own tree +# X libraries are in their own tree glibpth="$glibpth /usr/X11/lib" ldflags="$ldflags -L/usr/X11/lib" # Avoid telldir prototype conflict in pp_sys.c pp_sys_cflags='ccflags="$ccflags -DHAS_TELLDIR_PROTOTYPE"' +case "$optimize" in +'') optimize='-O2' ;; +esac + case "$bsdos_distribution" in -defined) - d_portable='no' +''|undef|false) ;; +*) + d_dosuid='define' + d_portable='undef' prefix='/usr/contrib' + perlpath='/usr/bin/perl5' + startperl='#!/usr/bin/perl5' + scriptdir='/usr/contrib/bin' + privlib='/usr/libdata/perl5' + man1dir='/usr/contrib/man/man1' man3dir='/usr/contrib/man/man3' + # phlib added by BSDI -- we share the *.ph include dir with perl4 + phlib="/usr/libdata/perl5/site_perl/$(arch)-$osname/include" + phlibexp="/usr/libdata/perl5/site_perl/$(arch)-$osname/include" ;; esac @@ -48,120 +69,41 @@ case "$osvers" in '') cc='gcc2' ;; esac ;; -2.0*) - # default to GCC 2.X w/shared libraries - case "$cc" in - '') cc='shlicc2' ;; - esac - - # default ld to shared library linker - case "$ld" in - '') ld='shlicc2' ;; - esac - - # setre?[ug]id() have been replaced by the _POSIX_SAVED_IDS stuff - # in 4.4BSD-based systems (including BSD/OS 2.0 and later). - # See http://www.bsdi.com/bsdi-man?setuid(2) - d_setregid='undef' - d_setreuid='undef' - d_setrgid='undef' - d_setruid='undef' - ;; -2.1*) - # Use 2.1's shlicc2 for dynamic linking - # Since cc -o is linking, use it for compiling too. - # I'm not sure whether Configure is careful about - # distinguishing between the two. +2.0*|2.1*|3.0*) + so='o' + # default to GCC 2.X w/shared libraries case "$cc" in '') cc='shlicc2' cccdlflags=' ' ;; # Avoid the dreaded -fpic esac - # Link with shared libraries in 2.1 - # Turns out that shlicc2 will automatically use the - # shared libs, so don't explicitly specify -lc_s.2.1.* + # default ld to shared library linker case "$ld" in '') ld='shlicc2' lddlflags='-r' ;; # this one is necessary esac - # setre?[ug]id() have been replaced by the _POSIX_SAVED_IDS stuff - # in 4.4BSD-based systems (including BSD/OS 2.0 and later). - # See http://www.bsdi.com/bsdi-man?setuid(2) - # This stuff may or may not be right, but it works. - d_setregid='undef' - d_setreuid='undef' - d_setrgid='undef' - d_setruid='undef' - - # based on the 5.001m hints file from BSD/OS source disk - # (this is needed for pTk to work) - - # BSD/OS 2.1 doesn't (yet) support true dynamic linking. - # So we "preload' the shared libraries by linking against - # them, even though we don't pull in any symbols thereby. + # Must preload the static shared libraries. libswanted="Xpm Xaw Xmu Xt SM ICE Xext X11 $libswanted" libswanted="rpc curses termcap $libswanted" - ;; -3.0*) - # adapted from 2.1 entry by Christopher Davis Date: Fri, 5 Sep 1997 00:00:00 +0000 Subject: 5.004m4t1: perlbug: NIS domainname gets into wrong places >>>>> Jarkko Hietaniemi writes: jhi> [patch mode] jhi> I suggest the following patch: appending the ".`domainname`" only iff jhi> it contains dots and when last element has only [A-Za-z] and is no jhi> longer than 3 characters. What were the latest plans about adding new jhi> top level domains? Will these heuristics still be true? No. And I recall we have been flamed heavily in the past for using `domainname` at all and I'm surprised that we still do. I'd suggest such a patch instead: p5p-msgid: sfcg1qy38as.fsf@anna.in-berlin.de --- utils/perlbug.PL | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/utils/perlbug.PL b/utils/perlbug.PL index 6b670fc46b..0827db889a 100644 --- a/utils/perlbug.PL +++ b/utils/perlbug.PL @@ -292,12 +292,9 @@ EOF $domain = Mail::Util::maildomain(); } elsif ($Is_MSWin32) { $domain = $ENV{'USERDOMAIN'}; - } elsif ($Is_VMS) { + } else { require Sys::Hostname; $domain = Sys::Hostname::hostname(); - } else { - $domain = `hostname`.".".`domainname`; - $domain =~ s/[\r\n]+//g; } my($guess); -- cgit v1.2.1 From 62b753c6ae4ab9bf22fbb6ec7ceac820bcef8fe4 Mon Sep 17 00:00:00 2001 From: "Joseph N. Hall" Date: Fri, 5 Sep 1997 00:00:00 +0000 Subject: perldoc diffs: don't search auto - much faster Give this a try. It causes unsuccessful searches to run about 3 times as fast on my machine. Not exactly a speed demon but at least you don't have time to get up and make coffee. I tried adding caching to stop the repeated readdir in the case-insensitive matching subroutine, but a) it only lopped off another 20% and b) the patch made a kind of a Frankenstein thing out of the subroutine, so c) I will try to write a better one later when I have time. p5p-msgid: MailDrop1.2d7dPPC.971012211957@screechy.cscaper.com --- utils/perldoc.PL | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/perldoc.PL b/utils/perldoc.PL index 0f43c36c1b..0bb45424f8 100644 --- a/utils/perldoc.PL +++ b/utils/perldoc.PL @@ -195,7 +195,11 @@ sub minus_f_nocase { if($recurse) { opendir(D,$dir); - my(@newdirs) = grep(-d,map("$dir/$_",grep(!/^\.\.?$/,readdir(D)))); + my @newdirs = map "$dir/$_", grep { + not /^\.\.?$/ and + not /^auto$/ and # save time! don't search auto dirs + -d "$dir/$_" + } readdir D; closedir(D); @newdirs = map((s/.dir$//,$_)[1],@newdirs) if $Is_VMS; next unless @newdirs; -- cgit v1.2.1