The patch attached here attempts to make configure.com run nicely in
batch mode. It addresses the following problems I encountered when I
tried that:
1.) I don't know if there is any perfect way to get the name of a
batch job's log file, but what we had was guaranteed to return an
empty string, which it was then using to open a new version of the
file. What I replaced it with worked fine in my tests.
2.) A batch job seems to have about half a dozen files open at the
beginning that it doesn't have open at the end. I don't know if
there are channels open on the queue or queue manager that get
deassigned at some point or what, but the attempt to keep track of
what the process has open was generating a false positive when
checking for leftover open files. In any case the check for
leaking filehandles is only valid if you have more files open than
you started with, so I've changed .NE. to .GT. in these tests.
3.) Executing STOP in a command procedure bounces you back to command
level 0, thus stopping any other procedure from which configure.com
might be run. This is unlikely to be a problem interactively, but
quite likely to be a problem in batch if you do a configure, build, and
install all from one procedure.
I'd appreciate testing and/or comments before sending this along to p5p.
--- configure.com;-0 Fri Feb 9 13:03:25 2001
+++ configure.com Mon Feb 12 18:01:11 2001
@@ -362,7 +362,8 @@
$Shut_up:
$ IF F$Mode() .eqs. "BATCH"
$ THEN
-$ STDOUT = F$GetQuI("DISPLAY_JOB","LOG_SPECIFICATION",,"THIS_JOB")
+$ STDOUT = F$PARSE(F$GETQUI("DISPLAY_ENTRY", "JOB_NAME"), -
+ F$GETQUI("DISPLAY_ENTRY", "LOG_SPECIFICATION"), ".LOG")
$ WRITE SYS$OUTPUT "Warning: Executing in batch mode. To avoid
file locking conflicts,"
$ WRITE SYS$OUTPUT "output intended for SYS$OUTPUT will be sent to
a new version"
$ WRITE SYS$OUTPUT STDOUT
@@ -5937,8 +5938,8 @@
$ DEASSIGN SYS$OUTPUT
$! DEASSIGN SYS$ERROR
$ ENDIF
-$ IF F$GETJPI("","FILCNT").NE.vms_filcnt THEN CLOSE CONFIG
-$ IF F$GETJPI("","FILCNT").NE.vms_filcnt
+$ IF F$GETJPI("","FILCNT").GT.vms_filcnt THEN CLOSE CONFIG
+$ IF F$GETJPI("","FILCNT").GT.vms_filcnt
$ THEN WRITE SYS$ERROR "%Config-W-VMS, WARNING: There is a file still open"
$ ENDIF
$ dflt = F$ENVIRONMENT("DEFAULT")
@@ -5950,6 +5951,6 @@
$ DELETE/NOLOG/NOCONFIRM UU.DIR;
$ ENDIF
$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
-$ STOP
+$ IF F$MODE() .NES. "BATCH" THEN STOP ! might have parents in batch
$ EXIT
$!: End of Configure
--
_________________________________
[EMAIL PROTECTED]
"Scholarship... It's where we're nearest to our humanness.
Useless knowledge for its own sake. Useful knowledge is
good too, but it's for the faint-hearted."
Housman, in Tom Stoppard's The Invention of Love