home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume20 / oraperl / patch01 next >
Encoding:
Text File  |  1991-07-17  |  12.7 KB  |  392 lines

  1. Newsgroups: comp.sources.misc
  2. From: Kevin Stock <kstock@isfrance.encore.fr>
  3. Subject:  v20i097:  oraperl - Extensions to Perl to access Oracle databases, Patch01
  4. Message-ID: <1991Jul16.013851.22199@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 6c5957f6daffe9c75564a59521780b78
  6. Date: Tue, 16 Jul 1991 01:38:51 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Kevin Stock <kstock@gouldfr.encore.fr>
  10. Posting-number: Volume 20, Issue 97
  11. Archive-name: oraperl/patch01
  12. Patch-To: oraperl: Volume 18, Issue 10
  13.  
  14. This is a minor patch to Oraperl.
  15.  
  16. Oraperl is a set of usersubs for Perl which allow scripts to access Oracle 
  17. databases. You need Perl v3.0.27 or later and Oracle Pro*C to build it.
  18. Oraperl appeared in comp.sources.misc in April 1991 (v18i010).
  19.  
  20. This very minor patch does the following:
  21.  
  22.     Fixes a bug in Makefile - $(LIBS) was not used
  23.     Adds the file Oracle-v5 - hints for building under Oracle v5
  24.     Changes copyright notices to allow copying under the Artistic License
  25.     Adds network addresses to the manual pages
  26.     Adds a PATCHLEVEL file
  27.     No functional changes
  28.  
  29. To apply, please unshar this message, which will create the files CHANGES,
  30. Oracle-v5, PATCHLEVEL and Patch01. Then feed Patch01 into the patch program.
  31. If you already have a working Oraperl, no recompilation is necessary, though
  32. if your Oracle is version 5 or earlier, you might want to take a look at
  33. the file Oracle-v5.
  34.  
  35.     Kevin
  36.  
  37. #!/bin/sh
  38. # This is a shell archive (produced by shar 3.49)
  39. # To extract the files from this archive, save it to a file, remove
  40. # everything above the "!/bin/sh" line above, and type "sh file_name".
  41. #
  42. # made 06/10/1991 13:59 UTC by kstock@mmcompta
  43. # Source directory /usr/local/src/cmd/oraperl
  44. #
  45. # existing files will NOT be overwritten unless -c is specified
  46. #
  47. # This shar contains:
  48. # length  mode       name
  49. # ------ ---------- ------------------------------------------
  50. #    324 -rw-r--r-- CHANGES
  51. #   1598 -rw-r--r-- Oracle-v5
  52. #      2 -rw-r--r-- PATCHLEVEL
  53. #   7026 -rw-r--r-- Patch01
  54. #
  55. # ============= CHANGES ==============
  56. if test -f 'CHANGES' -a X"$1" != X"-c"; then
  57.     echo 'x - skipping CHANGES (File already exists)'
  58. else
  59. echo 'x - extracting CHANGES (Text)'
  60. sed 's/^X//' << 'SHAR_EOF' > 'CHANGES' &&
  61. Changes to the Oraperl package.
  62. X
  63. Patch 01
  64. ========
  65. Fixed a bug in Makefile - $(LIBS) was not used
  66. Added the file Oracle-v5 - hints for building under Oracle v5
  67. Changed copyright notices to allow copying under Larry's Artistic License
  68. Added network addresses to the manual pages
  69. Added a PATCHLEVEL file
  70. No functional changes
  71. SHAR_EOF
  72. chmod 0644 CHANGES ||
  73. echo 'restore of CHANGES failed'
  74. Wc_c="`wc -c < 'CHANGES'`"
  75. test 324 -eq "$Wc_c" ||
  76.     echo 'CHANGES: original size 324, current size' "$Wc_c"
  77. fi
  78. # ============= Oracle-v5 ==============
  79. if test -f 'Oracle-v5' -a X"$1" != X"-c"; then
  80.     echo 'x - skipping Oracle-v5 (File already exists)'
  81. else
  82. echo 'x - extracting Oracle-v5 (Text)'
  83. sed 's/^X//' << 'SHAR_EOF' > 'Oracle-v5' &&
  84. The Makefile includes library definitions which are suitable for Oracle v6
  85. on an Encore Multimax running UMAX V. I do not have access to any other
  86. configuration to test Oraperl.
  87. X
  88. Oraperl just links to the Oracle Pro*C libraries in the same way as any
  89. other Pro*C program, so give it the same libraries as you would give one
  90. of your own programs. See your Pro*C manual or example programs for details.
  91. X
  92. However, two people sent me their modified Makefiles for Oracle v5. Since
  93. they are different in effect, not only in presentation, I assume that the
  94. directory structure of Oracle varies between systems. The two setups I was
  95. sent are reproduced below. Maybe one of them will be suitable for your
  96. system if mine isn't.
  97. X
  98. First method - this assumes that the libraries live under $ORACLE_HOME/c/libs
  99. and $ORACLE_HOME/rdbms/libs, as well as requiring an additional .o file.
  100. X
  101. > ORALIBS    = -locic -loracle -lupi -losd -losn -loracle \
  102. >    $(ORACLE_HOME)/rdbms/libs/osntab.o -lutt -losd -losn -lclib0
  103. >
  104. > LDFLAGS    = -L$(ORACLE_HOME)/c/libs -L$(ORACLE_HOME)/rdbms/libs
  105. >
  106. > oraperl: $(SRC)/uperl.o usersub.o oracle.o orafns.o getcursor.o
  107. >     $(CC) -o oraperl $(LDFLAGS) $(SRC)/uperl.o usersub.o oracle.o orafns.o \
  108. >         getcursor.o $(ORALIBS) $(LIBS)
  109. X
  110. Second method - much simpler. Only seems to require the first two libraries
  111. (libocic and liboracle) of the previous method, but this time they live under
  112. $ORACLE_HOME/pro.
  113. X
  114. > OTHERLIBS    =
  115. > CLIBS        = $(OTHERLIBS)
  116. > OCILIB    = $(ORACLE_HOME)/pro/libocic.a
  117. > NETLIBS    =
  118. > ORALIBS    = $(ORACLE_HOME)/pro/liboracle.a
  119. X
  120. Thanks to Mark Adams and Norman Frech for their help.
  121. SHAR_EOF
  122. chmod 0644 Oracle-v5 ||
  123. echo 'restore of Oracle-v5 failed'
  124. Wc_c="`wc -c < 'Oracle-v5'`"
  125. test 1598 -eq "$Wc_c" ||
  126.     echo 'Oracle-v5: original size 1598, current size' "$Wc_c"
  127. fi
  128. # ============= PATCHLEVEL ==============
  129. if test -f 'PATCHLEVEL' -a X"$1" != X"-c"; then
  130.     echo 'x - skipping PATCHLEVEL (File already exists)'
  131. else
  132. echo 'x - extracting PATCHLEVEL (Text)'
  133. sed 's/^X//' << 'SHAR_EOF' > 'PATCHLEVEL' &&
  134. 1
  135. SHAR_EOF
  136. chmod 0644 PATCHLEVEL ||
  137. echo 'restore of PATCHLEVEL failed'
  138. Wc_c="`wc -c < 'PATCHLEVEL'`"
  139. test 2 -eq "$Wc_c" ||
  140.     echo 'PATCHLEVEL: original size 2, current size' "$Wc_c"
  141. fi
  142. # ============= Patch01 ==============
  143. if test -f 'Patch01' -a X"$1" != X"-c"; then
  144.     echo 'x - skipping Patch01 (File already exists)'
  145. else
  146. echo 'x - extracting Patch01 (Text)'
  147. sed 's/^X//' << 'SHAR_EOF' > 'Patch01' &&
  148. *** OLD/Makefile    Mon Jun 10 15:55:56 1991
  149. --- ./Makefile    Mon Jun 10 12:15:55 1991
  150. ***************
  151. *** 3,9 ****
  152. X  # Change these to your ORACLE installation directory and Perl source directory
  153. X  
  154. X  ORACLE_HOME    = /usr/soft/oracle
  155. ! SRC        = /usr/soft/public/perl4/src
  156. X  
  157. X  # Oracle Definitions, taken from proc.mk
  158. X  
  159. --- 3,9 ----
  160. X  # Change these to your ORACLE installation directory and Perl source directory
  161. X  
  162. X  ORACLE_HOME    = /usr/soft/oracle
  163. ! SRC        = /usr/soft/public/perl_4.0.09
  164. X  
  165. X  # Oracle Definitions, taken from proc.mk
  166. X  
  167. ***************
  168. *** 18,24 ****
  169. X  
  170. X  GLOBINCS    = 
  171. X  LOCINCS        = 
  172. ! LIBS        =
  173. X  
  174. X  # Oraperl Definitions
  175. X  
  176. --- 18,24 ----
  177. X  
  178. X  GLOBINCS    = 
  179. X  LOCINCS        = 
  180. ! LIBS        = -lnsl_s -lsocket -ldbm -lmalloc -lm 
  181. X  
  182. X  # Oraperl Definitions
  183. X  
  184. ***************
  185. *** 29,35 ****
  186. X  
  187. X  oraperl: $(SRC)/uperl.o usersub.o oracle.o orafns.o getcursor.o
  188. X      cc -o oraperl $(SRC)/uperl.o usersub.o oracle.o orafns.o getcursor.o \
  189. !         -lm $(OCILIB) $(NETLIBS) $(ORALIBS) $(CLIBS)
  190. X  
  191. X  oracle.c: $(SRC)/usub/mus oracle.mus
  192. X      $(SRC)/usub/mus oracle.mus >oracle.c
  193. --- 29,35 ----
  194. X  
  195. X  oraperl: $(SRC)/uperl.o usersub.o oracle.o orafns.o getcursor.o
  196. X      cc -o oraperl $(SRC)/uperl.o usersub.o oracle.o orafns.o getcursor.o \
  197. !         -lm $(OCILIB) $(NETLIBS) $(ORALIBS) $(CLIBS) $(LIBS)
  198. X  
  199. X  oracle.c: $(SRC)/usub/mus oracle.mus
  200. X      $(SRC)/usub/mus oracle.mus >oracle.c
  201. *** OLD/README    Mon Jun 10 15:55:55 1991
  202. --- ./README    Mon Jun 10 15:44:49 1991
  203. ***************
  204. *** 20,31 ****
  205. X              see orafns.h for an explanation
  206. X  
  207. X  If your version of Perl is earlier than v4, you will also need to make
  208. ! one change to  oracle.mus . The name  str_2mortal()  on line 100 must
  209. X  be changed to  str_2static()  with the same arguments.
  210. X  
  211. X  I've only tested this on an Encore Multimax 520 running UMAX V (Sys Vr3.2),
  212. ! using Perl 3.0.34 and 4.0.00 with Oracle version 6, as I don't have access
  213. ! to any other system with Pro*C. I'd appreciate any comments, bug-reports etc.
  214. X  
  215. X  In addition to this README, the package contains the following files:
  216. X  
  217. --- 20,32 ----
  218. X              see orafns.h for an explanation
  219. X  
  220. X  If your version of Perl is earlier than v4, you will also need to make
  221. ! one change to  oracle.mus . The name  str_2mortal()  on line 101 must
  222. X  be changed to  str_2static()  with the same arguments.
  223. X  
  224. X  I've only tested this on an Encore Multimax 520 running UMAX V (Sys Vr3.2),
  225. ! using Perl 3.0.34, 4.0.00 4.0.03 and 4.0.09 with Oracle version 6, as I don't
  226. ! have access to any other system with Pro*C. I'd appreciate any comments,
  227. ! bug-reports etc.
  228. X  
  229. X  In addition to this README, the package contains the following files:
  230. X  
  231. ***************
  232. *** 45,50 ****
  233. --- 46,52 ----
  234. X      oraperl.doc    explains some of the thinking behind Oraperl
  235. X      oraperl.ref    quick reference (troff format)
  236. X      oraperl.1    manual page
  237. +     Oracle-v5    Hints for compiling Oraperl with Oracle v5
  238. X  
  239. X  Many thanks to Larry for Perl. Now if only we could get the Camel book
  240. X  into France! Hmm. Any plans for "Le Livre Chameau"?
  241. *** OLD/getcursor.c    Mon Jun 10 15:55:58 1991
  242. --- ./getcursor.c    Mon Jun 10 15:48:32 1991
  243. ***************
  244. *** 5,11 ****
  245. X  /* Copyright 1991 Kevin Stock.
  246. X   *
  247. X   * You may copy this under the terms of the GNU General Public License,
  248. !  * a copy of which should have accompanied your Perl kit.
  249. X   */
  250. X  
  251. X  #include    "EXTERN.h"
  252. --- 5,12 ----
  253. X  /* Copyright 1991 Kevin Stock.
  254. X   *
  255. X   * You may copy this under the terms of the GNU General Public License,
  256. !  * or the Artistic License, copies of which should have accompanied your
  257. !  * Perl kit.
  258. X   */
  259. X  
  260. X  #include    "EXTERN.h"
  261. *** OLD/oracle.mus    Mon Jun 10 15:55:59 1991
  262. --- ./oracle.mus    Mon Jun 10 15:48:50 1991
  263. ***************
  264. *** 5,11 ****
  265. X  /* Copyright 1991 Kevin Stock.
  266. X   *
  267. X   * You may copy this under the terms of the GNU General Public License,
  268. !  * a copy of which should have accompanied your Perl kit.
  269. X   */
  270. X  
  271. X  #include "EXTERN.h"
  272. --- 5,12 ----
  273. X  /* Copyright 1991 Kevin Stock.
  274. X   *
  275. X   * You may copy this under the terms of the GNU General Public License,
  276. !  * or the Artistic License, copies of which should have accompanied your
  277. !  * Perl kit.
  278. X   */
  279. X  
  280. X  #include "EXTERN.h"
  281. *** OLD/orafns.c    Mon Jun 10 15:56:00 1991
  282. --- ./orafns.c    Mon Jun 10 15:48:35 1991
  283. ***************
  284. *** 5,11 ****
  285. X  /* Copyright 1991 Kevin Stock.
  286. X   *
  287. X   * You may copy this under the terms of the GNU General Public License,
  288. !  * a copy of which should have accompanied your Perl kit.
  289. X   */
  290. X  
  291. X  #include    "INTERN.h"
  292. --- 5,12 ----
  293. X  /* Copyright 1991 Kevin Stock.
  294. X   *
  295. X   * You may copy this under the terms of the GNU General Public License,
  296. !  * or the Artistic License, copies of which should have accompanied your
  297. !  * Perl kit.
  298. X   */
  299. X  
  300. X  #include    "INTERN.h"
  301. *** OLD/orafns.h    Mon Jun 10 15:56:01 1991
  302. --- ./orafns.h    Mon Jun 10 15:49:14 1991
  303. ***************
  304. *** 5,11 ****
  305. X  /* Copyright 1991 Kevin Stock.
  306. X   *
  307. X   * You may copy this under the terms of the GNU General Public License,
  308. !  * a copy of which should have accompanied your Perl kit.
  309. X   */
  310. X  
  311. X  
  312. --- 5,12 ----
  313. X  /* Copyright 1991 Kevin Stock.
  314. X   *
  315. X   * You may copy this under the terms of the GNU General Public License,
  316. !  * or the Artistic License, copies of which should have accompanied your
  317. !  * Perl kit.
  318. X   */
  319. X  
  320. X  
  321. *** OLD/oraperl.1    Mon Jun 10 15:56:02 1991
  322. --- ./oraperl.1    Mon Jun 10 15:14:35 1991
  323. ***************
  324. *** 112,118 ****
  325. X  a further variable, \fIora_debug\fP is available.
  326. X  Setting this variable sets the level of debugging required.
  327. X  If \fIPerl\fP's own runtime debugging is included,
  328. ! this variable is initialised from the \fB-D\fP option.
  329. X  It may be set from within an \fIOraperl\fP script by normal assignment.
  330. X  
  331. X  .ne 6
  332. --- 112,118 ----
  333. X  a further variable, \fIora_debug\fP is available.
  334. X  Setting this variable sets the level of debugging required.
  335. X  If \fIPerl\fP's own runtime debugging is included,
  336. ! this variable is initialised from the \fB\-D\fP option.
  337. X  It may be set from within an \fIOraperl\fP script by normal assignment.
  338. X  
  339. X  .ne 6
  340. ***************
  341. *** 148,153 ****
  342. X  .SH AUTHOR
  343. X  \fIORACLE\fP by Oracle Corporation, California.
  344. X  .br
  345. ! \fIPerl\fP by Larry Wall, Jet Propulsion Laboratory, NASA.
  346. X  .br
  347. ! \fIOraperl\fP by Kevin Stock, Encore Computer SA, France.
  348. --- 148,155 ----
  349. X  .SH AUTHOR
  350. X  \fIORACLE\fP by Oracle Corporation, California.
  351. X  .br
  352. ! \fIPerl\fP by Larry Wall, Netlabs
  353. ! (\f(CWlwall@netlabs.com\fP, \f(CWlwall@netlabs.com\fP).
  354. X  .br
  355. ! \fIOraperl\fP by Kevin Stock, Encore Computer SA, France
  356. ! (\f(CWkstock@gouldfr.encore.fr\fP).
  357. *** OLD/usersub.c    Mon Jun 10 15:56:04 1991
  358. --- ./usersub.c    Mon Jun 10 15:48:37 1991
  359. ***************
  360. *** 5,11 ****
  361. X  /* Copyright 1991 Kevin Stock.
  362. X   *
  363. X   * You may copy this under the terms of the GNU General Public License,
  364. !  * a copy of which should have accompanied your Perl kit.
  365. X   */
  366. X  
  367. X  #include "EXTERN.h"
  368. --- 5,12 ----
  369. X  /* Copyright 1991 Kevin Stock.
  370. X   *
  371. X   * You may copy this under the terms of the GNU General Public License,
  372. !  * or the Artistic License, copies of which should have accompanied your
  373. !  * Perl kit.
  374. X   */
  375. X  
  376. X  #include "EXTERN.h"
  377. SHAR_EOF
  378. chmod 0644 Patch01 ||
  379. echo 'restore of Patch01 failed'
  380. Wc_c="`wc -c < 'Patch01'`"
  381. test 7026 -eq "$Wc_c" ||
  382.     echo 'Patch01: original size 7026, current size' "$Wc_c"
  383. fi
  384. exit 0
  385.  
  386. exit 0 # Just in case...
  387. -- 
  388. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  389. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  390. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  391. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  392.