home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / perl501m.zip / patches / patch.1b < prev    next >
Text File  |  1995-04-20  |  12KB  |  434 lines

  1. # This is my patch  patch.1b for perl5.001.  See description below.
  2. #    Andy Dougherty        doughera@lafcol.lafayette.edu
  3. exit 0           # Just in case
  4.  
  5. This is my patch  patch.1b  for perl5.001.  
  6.  
  7. [Actually, that's a lie.  This is just a reposting of two of my
  8. patches (removing some byacc dependencies and fixing some set*id
  9. stuff) + one version of the x2p/walk.c emit_split() patch.
  10. I've just usurped the letter 'b' to fit in my patch sequence. 
  11. You probably have already applied these as well, but again here they
  12. are all packaged up nice and neatly for storage on ftp sites.]
  13.  
  14. To apply, change to your perl directory,
  15. and apply with 
  16.     patch -p1 < thispatch.
  17.  
  18.     Patch and enjoy,
  19.  
  20.     Andy Dougherty            doughera@lafcol.lafayette.edu
  21.     Dept. of Physics
  22.     Lafayette College, Easton PA
  23.  
  24. >From doughera@lafcol.lafayette.edu Wed Mar 15 14:35:34 1995
  25. Date: Wed, 15 Mar 1995 14:11:48 -0500 (EST)
  26. From: Andy Dougherty <doughera@lafcol.lafayette.edu>
  27. To: Perl Porters <perl5-porters@africa.nicoh.com>
  28. Subject: 5.001 byacc/perly problem?
  29.  
  30. Here's one possible solution to the byacc problem.  Short summary:
  31. make will think your perly.[ch] are out of date because perly.c.diff
  32. has changed.  They aren't really out of date, but the ordering of the
  33. timestamps in the distribution fools make.   I had put some traps in
  34. perly.fixer to check to make sure that everything got run only if
  35. you ran the same version of byacc (1.8) as Larry, but the traps aren't good
  36. enough:  There's a Cygnus version of byacc out there that also calls
  37. itself 1.8 (with a +Cygnus xxx note attached).  I don't think I'll
  38. ever be able to reliably detect all mutant byacc's, so the safest
  39. course of action seems to be to never run byacc.
  40. (Yes, the perly.fixer check could be a _lot_ smarter.  Volunteers?)
  41.  
  42. This simple-minded fix just puts in a 
  43. perly.c: perly.y
  44.     - touch perly.c
  45. perly.h: perly.y
  46.     - touch perly.h
  47. to bring perly.[ch] up to date, if needed.
  48. The '-' are in case your source is read-only.
  49.  
  50. It also does the same trick in x2p/Makefile.SH.
  51.  
  52. WARNING!  Danger!   Larry, if you do this, it means you have to
  53. explicitly call
  54.     make run_byacc
  55. whenever you change perly.y, perly.c.diff, or 
  56.     cd x2p; make run_byacc
  57. if you change x2p/a2p.y.
  58.  
  59. However, it might be worth it.  I leave it up to you.
  60.  
  61. Apply with
  62.     patch -p1 < thisfile
  63.  
  64. Patch and enjoy,
  65.  
  66.     Andy Dougherty        doughera@lafcol.lafayette.edu
  67.     Dept. of Physics
  68.     Lafayette College, Easton PA 18042
  69.  
  70.  
  71. Index: Makefile.SH
  72. *** perl5.001/Makefile.SH    Sun Mar 12 02:35:37 1995
  73. --- perl5.001a/Makefile.SH    Wed Mar 15 09:03:26 1995
  74. ***************
  75. *** 273,314 ****
  76.   
  77.   install: all
  78.       ./perl installperl
  79. - !NO!SUBS!
  80. - : Only print out the rules for running byacc if the user _has_ byacc.
  81. - : Otherwise, comment them out.  Users who really know what they are
  82. - : doing can uncomment them and run yacc or bison or whatever.
  83. - case "$d_byacc" in
  84. - 'define')
  85. -     comment1=''
  86. -     comment2='#' ;;
  87. - *)    comment1='#'
  88. -     comment2='' ;;
  89. - esac
  90. - $spitshell >>Makefile <<!GROK!THIS!
  91. - perly.h: perly.c
  92. -     @ echo Dummy dependency for dumb parallel make
  93. -     touch perly.h
  94.   
  95.   # I now supply perly.c with the kits, so the following section is
  96. ! # used only if you have byacc.
  97. ! ${comment1}perly.c:     perly.y perly.c.diff
  98. ! ${comment1}    @ echo 'Expect' 109 shift/reduce and 1 reduce/reduce conflict
  99. ! ${comment1}    \$(BYACC) -d perly.y
  100. ! ${comment1}    sh \$(shellflags) ./perly.fixer y.tab.c perly.c
  101. ! ${comment1}    mv y.tab.h perly.h
  102. ! ${comment1}    echo 'extern YYSTYPE yylval;' >>perly.h
  103. ! # This version is used if you do not have byacc.
  104. ! ${comment2}perly.c:    perly.y
  105. ! ${comment2}    touch perly.c
  106.   
  107. ! !GROK!THIS!
  108.   
  109. - $spitshell >>Makefile <<'!NO!SUBS!'
  110.   # Extensions:
  111.   # Names added to $(dynamic_ext) or $(static_ext) will automatically
  112.   # get built.  There should ordinarily be no need to change any of
  113. --- 273,302 ----
  114.   
  115.   install: all
  116.       ./perl installperl
  117.   
  118.   # I now supply perly.c with the kits, so the following section is
  119. ! # used only if you force byacc to run by saying
  120. ! #     make run_byacc
  121. ! # Since we patch up the byacc output, the perly.fixer script needs
  122. ! # to run with precisely the same version of byacc as I use.  You
  123. ! # normally shouldn't remake perly.[ch].
  124. ! run_byacc:
  125. !     @ echo 'Expect' 109 shift/reduce and 1 reduce/reduce conflict
  126. !     $(BYACC) -d perly.y
  127. !     sh $(shellflags) ./perly.fixer y.tab.c perly.c
  128. !     mv y.tab.h perly.h
  129. !     echo 'extern YYSTYPE yylval;' >>perly.h
  130. ! # We don't want to regenerate perly.c and perly.h, but they might
  131. ! # appear out-of-date after a patch is applied or a new distribution is
  132. ! # made.
  133. ! perly.c: perly.y
  134. !     - touch perly.c
  135.   
  136. ! perly.h: perly.y
  137. !     - touch perly.h
  138.   
  139.   # Extensions:
  140.   # Names added to $(dynamic_ext) or $(static_ext) will automatically
  141.   # get built.  There should ordinarily be no need to change any of
  142. ***************
  143. *** 374,382 ****
  144.   
  145.   # When done, touch perlmain.c so that it doesn't get remade each time.
  146.   depend: makedepend
  147. -     - test -f perly.h || cp /dev/null perly.h
  148.       ./makedepend
  149. -     - test -s perly.h || /bin/rm -f perly.h
  150.       - test -s perlmain.c && touch perlmain.c
  151.       cd x2p; $(MAKE) depend
  152.   
  153. --- 362,368 ----
  154. Index: x2p/Makefile.SH
  155. *** perl5.001/x2p/Makefile.SH    Sat Mar 11 14:34:07 1995
  156. --- perl5.001a/x2p/Makefile.SH    Wed Mar 15 09:03:40 1995
  157. ***************
  158. *** 17,27 ****
  159.   */*) cd `expr X$0 : 'X\(.*\)/'` ;;
  160.   esac
  161.   
  162. - : Configure sets byacc=byacc if byacc is not found.  We reset it to ''
  163. - case "$byacc" in
  164. - 'byacc') byacc='';;
  165. - esac
  166.   echo "Extracting x2p/Makefile (with variable substitutions)"
  167.   rm -f Makefile
  168.   cat >Makefile <<!GROK!THIS!
  169. --- 17,22 ----
  170. ***************
  171. *** 77,112 ****
  172.   a2p: $(obj) a2p.o
  173.       $(CC) $(LDFLAGS) $(obj) a2p.o $(libs) -o a2p
  174.   
  175. - !NO!SUBS!
  176. - : Only print out the rules for running byacc if the user _has_ byacc.
  177. - : Otherwise, comment them out.  Users who really know what they are
  178. - : doing can uncomment them and run yacc or bison or whatever.
  179. - : Configure sets byacc=byacc if byacc is not found.
  180. - case "$byacc" in
  181. - '')
  182. -     comment1='#' 
  183. -     comment2='' ;;
  184. - *)    comment1=''
  185. -     comment2='#' ;;
  186. - esac
  187. - $spitshell >>Makefile <<!GROK!THIS!
  188.   # I now supply a2p.c with the kits, so the following section is
  189. ! # commented out if you don't have byacc.
  190.   
  191. ! ${comment1}a2p.c:     a2p.y
  192. ! ${comment1}    @ echo Expect many shift/reduce and reduce/reduce conflicts
  193. ! ${comment1}    \$(BYACC) a2p.y
  194. ! ${comment1}    mv y.tab.c a2p.c
  195. ! # This version is used if you do not have byacc.
  196. ! ${comment2}a2p.c:    a2p.y
  197. ! ${comment2}    touch a2p.c
  198. ! !GROK!THIS!
  199. ! cat >>Makefile <<'!NO!SUBS!'
  200.   
  201.   a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h str.h hash.h
  202.       $(CCCMD) $(LARGE) a2p.c
  203. --- 72,90 ----
  204.   a2p: $(obj) a2p.o
  205.       $(CC) $(LDFLAGS) $(obj) a2p.o $(libs) -o a2p
  206.   
  207.   # I now supply a2p.c with the kits, so the following section is
  208. ! # used only if you force byacc to run by saying
  209. ! # make  run_byacc
  210.   
  211. ! run_byacc:
  212. !     @ echo Expect many shift/reduce and reduce/reduce conflicts
  213. !     $(BYACC) a2p.y
  214. !     mv y.tab.c a2p.c
  215. ! # We don't want to regenerate a2p.c, but it might appear out-of-date
  216. ! # after a patch is applied or a new distribution is made.
  217. ! a2p.c: a2p.y
  218. !     - touch a2p.c
  219.   
  220.   a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h str.h hash.h
  221.       $(CCCMD) $(LARGE) a2p.c
  222.  
  223. End of patch.
  224.  
  225.  
  226. Index: pp_hot.c
  227. *** perl5.001/pp_hot.c    Mon Mar  6 23:55:34 1995
  228. --- perl5.001a/pp_hot.c    Thu Mar 16 10:23:30 1995
  229. ***************
  230. *** 571,632 ****
  231.       if (delaymagic & DM_UID) {
  232.   #ifdef HAS_SETRESUID
  233.           (void)setresuid(uid,euid,(Uid_t)-1);
  234. ! #else /* not HAS_SETRESUID */
  235. ! #ifdef HAS_SETREUID
  236.           (void)setreuid(uid,euid);
  237. ! #else /* not HAS_SETREUID */
  238. ! #ifdef HAS_SETRUID
  239.           if ((delaymagic & DM_UID) == DM_RUID) {
  240.           (void)setruid(uid);
  241.           delaymagic &= ~DM_RUID;
  242.           }
  243. ! #endif /* HAS_SETRUID */
  244. ! #endif /* HAS_SETRESUID */
  245. ! #ifdef HAS_SETEUID
  246.           if ((delaymagic & DM_UID) == DM_EUID) {
  247.           (void)seteuid(uid);
  248.           delaymagic &= ~DM_EUID;
  249.           }
  250. ! #endif /* HAS_SETEUID */
  251.           if (delaymagic & DM_UID) {
  252.           if (uid != euid)
  253.               DIE("No setreuid available");
  254.           (void)setuid(uid);
  255.           }
  256. ! #endif /* not HAS_SETREUID */
  257.           uid = (int)getuid();
  258.           euid = (int)geteuid();
  259.       }
  260.       if (delaymagic & DM_GID) {
  261.   #ifdef HAS_SETRESGID
  262.           (void)setresgid(gid,egid,(Gid_t)-1);
  263. ! #else /* not HAS_SETREGID */
  264. ! #ifdef HAS_SETREGID
  265.           (void)setregid(gid,egid);
  266. ! #else /* not HAS_SETREGID */
  267. ! #endif /* not HAS_SETRESGID */
  268. ! #ifdef HAS_SETRGID
  269.           if ((delaymagic & DM_GID) == DM_RGID) {
  270.           (void)setrgid(gid);
  271.           delaymagic &= ~DM_RGID;
  272.           }
  273. ! #endif /* HAS_SETRGID */
  274. ! #ifdef HAS_SETRESGID
  275. !         (void)setresgid(gid,egid,(Gid_t)-1);
  276. ! #else /* not HAS_SETREGID */
  277. ! #ifdef HAS_SETEGID
  278.           if ((delaymagic & DM_GID) == DM_EGID) {
  279.           (void)setegid(gid);
  280.           delaymagic &= ~DM_EGID;
  281.           }
  282. ! #endif /* HAS_SETEGID */
  283.           if (delaymagic & DM_GID) {
  284.           if (gid != egid)
  285.               DIE("No setregid available");
  286.           (void)setgid(gid);
  287.           }
  288. ! #endif /* not HAS_SETRESGID */
  289. ! #endif /* not HAS_SETREGID */
  290.           gid = (int)getgid();
  291.           egid = (int)getegid();
  292.       }
  293. --- 571,628 ----
  294.       if (delaymagic & DM_UID) {
  295.   #ifdef HAS_SETRESUID
  296.           (void)setresuid(uid,euid,(Uid_t)-1);
  297. ! #else
  298. ! #  ifdef HAS_SETREUID
  299.           (void)setreuid(uid,euid);
  300. ! #  else
  301. ! #    ifdef HAS_SETRUID
  302.           if ((delaymagic & DM_UID) == DM_RUID) {
  303.           (void)setruid(uid);
  304.           delaymagic &= ~DM_RUID;
  305.           }
  306. ! #    endif /* HAS_SETRUID */
  307. ! #    ifdef HAS_SETEUID
  308.           if ((delaymagic & DM_UID) == DM_EUID) {
  309.           (void)seteuid(uid);
  310.           delaymagic &= ~DM_EUID;
  311.           }
  312. ! #    endif /* HAS_SETEUID */
  313.           if (delaymagic & DM_UID) {
  314.           if (uid != euid)
  315.               DIE("No setreuid available");
  316.           (void)setuid(uid);
  317.           }
  318. ! #  endif /* HAS_SETREUID */
  319. ! #endif /* HAS_SETRESUID */
  320.           uid = (int)getuid();
  321.           euid = (int)geteuid();
  322.       }
  323.       if (delaymagic & DM_GID) {
  324.   #ifdef HAS_SETRESGID
  325.           (void)setresgid(gid,egid,(Gid_t)-1);
  326. ! #else
  327. ! #  ifdef HAS_SETREGID
  328.           (void)setregid(gid,egid);
  329. ! #  else
  330. ! #    ifdef HAS_SETRGID
  331.           if ((delaymagic & DM_GID) == DM_RGID) {
  332.           (void)setrgid(gid);
  333.           delaymagic &= ~DM_RGID;
  334.           }
  335. ! #    endif /* HAS_SETRGID */
  336. ! #    ifdef HAS_SETEGID
  337.           if ((delaymagic & DM_GID) == DM_EGID) {
  338.           (void)setegid(gid);
  339.           delaymagic &= ~DM_EGID;
  340.           }
  341. ! #    endif /* HAS_SETEGID */
  342.           if (delaymagic & DM_GID) {
  343.           if (gid != egid)
  344.               DIE("No setregid available");
  345.           (void)setgid(gid);
  346.           }
  347. ! #  endif /* HAS_SETREGID */
  348. ! #endif /* HAS_SETRESGID */
  349.           gid = (int)getgid();
  350.           egid = (int)getegid();
  351.       }
  352.  
  353. End of patch.
  354. Index: x2p/walk.c
  355. *** perl5.001a/x2p/walk.c    Tue Mar  7 11:52:33 1995
  356. --- perl5.001b/x2p/walk.c    Fri Mar 31 13:56:10 1995
  357. ***************
  358. *** 12,23 ****
  359.   #include "a2p.h"
  360.   #include "util.h"
  361.   
  362. - static void tab();
  363. - static void fixtab();
  364. - static void addsemi();
  365. - static void emit_split();
  366. - static void numericize();
  367.   bool exitval = FALSE;
  368.   bool realexit = FALSE;
  369.   bool saw_getline = FALSE;
  370. --- 12,17 ----
  371. ***************
  372. *** 32,43 ****
  373.   STR *subs;
  374.   STR *curargs = Nullstr;
  375.   
  376. ! void addsemi _(( STR *str ));
  377. ! void emit_split _(( STR *str, int level ));
  378. ! void fixtab _(( STR *str, int lvl ));
  379. ! void numericize _(( int node ));
  380.   int prewalk _(( int numit, int level, int node, int *numericptr ));
  381. - void tab _(( STR *str, int lvl ));
  382.   STR * walk _(( int useval, int level, int node, int *numericptr, int minprec ));
  383.   
  384.   
  385. --- 26,38 ----
  386.   STR *subs;
  387.   STR *curargs = Nullstr;
  388.   
  389. ! static void addsemi _(( STR *str ));
  390. ! static void emit_split _(( STR *str, int level ));
  391. ! static void fixtab _(( STR *str, int lvl ));
  392. ! static void numericize _(( int node ));
  393. ! static void tab _(( STR *str, int lvl ));
  394.   int prewalk _(( int numit, int level, int node, int *numericptr ));
  395.   STR * walk _(( int useval, int level, int node, int *numericptr, int minprec ));
  396.   
  397.   
  398. ***************
  399. *** 1606,1612 ****
  400.       str_cat(str,";");
  401.   }
  402.   
  403. ! void
  404.   emit_split(str,level)
  405.   register STR *str;
  406.   int level;
  407. --- 1601,1607 ----
  408.       str_cat(str,";");
  409.   }
  410.   
  411. ! static void
  412.   emit_split(str,level)
  413.   register STR *str;
  414.   int level;
  415.  
  416.  
  417. End of patch.
  418.