To: req@ccs.neu.edu, remy@ccs.neu.edu Subject: Re: Changes to req-1.1.beta Reply-To: "Alan K. Stebbens" In-Reply-To: Your message of Tue, 17 Jan 1995 22:57:03 PST. <9501180657.AA01190@dokoka> Date: Wed, 18 Jan 1995 08:52:23 -0800 From: Alan Stebbens I forgot to include the patches... During the night, I reintegrated most of the patches to 1.2.7; they mostly fit right in. The "mailgate" looks nice, and I'm now debating wether to keep using our procmailrc file or to switch to the Perl mailgate. My initial feeling is that the procmail-based method seems to allow a little more flexibility in how we map outgoing distributions based on the incoming target. Anyway, here are the changes to 1.1.beta; I'll be sending the changes based on 1.2.7 in a few days. +-------------------------+-----------------------------------------+ | Alan Stebbens | University of California, Santa Barbara | | Email: aks@hub.ucsb.edu | Center for Computational Sciences | | CCSE: (805) 893-3221 | & Engineering (CCSE) | | Voice: (805) 893-8135 | 3156 Engineering I | | Fax: (805) 893-8553 | Santa Barbara, CA 93106 | +-------------------------+-----------------------------------------+ ============================= cut here =================================== diff -rc req-1.1.beta/build/Makefile.def req-1.1.eci/build/Makefile.def *** req-1.1.beta/build/Makefile.def Fri Sep 23 09:48:16 1994 --- req-1.1.eci/build/Makefile.def Tue Oct 18 13:58:17 1994 *************** *** 2,37 **** # # $Id: Makefile.def,v 2.5 1994/09/23 16:34:12 remy Exp $ # SOURCES = req-nextnum.c req.c getdate.c status.c BINARIES = req-nextnum req getdate status ! SCRIPTS = req-fixsubj req-mailgate req-operation reqshow q MANPAGES = req-nextnum.1 req.1 q.1 getdate.1 status.1 reqshow.1 \ req-fixsubj.1 req-mailgate.1 ! INSTALL = install-getdate \ ! install-req-fixsubj \ ! install-req-operation \ ! install-req-mailgate \ ! install-q \ ! install-req-nextnum \ ! install-reqshow \ ! install-status \ ! install-req ! ! INSTALLMAN = install-req-nextnum-man \ ! install-req-man \ ! install-reqshow-man \ ! install-q-man \ ! install-status-man \ ! install-getdate-man \ ! install-req-fixsubj-man \ ! install-req-mailgate-man ! ! EXTRACT = ${SCRIPTS} ${SOURCES} ${MANPAGES} ! all: ${BINARIES} ${SCRIPTS} ${MANPAGES} getdate: getdate.c y.tab.c cc -O -o getdate getdate.c y.tab.c --- 2,46 ---- # # $Id: Makefile.def,v 2.5 1994/09/23 16:34:12 remy Exp $ # + SHELL = /bin/sh SOURCES = req-nextnum.c req.c getdate.c status.c BINARIES = req-nextnum req getdate status ! SCRIPTS = req-fixsubj req-mailgate req-operation reqshow q request.rc ! PERLLIBS = match_users.pl MANPAGES = req-nextnum.1 req.1 q.1 getdate.1 status.1 reqshow.1 \ req-fixsubj.1 req-mailgate.1 ! D=@{INSTALL_MAN_DIR} ! S=@{MANSUFFIX} ! INSTALL = $(INSTALL_BIN) $(INSTALL_SCRIPTS) $(INSTALL_PERLLIBS) + INSTALL_BIN = @{INSTALL_REQ} \ + @{INSTALL_NEXTNUM} \ + @{INSTALL_STATUS} \ + @{INSTALL_GETDATE} + + INSTALL_SCRIPTS = @{INSTALL_FIXSUBJ} \ + @{INSTALL_REQOPERATION} \ + @{INSTALL_MAILGATE} \ + @{INSTALL_QUEUEPROG} \ + @{INSTALL_REQSHOW} \ + @{INSTALL_REQUESTRC} + + INSTALL_MAN = $D/@{REQ}.$S \ + $D/@{REQSHOW}.$S \ + $D/@{QUEUEPROG}.$S \ + $D/@{STATUS}.$S \ + $D/@{GETDATE}.$S \ + $D/@{NEXTNUM}.$S \ + $D/@{FIXSUBJ}.$S \ + $D/@{MAILGATE}.$S + + EXTRACT = ${SCRIPTS} ${SOURCES} ${MANPAGES} ${PERLLIBS} + + all: ${BINARIES} ${SCRIPTS} ${PERLLIBS} ${MANPAGES} + getdate: getdate.c y.tab.c cc -O -o getdate getdate.c y.tab.c *************** *** 47,56 **** extract: ${EXTRACT} ! ${EXTRACT}: ../src/$$@ ../defs ../extract -d ../defs < ../src/$@ > $@ ! Makefile: Makefile.def ../defs ../extract -d ../defs < Makefile.def > Makefile --- 56,65 ---- extract: ${EXTRACT} ! ${EXTRACT}: ../src/$$@ ../defs ../defs.local ../extract -d ../defs < ../src/$@ > $@ ! Makefile: Makefile.def ../defs ../defs.local ../extract -d ../defs < Makefile.def > Makefile *************** *** 58,173 **** # installing # ! install: ${INSTALL} ! install-req-fixsubj: req-fixsubj ! @{INSTALL} -m @{PERMS} -o @{REQUEST_USER} -g @{REQUEST_GROUP} \ ! req-fixsubj @{INSTALL_FIXSUBJ} ! ! install-req-operation: req-operation ! @{INSTALL} -m @{PERMS} -o @{REQUEST_USER} -g @{REQUEST_GROUP} \ ! req-operation @{INSTALL_REQOPERATION} ! ! install-req-mailgate: req-mailgate ! @{INSTALL} -m @{PERMS} -o @{REQUEST_USER} -g @{REQUEST_GROUP} \ ! req-mailgate @{INSTALL_MAILGATE} ! ! install-q: q ! @{INSTALL} -m @{PERMS} -o @{REQUEST_USER} -g @{REQUEST_GROUP} \ ! q @{INSTALL_QUEUEPROG} ! ! install-reqshow: reqshow ! @{INSTALL} -m @{PERMS} -o @{REQUEST_USER} -g @{REQUEST_GROUP} \ ! reqshow @{INSTALL_REQSHOW} ! ! install-req-nextnum: req-nextnum ! @{INSTALL} -s -m @{SETUID_PERMS} -o @{REQUEST_USER} -g @{REQUEST_GROUP} \ ! req-nextnum @{INSTALL_NEXTNUM} ! ! install-req: req ! @{INSTALL} -s -m @{SETUID_PERMS} -o @{REQUEST_USER} -g @{REQUEST_GROUP} \ ! req @{INSTALL_REQ} ! ! install-status: status ! @{INSTALL} -s -m @{SETUID_PERMS} -o @{REQUEST_USER} -g @{REQUEST_GROUP} \ ! status @{INSTALL_STATUS} ! ! install-getdate: getdate ! @{INSTALL} -s -m @{PERMS} -o @{REQUEST_USER} -g @{REQUEST_GROUP} \ ! getdate @{INSTALL_GETDATE} # # Man pages # ! install-man: ${INSTALLMAN} ! ! install-req-man: req.1 ! @{INSTALL} req.1 @{INSTALL_MAN_DIR}/@{REQ}.@{MANSUFFIX} ! ! install-reqshow-man: reqshow.1 ! @{INSTALL} reqshow.1 @{INSTALL_MAN_DIR}/@{REQSHOW}.@{MANSUFFIX} ! ! install-q-man: q.1 ! @{INSTALL} q.1 @{INSTALL_MAN_DIR}/@{QUEUEPROG}.@{MANSUFFIX} ! install-status-man: status.1 ! @{INSTALL} status.1 @{INSTALL_MAN_DIR}/@{STATUS}.@{MANSUFFIX} - install-getdate-man: getdate.1 - @{INSTALL} getdate.1 @{INSTALL_MAN_DIR}/@{GETDATE}.@{MANSUFFIX} - - install-req-nextnum-man: req-nextnum.1 - @{INSTALL} req-nextnum.1 @{INSTALL_MAN_DIR}/@{NEXTNUM}.@{MANSUFFIX} - - install-req-fixsubj-man: req-fixsubj.1 - @{INSTALL} req-fixsubj.1 @{INSTALL_MAN_DIR}/@{FIXSUBJ}.@{MANSUFFIX} - - install-req-mailgate-man: req-mailgate.1 - @{INSTALL} req-mailgate.1 @{INSTALL_MAN_DIR}/@{MAILGATE}.@{MANSUFFIX} - - # # Extra stuff to install # ! extras: install-currentnum ! ! install-currentnum: ! @{INSTALL} -m @{FILE_PERMS} -o @{REQUEST_USER} -g @{REQUEST_GROUP} \ ! ../etc/currentnumber @{INSTALL_CURRENTNUM} # # Make the directories # ! directories: ! -../utils/mkdirhier @{INSTALL_REQUEST_DIR} ! -chmod @{DIR_PERMS} @{INSTALL_REQUEST_DIR} ! -chgrp @{REQUEST_GROUP} @{INSTALL_REQUEST_DIR} ! -chown @{REQUEST_USER} @{INSTALL_REQUEST_DIR} ! -../utils/mkdirhier @{INSTALL_ACTIVE_DIR} ! -chmod @{DIR_PERMS} @{INSTALL_ACTIVE_DIR} ! -chgrp @{REQUEST_GROUP} @{INSTALL_ACTIVE_DIR} ! -chown @{REQUEST_USER} @{INSTALL_ACTIVE_DIR} ! -../utils/mkdirhier @{INSTALL_RESOLVED_DIR} ! -chmod @{DIR_PERMS} @{INSTALL_RESOLVED_DIR} ! -chgrp @{REQUEST_GROUP} @{INSTALL_RESOLVED_DIR} ! -chown @{REQUEST_USER} @{INSTALL_RESOLVED_DIR} ! -../utils/mkdirhier @{INSTALL_ERROR_DIR} ! -chmod @{DIR_PERMS} @{INSTALL_ERROR_DIR} ! -chgrp @{REQUEST_GROUP} @{INSTALL_ERROR_DIR} ! -chown @{REQUEST_USER} @{INSTALL_ERROR_DIR} ! -../utils/mkdirhier @{INSTALL_REQUEST_ETC_DIR} ! -chmod 775 @{INSTALL_REQUEST_ETC_DIR} ! -chgrp @{REQUEST_GROUP} @{INSTALL_REQUEST_ETC_DIR} ! -chown @{REQUEST_USER} @{INSTALL_REQUEST_ETC_DIR} ! -../utils/mkdirhier @{INSTALL_BIN_DIR} ! -../utils/mkdirhier @{INSTALL_NOBIN_DIR} ! -../utils/mkdirhier @{INSTALL_SCRIPT_DIR} ! -../utils/mkdirhier @{INSTALL_NOSCRIPT_DIR} ! -../utils/mkdirhier @{INSTALL_MAN_DIR} # =========================================================================== --- 67,193 ---- # installing # ! install: ${INSTALL} install-perllibs install-rcfiles ! ! install-bin: ${INSTALL_BIN} ! install-scripts: ${INSTALL_SCRIPTS} + install-perllibs: ${PERLLIBS} + @for lib in $? ; do \ + $(MAKE) PERMS=444 SRC=$$lib DST=@{INSTALL_NOSCRIPT_DIR}/$$lib install-a-file ; \ + done + + install-rcfiles: + @if [ "@{MAIL_DELIVERY}" = 'procmail' -a \ + "@{MAIL_HOST}" = `(uname -n || hostname)2>/dev/null` ]; then \ + if [ -d @{PROCMAIL_ETC_DIR} ]; then \ + for name in @{MAILING_LIST_NAMES} ; do \ + ${MAKE} -f Makefile.rcfile \ + NAME=$$name \ + DST=@{PROCMAIL_ETC_DIR} \ + USER=@{SENDMAIL_USER} \ + GROUP=@{REQUEST_GROUP} \ + PERMS=@{FILE_PERMS} ; \ + done ; \ + else \ + echo "** Procmail filter directory @{PROCMAIL_ETC_DIR} does not exist!" ; \ + fi ; \ + fi + + # Generic targets + + PERMS=@{FILE_PERMS} + + install-a-file:: + @$(MAKE) -f Makefile.file \ + DST=$(DST) SRC=$(SRC) PERMS=$(PERMS) OPTS=$(INSTOPTS) \ + USER=@{REQUEST_USER} GROUP=@{REQUEST_GROUP} + + # Command macros to make things easier + + INSTALL_A_BIN = @$(MAKE) SRC=$? DST=$@ INSTOPTS=-s PERMS=@{PERMS} install-a-file + INSTALL_A_EXE = @$(MAKE) SRC=$? DST=$@ INSTOPTS= PERMS=@{PERMS} install-a-file + INSTALL_A_SUID = @$(MAKE) SRC=$? DST=$@ INSTOPTS=-s PERMS=@{SETUID_PERMS} install-a-file + INSTALL_A_MAN = @$(MAKE) SRC=$? DST=$@ INSTOPTS= PERMS=444 install-a-file + INSTALL_A_FILE = @$(MAKE) SRC=$? DST=$@ INSTOPTS= PERMS=@{FILE_PERMS} install-a-file + + # These targets match the destinations against the sources, invoking + # a make command only if necessary + + @{INSTALL_NEXTNUM}: req-nextnum ; $(INSTALL_A_SUID) + @{INSTALL_REQ}: req ; $(INSTALL_A_SUID) + @{INSTALL_STATUS}: status ; $(INSTALL_A_SUID) + @{INSTALL_FIXSUBJ}: req-fixsubj ; $(INSTALL_A_EXE) + @{INSTALL_REQOPERATION}: req-operation ; $(INSTALL_A_EXE) + @{INSTALL_MAILGATE}: req-mailgate ; $(INSTALL_A_EXE) + @{INSTALL_QUEUEPROG}: q ; $(INSTALL_A_EXE) + @{INSTALL_REQSHOW}: reqshow ; $(INSTALL_A_EXE) + @{INSTALL_GETDATE}: getdate ; $(INSTALL_A_BIN) + @{INSTALL_REQUESTRC}: requestrc ; $(INSTALL_A_FILE) + # # Man pages # ! install-man: ${INSTALL_MAN} ! $D/@{REQ}.$S: req.1 ; $(INSTALL_A_MAN) ! $D/@{REQSHOW}.$S: reqshow.1 ; $(INSTALL_A_MAN) ! $D/@{QUEUEPROG}.$S: q.1 ; $(INSTALL_A_MAN) ! $D/@{STATUS}.$S: status.1 ; $(INSTALL_A_MAN) ! $D/@{GETDATE}.$S: getdate.1 ; $(INSTALL_A_MAN) ! $D/@{NEXTNUM}.$S: req-nextnum.1 ; $(INSTALL_A_MAN) ! $D/@{FIXSUBJ}.$S: req-fixsubj.1 ; $(INSTALL_A_MAN) ! $D/@{MAILGATE}.$S: req-mailgate.1 ; $(INSTALL_A_MAN) # # Extra stuff to install # ! extras: install-currentnum install-hostlist + @{INSTALL_CURRENTNUM}: ../etc/currentnumber ; $(INSTALL_A_FILE) + @{INSTALL_HOSTLIST}: ../etc/hostlists ; $(INSTALL_A_FILE) # # Make the directories # + directories: $(ALL_DIRECTORIES) + + ALL_DIRECTORIES = $(DB_DIRECTORIES) $(BIN_DIRECTORIES) $(INSTALL_REQUEST_ETC_DIR) ! DB_DIRECTORIES = @{INSTALL_REQUEST_DIR} \ ! @{INSTALL_ACTIVE_DIR} \ ! @{INSTALL_RESOLVED_DIR} \ ! @{INSTALL_ERROR_DIR} ! ! BIN_DIRECTORIES = @{INSTALL_BIN_DIR} \ ! @{INSTALL_NOBIN_DIR} \ ! @{INSTALL_SCRIPT_DIR} \ ! @{INSTALL_NOSCRIPT_DIR} ! ! MKDIRHIER = ../utils/mkdirhier ! ! $(DB_DIRECTORIES): ! -$(MKDIRHIER) $@ ! -chmod @{DIR_PERMS} $@ ! -chown @{REQUEST_USER} $@ ! -chgrp @{REQUEST_GROUP} $@ ! ! $(BIN_DIRECTORIES): ! -$(MKDIRHIER) $@ ! -chmod 2755 $@ ! -chown @{REQUEST_USER} $@ ! -chgrp @{REQUEST_GROUP} $@ ! ! ! # Special case dir ! @{INSTALL_REQUEST_ETC_DIR}: ! -$(MKDIRHIER) $@ ! -chmod 775 $@ ! -chown ${REQUEST_USER} $@ ! -chgrp ${REQUEST_GROUP} $@ # =========================================================================== *************** *** 175,181 **** # tidy: ! rm -f *~ \#*\# *.o clean: tidy ! rm -f ${SOURCES} ${BINARIES} ${SCRIPTS} ${MANPAGES} y.tab.c getdate.y --- 195,201 ---- # tidy: ! -rm -f *~ \#*\# *.o clean: tidy ! -rm -f ${SOURCES} ${BINARIES} ${SCRIPTS} ${MANPAGES} y.tab.c getdate.y diff -rc req-1.1.beta/build/Makefile.file req-1.1.eci/build/Makefile.file *** req-1.1.beta/build/Makefile.file Tue Jan 17 22:16:20 1995 --- req-1.1.eci/build/Makefile.file Tue Oct 18 13:56:56 1994 *************** *** 0 **** --- 1,15 ---- + # Makefile subroutine + + DST=phony + SRC=phony + PERMS=755 + OPTS=-c + USER=bin + GROUP=bin + + $(DST): $(SRC) + cp $? $@ + -if [ "$(OPTS)" = '-s' ]; then strip $@ ; fi + chown $(USER) $@ + chgrp $(GROUP) $@ + chmod $(PERMS) $@ diff -rc req-1.1.beta/build/Makefile.rcfile req-1.1.eci/build/Makefile.rcfile *** req-1.1.beta/build/Makefile.rcfile Tue Jan 17 22:16:24 1995 --- req-1.1.eci/build/Makefile.rcfile Tue Oct 18 12:43:54 1994 *************** *** 0 **** --- 1,15 ---- + # Makefile to install a procmail rcfile + # + + SRC = ../src/requestrc + DST = phony + NAME = phony + USER = request + GROUP = request + PERMS = 0644 + + $(DST)/$(NAME): $(SRC) ../defs ../defs.local + ../extract -d ../defs -DALT_MAILING_LIST_NAME=$(NAME) < $(SRC) > $@ + chown $(USER) $@ + chgrp $(GROUP) $@ + chmod $(PERMS) $@ diff -rc req-1.1.beta/configure req-1.1.eci/configure *** req-1.1.beta/configure Fri Sep 23 09:48:10 1994 --- req-1.1.eci/configure Fri Sep 30 20:14:08 1994 *************** *** 19,25 **** # Extract the definition for perl from the defs file. ! PERL=`grep "^PERL_PATH" defs` PERL=`echo "$PERL" | sed 's/[^\/]*\(\/.*\)/\1/'` echo "Using #!$PERL for perl scripts" --- 19,26 ---- # Extract the definition for perl from the defs file. ! file=defs.local ; if [ ! -f defs.local ]; then file=defs ; fi ! PERL=`grep "^PERL_PATH" $file` PERL=`echo "$PERL" | sed 's/[^\/]*\(\/.*\)/\1/'` echo "Using #!$PERL for perl scripts" diff -rc req-1.1.beta/defs.ccs req-1.1.eci/defs.ccs *** req-1.1.beta/defs.ccs Fri Sep 23 09:48:11 1994 --- req-1.1.eci/defs.ccs Fri Sep 30 20:12:05 1994 *************** *** 80,86 **** --- 80,89 ---- # DIR_PERMS = 750 + # DEFAULT_UMASK is used to provide the umask parameter for req-operation. + DEFAULT_UMASK = 007 + # =========================================================================== # System programs # =========================================================================== *************** *** 121,126 **** --- 124,136 ---- # Mailing list configuration # =========================================================================== + # DOMAIN_NAME + # A regexp which matches the DNS domain in which the "local" users of + # the "req" system live. Used in the fuzzy user address matching, and + # the default tagline patterns. + + DOMAIN_NAME = DOMAIN.COM + # MAILING_LIST is a perl regular expression matching the names of the # mailing list(s) that should get request numbers imbedded in their # subject lines. *************** *** 140,151 **** # MAILING_LIST_DIST is the name of the mailing list to pass the modified ! # mail on to. # # For example, our request mail goes to "systems", and then gets passed # on to the people on the list via "systems-dist". # ! MAILING_LIST_DIST = systems-dist # TAGLINE_PRINTF is a printf-style string that will be imbedded on the --- 150,182 ---- # MAILING_LIST_DIST is the name of the mailing list to pass the modified ! # mail on to. It can be any valid "sh" expression. # # For example, our request mail goes to "systems", and then gets passed # on to the people on the list via "systems-dist". # ! # If you wish to have separate distributions for each mail alias, use ! # the following expression: ! # ! # MAILING_LIST_DIST = ${1-@{MAILING_LIST_NAME}}-dist ! # ! # This says the outgoing distribution list will be the first argument ! # with the string "-dist" appended. If no argument is given, the ! # default name of @{MAILING_LIST_NAME} will be used instead. ! # ! # Be sure that the alias name appears in the MAILING_LIST regexp or the ! # filter will not track the request. ! # ! # Examples: ! # ! # The distribution list will be "request-dist": ! # request: "|/usr/local/etc/req-mailgate" ! # ! # The distribution list will be "help-dist": ! # help: "|/usr/local/etc/req-mailgate help" ! # ! # ! MAILING_LIST_DIST = ${1-@{MAILING_LIST_NAME}}-dist # TAGLINE_PRINTF is a printf-style string that will be imbedded on the *************** *** 165,171 **** # Otherwise, nasty mail collisions can happen if you send mail to someone # else using req too... # ! TAGLINE_PRINTF = [Req #%s] %s # PERL_TAGLINE_COMPARE is a perl regular expression that will match the --- 196,206 ---- # Otherwise, nasty mail collisions can happen if you send mail to someone # else using req too... # ! # The default tagline will include your DOMAIN_NAME, so collisions should ! # be avoided (unless two or more distinct implementations of "req" are being ! # run in the same domain -- in this case, you must choose a distinct name). ! # ! TAGLINE_PRINTF = [@{DOMAIN_NAME} #%s] %s # PERL_TAGLINE_COMPARE is a perl regular expression that will match the *************** *** 179,191 **** # # SED_TAGLINE_COMPARE is the same thing only for sed. # ! PERL_TAGLINE_COMPARE = \[Req\s*#(\d+)\] ! SED_TAGLINE_COMPARE = \[Req.*#.*\] # DEFAULT_PRIORITY - # Included for future expansion... don't modify yet. # DEFAULT_PRIORITY = normal --- 214,229 ---- # # SED_TAGLINE_COMPARE is the same thing only for sed. # ! PERL_TAGLINE_COMPARE = \[@{DOMAIN_NAME}\s*#(\d+)\] ! SED_TAGLINE_COMPARE = \[@{DOMAIN_NAME} *#[0-9][0-9]*\] # DEFAULT_PRIORITY # + # The choices currently implemented are: + # + # critical, high, normal, low, none (fyi: none eq '') + # DEFAULT_PRIORITY = normal *************** *** 200,219 **** # # The only ones that you'll call by hand, most likely, will be: # req ! # q # NEXTNUM = nextnum REQ = req REQSHOW = reqshow ! STATUS = status GETDATE = getdate FIXSUBJ = req-fixsubj REQOPERATION = req-operation MAILGATE = req-mailgate ! QUEUEPROG = q CURRENTNUM = currentnumber KILLLOG = kill-log # MANSUFFIX # This is the suffix you want on the end of the installed manual pages. --- 238,259 ---- # # The only ones that you'll call by hand, most likely, will be: # req ! # rq ! # rs # NEXTNUM = nextnum REQ = req REQSHOW = reqshow ! STATUS = rs GETDATE = getdate FIXSUBJ = req-fixsubj REQOPERATION = req-operation MAILGATE = req-mailgate ! QUEUEPROG = rq CURRENTNUM = currentnumber KILLLOG = kill-log + HOSTLIST = hostlist # MANSUFFIX # This is the suffix you want on the end of the installed manual pages. *************** *** 243,250 **** # location for perl or sh scripts that is mounted on many different types # of architectures. If you don't have this distinction, just set the # *_SCRIPT_* directoriest o the same think as the *_BIN_* dirs. ! CODE_REQUEST_DIR = /ccs/adm/request CODE_ACTIVE_DIR = @{CODE_REQUEST_DIR}/active CODE_RESOLVED_DIR = @{CODE_REQUEST_DIR}/resolved CODE_ERROR_DIR = @{CODE_REQUEST_DIR}/errors --- 283,298 ---- # location for perl or sh scripts that is mounted on many different types # of architectures. If you don't have this distinction, just set the # *_SCRIPT_* directoriest o the same think as the *_BIN_* dirs. + # + # The paths currently include "req"s version number, so that you can install + # newer versions without stepping on the existing implementation. Typical + # installations use a symbolic link from a non-version name to the current + # working version. + From ???@??? Wed Jan 18 23:28:20 1995 Received: from hub.ucsb.edu (hub.ucsb.edu [128.111.24.40]) by amber.ccs.neu.edu (8.6.8/8.6.4) with SMTP id LAA01462; Wed, 18 Jan 1995 11:51:08 -0500 Received: from dokoka (dokoka.ucsb.edu) by hub.ucsb.edu; id AA07822 sendmail 4.1/UCSB-2.1-sun Wed, 18 Jan 95 08:51:00 PST for req@ccs.neu.edu Received: from localhost.ucsb.edu by dokoka via SMTP (931110.SGI/920502.SGI.v2) for @hub.ucsb.edu:remy@ccs.neu.edu id AA02503; Wed, 18 Jan 95 08:52:24 -0800 Message-Id: <9501181652.AA02503@dokoka> To: req@ccs.neu.edu, remy@ccs.neu.edu Subject: Re: Changes to req-1.1.beta Reply-To: "Alan K. Stebbens" In-Reply-To: Your message of Tue, 17 Jan 1995 22:57:03 PST. <9501180657.AA01190@dokoka> Date: Wed, 18 Jan 1995 08:52:23 -0800 From: Alan Stebbens + REQ_VER = 1.1 + REQ_NAME = req-@{REQ_VER} ! CODE_REQUEST_DIR = /ccs/adm/@{REQ_NAME} CODE_ACTIVE_DIR = @{CODE_REQUEST_DIR}/active CODE_RESOLVED_DIR = @{CODE_REQUEST_DIR}/resolved CODE_ERROR_DIR = @{CODE_REQUEST_DIR}/errors *************** *** 253,274 **** CODE_CURRENTNUM = @{CODE_REQUEST_ETC_DIR}/@{CURRENTNUM} CODE_KILLLOG = @{CODE_REQUEST_ETC_DIR}/@{KILLLOG} ! CODE_BIN_DIR = /local/adm/apps/req-1.0/bin CODE_REQ = @{CODE_BIN_DIR}/@{REQ} CODE_STATUS = @{CODE_BIN_DIR}/@{STATUS} ! CODE_NOBIN_DIR = /local/adm/apps/req-1.0/etc CODE_NEXTNUM = @{CODE_NOBIN_DIR}/@{NEXTNUM} CODE_GETDATE = @{CODE_NOBIN_DIR}/@{GETDATE} ! CODE_SCRIPT_DIR = /ccs/adm/apps/req-1.0/bin CODE_QUEUEPROG = @{CODE_SCRIPT_DIR}/@{QUEUEPROG} CODE_REQSHOW = @{CODE_SCRIPT_DIR}/@{REQSHOW} ! CODE_NOSCRIPT_DIR = /ccs/adm/apps/req-1.0/etc CODE_FIXSUBJ = @{CODE_NOSCRIPT_DIR}/@{FIXSUBJ} CODE_REQOPERATION = @{CODE_NOSCRIPT_DIR}/@{REQOPERATION} CODE_MAILGATE = @{CODE_NOSCRIPT_DIR}/@{MAILGATE} # =========================================================================== --- 301,323 ---- CODE_CURRENTNUM = @{CODE_REQUEST_ETC_DIR}/@{CURRENTNUM} CODE_KILLLOG = @{CODE_REQUEST_ETC_DIR}/@{KILLLOG} ! CODE_BIN_DIR = /local/adm/apps/@{REQ_NAME}/bin CODE_REQ = @{CODE_BIN_DIR}/@{REQ} CODE_STATUS = @{CODE_BIN_DIR}/@{STATUS} ! CODE_NOBIN_DIR = /local/adm/apps/@{REQ_NAME}/etc CODE_NEXTNUM = @{CODE_NOBIN_DIR}/@{NEXTNUM} CODE_GETDATE = @{CODE_NOBIN_DIR}/@{GETDATE} ! CODE_SCRIPT_DIR = /ccs/adm/apps/@{REQ_NAME}bin CODE_QUEUEPROG = @{CODE_SCRIPT_DIR}/@{QUEUEPROG} CODE_REQSHOW = @{CODE_SCRIPT_DIR}/@{REQSHOW} ! CODE_NOSCRIPT_DIR = /ccs/adm/apps/@{REQ_NAME}/etc CODE_FIXSUBJ = @{CODE_NOSCRIPT_DIR}/@{FIXSUBJ} CODE_REQOPERATION = @{CODE_NOSCRIPT_DIR}/@{REQOPERATION} CODE_MAILGATE = @{CODE_NOSCRIPT_DIR}/@{MAILGATE} + CODE_HOSTLIST = @{CODE_NOSCRIPT_DIR}/@{HOSTLIST} # =========================================================================== *************** *** 308,315 **** INSTALL_REQOPERATION = @{INSTALL_NOSCRIPT_DIR}/@{REQOPERATION} INSTALL_FIXSUBJ = @{INSTALL_NOSCRIPT_DIR}/@{FIXSUBJ} INSTALL_MAILGATE = @{INSTALL_NOSCRIPT_DIR}/@{MAILGATE} ! INSTALL_MAN_DIR = /local/adm/apps/req-1.0/man/man1 # =========================================================================== # Paths for the mail system --- 357,365 ---- INSTALL_REQOPERATION = @{INSTALL_NOSCRIPT_DIR}/@{REQOPERATION} INSTALL_FIXSUBJ = @{INSTALL_NOSCRIPT_DIR}/@{FIXSUBJ} INSTALL_MAILGATE = @{INSTALL_NOSCRIPT_DIR}/@{MAILGATE} + INSTALL_HOSTLIST = @{INSTALL_NOSCRIPT_DIR}/@{HOSTLIST} ! INSTALL_MAN_DIR = /local/adm/apps/@{REQ_NAME}/man/man1 # =========================================================================== # Paths for the mail system *************** *** 349,355 **** # install directories, but some don't. # ! MAIL_CODE_REQUEST_DIR = /export/request MAIL_CODE_ACTIVE_DIR = @{MAIL_CODE_REQUEST_DIR}/active MAIL_CODE_RESOLVED_DIR = @{MAIL_CODE_REQUEST_DIR}/resolved MAIL_CODE_ERROR_DIR = @{MAIL_CODE_REQUEST_DIR}/errors --- 399,405 ---- # install directories, but some don't. # ! MAIL_CODE_REQUEST_DIR = @{CODE_REQUEST_DIR} MAIL_CODE_ACTIVE_DIR = @{MAIL_CODE_REQUEST_DIR}/active MAIL_CODE_RESOLVED_DIR = @{MAIL_CODE_REQUEST_DIR}/resolved MAIL_CODE_ERROR_DIR = @{MAIL_CODE_REQUEST_DIR}/errors *************** *** 358,379 **** MAIL_CODE_CURRENTNUM = @{MAIL_CODE_REQUEST_ETC_DIR}/@{CURRENTNUM} MAIL_CODE_KILLLOG = @{MAIL_CODE_REQUEST_ETC_DIR}/@{KILLLOG} ! MAIL_CODE_BIN_DIR = /export/request/bin MAIL_CODE_REQ = @{MAIL_CODE_BIN_DIR}/@{REQ} MAIL_CODE_STATUS = @{MAIL_CODE_BIN_DIR}/@{STATUS} ! MAIL_CODE_NOBIN_DIR = /export/request/etc MAIL_CODE_NEXTNUM = @{MAIL_CODE_NOBIN_DIR}/@{NEXTNUM} MAIL_CODE_GETDATE = @{MAIL_CODE_NOBIN_DIR}/@{GETDATE} ! MAIL_CODE_SCRIPT_DIR = /export/request/bin MAIL_CODE_QUEUEPROG = @{MAIL_CODE_SCRIPT_DIR}/@{QUEUEPROG} MAIL_CODE_REQSHOW = @{MAIL_CODE_SCRIPT_DIR}/@{REQSHOW} ! MAIL_CODE_NOSCRIPT_DIR = /export/request/etc MAIL_CODE_FIXSUBJ = @{MAIL_CODE_NOSCRIPT_DIR}/@{FIXSUBJ} MAIL_CODE_REQOPERATION = @{MAIL_CODE_NOSCRIPT_DIR}/@{REQOPERATION} MAIL_CODE_MAILGATE = @{MAIL_CODE_NOSCRIPT_DIR}/@{MAILGATE} # =========================================================================== --- 408,430 ---- MAIL_CODE_CURRENTNUM = @{MAIL_CODE_REQUEST_ETC_DIR}/@{CURRENTNUM} MAIL_CODE_KILLLOG = @{MAIL_CODE_REQUEST_ETC_DIR}/@{KILLLOG} ! MAIL_CODE_BIN_DIR = @{CODE_BIN_DIR} MAIL_CODE_REQ = @{MAIL_CODE_BIN_DIR}/@{REQ} MAIL_CODE_STATUS = @{MAIL_CODE_BIN_DIR}/@{STATUS} ! MAIL_CODE_NOBIN_DIR = @{CODE_NOBIN_DIR} MAIL_CODE_NEXTNUM = @{MAIL_CODE_NOBIN_DIR}/@{NEXTNUM} MAIL_CODE_GETDATE = @{MAIL_CODE_NOBIN_DIR}/@{GETDATE} ! MAIL_CODE_SCRIPT_DIR = @{CODE_SCRIPT_DIR} MAIL_CODE_QUEUEPROG = @{MAIL_CODE_SCRIPT_DIR}/@{QUEUEPROG} MAIL_CODE_REQSHOW = @{MAIL_CODE_SCRIPT_DIR}/@{REQSHOW} ! MAIL_CODE_NOSCRIPT_DIR = @{CODE_NOSCRIPT_DIR} MAIL_CODE_FIXSUBJ = @{MAIL_CODE_NOSCRIPT_DIR}/@{FIXSUBJ} MAIL_CODE_REQOPERATION = @{MAIL_CODE_NOSCRIPT_DIR}/@{REQOPERATION} MAIL_CODE_MAILGATE = @{MAIL_CODE_NOSCRIPT_DIR}/@{MAILGATE} + MAIL_CODE_HOSTLIST = @{MAIL_CODE_NOSCRIPT_DIR}/@{HOSTLIST} # =========================================================================== *************** *** 409,414 **** --- 460,466 ---- MAIL_INSTALL_REQOPERATION = @{MAIL_INSTALL_NOSCRIPT_DIR}/@{REQOPERATION} MAIL_INSTALL_FIXSUBJ = @{MAIL_INSTALL_NOSCRIPT_DIR}/@{FIXSUBJ} MAIL_INSTALL_MAILGATE = @{MAIL_INSTALL_NOSCRIPT_DIR}/@{MAILGATE} + MAIL_INSTALL_HOSTLIST = @{MAIL_INSTALL_NOSCRIPT_DIR}/@{HOSTLIST} # =========================================================================== diff -rc req-1.1.beta/extract req-1.1.eci/extract *** req-1.1.beta/extract Mon Oct 17 18:19:32 1994 --- req-1.1.eci/extract Tue Oct 18 13:59:52 1994 *************** *** 1,4 **** ! #! #!/local/bin/perl # # $Id: extract,v 2.1 1994/09/22 21:21:33 remy Exp $ --- 1,4 ---- ! #!/eci/bin/perl #!/local/bin/perl # # $Id: extract,v 2.1 1994/09/22 21:21:33 remy Exp $ *************** *** 16,54 **** # A copy of the license may be found in docs/license of the source # distribution. ! if($ARGV[0] eq "-d") { ! $def_file = $ARGV[1]; ! shift; shift; ! } else { ! $def_file = "./defs"; ! } ! ! open(DEFS, $def_file) || die "Unable to open $def_file file"; ! ! while() { ! chop; ! next if(/^#/); ! next if(/^\s*$/); ! ! if(/^\s*(\w+)\s*=\s*(.*)\s*$/) { ! $lv=$1; $rv=$2; ! if($def{$lv}) { ! print "Definition for $lv ($rv) on line $. overrides previous value ", ! "$def{$lv}\n"; } ! while($rv =~ /@\{(\w+)\}/) { ! $sub = $def{$1}; ! $rv =~ s/@\{\w+\}/$sub/; } - $def{$lv} = $rv; } } ! close(DEFS); ! if($ARGV[0] eq "-DBUILD_FOR_MAIL") { ! shift; foreach $k (keys(%def)) { if($def{"MAIL_$k"}) { $def{$k} = $def{"MAIL_$k"}; --- 16,125 ---- # A copy of the license may be found in docs/license of the source # distribution. + $usage = "usage: extract [-v] [-d defs].. [-Ddef[=var]].. < infile > outfile \n"; ! @def_files = (); ! ! $verbose = ''; ! ! while ($_ = shift) { ! if (/^-d/) { ! $def_file = shift || die "Missing define file after -d option!\n",$usage; ! -f $def_file || die "Definition file '$def_file' doesn't exist!\n"; ! push(@def_files,$def_file); ! ! # If there is a .local version of the same file, include it *after*. ! # This allows the local version to supercede values, without actually ! # editing the original file ! ! push(@def_files,"$def_file.local") if -f "$def_file.local"; ! ! } elsif (/^-v/) { ! $verbose++; ! } elsif (/^-D(.*)/) { ! ($var,$val) = split(/=/,$1); ! length($var) || die "Missing variable after -D option.\n",$usage; ! $def{$var} = $val || 1; ! } elsif (/^-/) { ! die "Unknown option '$_'\n",$usage; ! } else { # non-option ! unshift(@ARGV,$_); ! last; ! } ! } ! ! unless (@def_files) { ! push(@def_files, "./defs"); ! push(@def_files, "./defs.local") if -f "./defs.local"; ! } ! ! while ($def_file = shift(@def_files)) { ! open(DEFS, $def_file) || die "Unable to open $def_file file"; ! ! while() { ! chop; ! next if(/^#/); ! next if(/^\s*$/); ! ! if(/^\s*(\w+)\s*=\s*(.*)\s*$/) { ! ($lv,$rv) = ($1,$2); ! ! # It might be an error for the same symbol to be defined ! # twice in the same file, but probably not if in different ! # files. In verbose mode, show all redefines anyway ! ! if($def{$lv} && ($verbose || $def_file{$lv} eq $def_file)) { ! print STDERR "Definition for $lv ($rv) on line $. overrides previous value ", ! "$def{$lv}\n"; ! } ! ! # # This doesn't work for forward reference macros ! # # leave for the efficient substituion loop below ! # while($rv =~ /@\{(\w+)\}/) { ! # $sub = $def{$1}; ! # $rv =~ s/@\{\w+\}/$sub/; ! # } ! ! $def{$lv} = $rv; ! $def_file{$lv} = $def_file; } ! } ! close(DEFS); ! } ! ! # Rather than searching for every key in each line, we find ! # macro refs in each line, and search for a matching definition. ! # This is much more efficient. ! ! sub do_subs { ! local($_,$macro) = @_; ! while (s/\@\{(\w+)\}/\001/) { ! if ($val = $def{$key = $1}) { ! s/\001/$val/; ! } else { ! print STDERR "Reference to undefined macro '$key' "; ! if ($macro) { ! print STDERR " from macro '$macro'.\n"; ! } else { ! print STDERR "at line $.\n"; ! } ! s/\001/\@\#$key\#/; } } + $_; + } + + # Now pass through all the defines, and do the internal substitutions + + foreach $k (keys(%def)) { + $def{$k} = &do_subs($def{$k},$k); } ! # If the user defined "BUILD_FOR_MAIL", then ! # translate all MAIL_symbol macros into the corresponding ! # symbol (without the "MAIL_" prefix). ! if ($def{'BUILD_FOR_MAIL'}) { foreach $k (keys(%def)) { if($def{"MAIL_$k"}) { $def{$k} = $def{"MAIL_$k"}; *************** *** 56,69 **** } } ! @keys = keys(%def); while(<>) { ! if (/@{.*}/) { ! foreach $k (@keys) { ! $_ =~ s/@\{$k\}/$def{$k}/; ! } ! } print; } --- 127,136 ---- } } ! # Now read the file and do the substitutions while(<>) { ! $_ = &do_subs($_); print; } diff -rc req-1.1.beta/mail/Makefile.def req-1.1.eci/mail/Makefile.def *** req-1.1.beta/mail/Makefile.def Fri Sep 23 09:48:17 1994 --- req-1.1.eci/mail/Makefile.def Mon Sep 26 23:42:10 1994 *************** *** 124,130 **** # tidy: ! rm -f *~ \#*\# *.o clean: tidy ! rm -f ${SOURCES} ${BINARIES} ${SCRIPTS} y.tab.c --- 124,130 ---- # tidy: ! -rm -f *~ \#*\# *.o clean: tidy ! -rm -f ${SOURCES} ${BINARIES} ${SCRIPTS} y.tab.c diff -rc req-1.1.beta/src/getdate.c req-1.1.eci/src/getdate.c *** req-1.1.beta/src/getdate.c Fri Sep 23 09:48:20 1994 --- req-1.1.eci/src/getdate.c Tue Oct 18 10:14:19 1994 *************** *** 2,12 **** --- 2,23 ---- * getdate ascii_time ... - print the time_t of ascii_time(s) */ + #ifdef sgi + #define _POSIX_SOURCE + #endif + #if defined(__osf__) && !defined(_ANSI_C_SOURCE) + #define _ANSI_C_SOURCE + #endif + #include #include #include #include + #ifndef sgi #include + #else /* sgi */ + struct timeb { time_t time; int dstflag; long timezone, millitm; }; + #endif /* sgi */ #define DAY (24L*60L*60L) *************** *** 84,90 **** * define it or take out the ifdefs. I'll fix this in the next release... */ ! #ifdef POSIX_SOURCE extern void process(); extern int daylight; extern long timezone; --- 95,108 ---- * define it or take out the ifdefs. I'll fix this in the next release... */ ! #if defined(POSIX_SOURCE) || defined(sgi) || defined(__osf__) ! # if defined(sgi) ! # define BSD_TIME ! # endif ! # if defined(sgi) || defined(__osf__) ! # include ! # endif ! extern void process(); extern int daylight; extern long timezone; *************** *** 100,103 **** tp-> millitm = tval.tv_usec * 1000; } ! #endif --- 118,121 ---- tp-> millitm = tval.tv_usec * 1000; } ! #endif /* POSIX || __sgi || __osf__ */ diff -rc req-1.1.beta/src/getdate.y req-1.1.eci/src/getdate.y *** req-1.1.beta/src/getdate.y Fri Sep 23 09:48:20 1994 --- req-1.1.eci/src/getdate.y Tue Oct 18 10:01:17 1994 *************** *** 5,16 **** --- 5,28 ---- /* University of North Carolina at Chapel Hill */ /* @(#)getdate.y 2.13 9/16/86 */ + #ifdef sgi + #define _POSIX_SOURCE + #endif + + #if defined(__osf__) && !defined(_ANSI_C_SOURCE) + #define _ANSI_C_SOURCE + #endif + #include #include #include #include #define timezone tmzn /* ugly hack for obscure name clash */ + #ifndef sgi #include + #else /* sgi */ + struct timeb { time_t time; int dstflag; long timezone, millitm; }; + #endif /* sgi */ #define daysec (24L*60L*60L) *************** *** 113,118 **** --- 125,132 ---- extern struct tm *localtime(); + static time_t timeconv(); + static time_t dateconv(mm, dd, yy, h, m, s, mer, zone, dayflag) int mm, dd, yy, h, m, s, mer, zone, dayflag; *************** *** 119,125 **** { time_t tod, jdate; register int i; - time_t timeconv(); if (yy < 0) yy = -yy; if (yy < 100) yy += 1900; --- 133,138 ---- *************** *** 138,143 **** --- 151,157 ---- return (jdate); } + static time_t daylcorr(); static time_t dayconv(ord, day, now) int ord, day; time_t now; *************** *** 144,150 **** { register struct tm *loctime; time_t tod; - time_t daylcorr(); tod = now; loctime = localtime(&tod); --- 158,163 ---- *************** *** 169,181 **** } } static time_t monthadd(sdate, relmonth) time_t sdate, relmonth; { struct tm *ltime; - time_t dateconv(); - time_t daylcorr(); int mm, yy; if (relmonth == 0) return 0; --- 182,195 ---- } } + static time_t dateconv(); + static time_t daylcorr(); + static time_t monthadd(sdate, relmonth) time_t sdate, relmonth; { struct tm *ltime; int mm, yy; if (relmonth == 0) return 0; *************** *** 199,204 **** --- 213,220 ---- } static char *lptr; + + static lookup(); yylex() { diff -rc req-1.1.beta/src/match_users.pl req-1.1.eci/src/match_users.pl *** req-1.1.beta/src/match_users.pl Tue Jan 17 22:14:59 1995 --- req-1.1.eci/src/match_users.pl Thu Sep 29 18:28:57 1994 *************** *** 0 **** --- 1,44 ---- + # match_users.pl + # + # ============================================== + # Routines to do comparisons of users & hostnames + # ============================================== + + sub init_hostlist { + %hostlist = (); + local($_,$host); + if (open(HOSTLIST,$hostlist)) { + while () { + next if /^\#/ || /^\s*$/; + chop; + foreach $host (split(' ')) { + $hostlist{$host} = 1; + } + } + } + } + + sub match_users { + # Match two users, allowing for distinct host names + # which are equivalent (using the hostlist) + # Return 1 if they match + local($user1,$user2) = @_; + local($u1,$h1,$u2,$h2) = ($user1,'',$user2,''); + ($u1,$h1) = ($1,$2) if $user1 =~ m|(.*)\@(.*)$|; + ($u2,$h2) = ($1,$2) if $user2 =~ m|(.*)\@(.*)$|; + # The users' logins must match + $u1 eq $u2 || return ''; + # If the host parts are equal, we're done + $h1 eq $h2 && return 1; + # Ok. We must try harder to match the users addresses + # First, remove any common DOMAIN_NAME. + $h1 =~ s|\.@{DOMAIN_NAME}$||; + $h2 =~ s|\.@{DOMAIN_NAME}$||; + # Now, try to do "fuzzy" match, using the hostlist + $h1 = '' if $hostlist{$h1}; + $h2 = '' if $hostlist{$h2}; + $h1 eq $h2 && return 1; + ''; + } + + 1; diff -rc req-1.1.beta/src/q req-1.1.eci/src/q *** req-1.1.beta/src/q Fri Sep 23 09:48:18 1994 --- req-1.1.eci/src/q Thu Sep 29 18:28:36 1994 *************** *** 18,27 **** --- 18,30 ---- require "ctime.pl"; ($program = $0) =~ s:.*/::; + unshift(@INC,"@{CODE_NOSCRIPT_DIR}"); + require "match_users.pl"; $resolved_dir = "@{CODE_RESOLVED_DIR}"; $active_dir = "@{CODE_ACTIVE_DIR}"; $error_dir = "@{CODE_ERROR_DIR}"; + $hostlist = "@{CODE_HOSTLIST}"; $use_dir = $active_dir; *************** *** 32,41 **** $reverse = 0; $do_merged = 0; $prio_match = ".*"; $status_match = ".*"; - $owner_match = "^.*$"; - $owner_changed = 0; - $user_match = ".*"; $see_all = 1; $sort_by_time = 0; --- 35,43 ---- $reverse = 0; $do_merged = 0; $prio_match = ".*"; + $unowned = ''; + $user_match = ''; $status_match = ".*"; $see_all = 1; $sort_by_time = 0; *************** *** 44,49 **** --- 46,52 ---- $offset = 0; # number to print from first or last &parse_args(); + &init_hostlist; if($see_all == 0) { if(($user = (getpwuid($<))[0]) =~ /^\s*$/) { *************** *** 50,56 **** print STDERR "unable to get your login name"; exit(1); } ! $user_match = "^$user$"; $^ = statustop; $~ = status; if(($top == $bottom) != 0) { --- 53,59 ---- print STDERR "unable to get your login name"; exit(1); } ! $user_match = $user; $^ = statustop; $~ = status; if(($top == $bottom) != 0) { *************** *** 112,121 **** next if($no_low && $prio{$f} eq "low"); next if($prio{$f} !~ /$prio_match/); next if($stat{$f} !~ /$status_match/); ! next if($own{$f} !~ /$owner_match/); ! next if($req{$f} !~ /$user_match/); ! ($subject{$f} = $sub{$f}) =~ s:@{PERL_TAGLINE_COMPARE}\s*::; if($no_low) { $priosym{$f} = " "; --- 115,133 ---- next if($no_low && $prio{$f} eq "low"); next if($prio{$f} !~ /$prio_match/); next if($stat{$f} !~ /$status_match/); ! next if $unowned && $own{$f} ne ''; ! next if @owner_list && !grep(&match_users($own{$f}, $_), @owner_list); ! next if $user_match && !&match_users($req{$f}, $user_match); ! ! # if this is a local user, remove the hostname part ! ($local_user = $req{$f}) =~ s/\@.*//; ! $req{$f} = $local_user if &match_users($local_user, $req{$f}); ! ! # if the owner is local, remove the hostname part ! ($local_owner = $own{$f}) =~ s/\@.*//; ! $own{$f} = $local_owner if &match_users($local_owner, $own{$f}); ! ($subject{$f} = $sub{$f}) =~ s|@{PERL_TAGLINE_COMPARE}\s*||; if($no_low) { $priosym{$f} = " "; *************** *** 313,321 **** next; } if($ARGV[$i] =~ "^-ow") { ! $owner_match = $owner_changed ? "^$ARGV[++$i]\$|$owner_match" ! : "^$ARGV[++$i]$" ; ! $owner_changed = 1; next; } if($ARGV[$i] =~ "^-us") { --- 325,331 ---- next; } if($ARGV[$i] =~ "^-ow") { ! push(@owner_list, $ARGV[++$i]); next; } if($ARGV[$i] =~ "^-us") { *************** *** 327,335 **** next; } if($ARGV[$i] =~ "^-un") { ! $owner_match = $owner_changed ? "^\\s*\$|$owner_match" ! : "^\\s*$" ; ! $owner_changed = 1; next; } if($ARGV[$i] =~ "-res") { --- 337,343 ---- next; } if($ARGV[$i] =~ "^-un") { ! $unowned = 1; next; } if($ARGV[$i] =~ "-res") { *************** *** 384,390 **** ($active_file, $resolve_file) = &get_file_names($show); if(&active_request($active_file)) { &read_file($active_file); ! if(&get_header("x-request-user") eq $user) { open(FOO, $active_file) || die "Unable to open $active_file"; while() { print; --- 392,398 ---- ($active_file, $resolve_file) = &get_file_names($show); if(&active_request($active_file)) { &read_file($active_file); ! if(&match_users(&get_header("x-request-user"), $user)) { open(FOO, $active_file) || die "Unable to open $active_file"; while() { print; *************** *** 395,401 **** } } elsif(&resolved_request($resolved_file)) { &read_file($resolved_file); ! if(&get_header("x-request-user") eq $user) { open(FOO, $resolved_file) || die "Unable to open $resolved_file"; while() { print; --- 403,409 ---- } } elsif(&resolved_request($resolved_file)) { &read_file($resolved_file); ! if(&match_users(&get_header("x-request-user"), $user)) { open(FOO, $resolved_file) || die "Unable to open $resolved_file"; while() { print; *************** *** 430,436 **** local($file) = @_; (-f $file); } - From ???@??? Wed Jan 18 23:28:20 1995 Received: from hub.ucsb.edu (hub.ucsb.edu [128.111.24.40]) by amber.ccs.neu.edu (8.6.8/8.6.4) with SMTP id LAA01462; Wed, 18 Jan 1995 11:51:08 -0500 Received: from dokoka (dokoka.ucsb.edu) by hub.ucsb.edu; id AA07822 sendmail 4.1/UCSB-2.1-sun Wed, 18 Jan 95 08:51:00 PST for req@ccs.neu.edu Received: from localhost.ucsb.edu by dokoka via SMTP (931110.SGI/920502.SGI.v2) for @hub.ucsb.edu:remy@ccs.neu.edu id AA02503; Wed, 18 Jan 95 08:52:24 -0800 Message-Id: <9501181652.AA02503@dokoka> To: req@ccs.neu.edu, remy@ccs.neu.edu Subject: Re: Changes to req-1.1.beta Reply-To: "Alan K. Stebbens" In-Reply-To: Your message of Tue, 17 Jan 1995 22:57:03 PST. <9501180657.AA01190@dokoka> Date: Wed, 18 Jan 1995 08:52:23 -0800 From: Alan Stebbens format top = --- 438,443 ---- diff -rc req-1.1.beta/src/req-operation req-1.1.eci/src/req-operation *** req-1.1.beta/src/req-operation Fri Sep 23 09:48:19 1994 --- req-1.1.eci/src/req-operation Wed Oct 5 19:09:13 1994 *************** *** 20,29 **** require "ctime.pl"; &set_globals(); &parse_commandline(); if(!&check_permissions($caller)) { ! print "Sorry. You don't have the permissions to run this program.\n"; exit(1); } --- 20,32 ---- require "ctime.pl"; + unshift(@INC,"@{CODE_NOSCRIPT_DIR}"); + require "match_users.pl"; + &set_globals(); &parse_commandline(); if(!&check_permissions($caller)) { ! print STDERR "Sorry. You don't have the permissions to run this program.\n"; exit(1); } *************** *** 88,93 **** --- 91,98 ---- # @file_actions: A record of the actions done by the program. # @file_additions: Any new data (usually the incoming mail) to put on # the final file. + # %hostlist: a hash list of hostnames to be considered equivalent in + # matching user names. # ($program = "@{CODE_REQ}") =~ s:.*/::; *************** *** 116,125 **** --- 121,145 ---- $debug = 0; + umask(007); # default perms + @file_header = (); @file_contents = (); @file_actions = (); @file_additions = (); + + # Read in the equivalent hostnames list + %hostlist = (); + if (open(HOSTLIST,"@{CODE_HOSTLIST}")) { + while () { + next if /^\#/ || /^\s*$/; + chop; + foreach $host (split(' ')) { + $hostlist{$host} = 1; + } + } + close HOSTLIST; + } } *************** *** 285,291 **** print "Didn't find a request number in run_mail_mode.\n" if ($debug); return 0; } ! $from = &from($mail_header{"from"}); # Prepare the request file. ($active_file, $resolved_file) = &prep_file($num, $caller); --- 305,318 ---- print "Didn't find a request number in run_mail_mode.\n" if ($debug); return 0; } ! # Use the RFC823 header precedence rules: "reply-to" supercedes "from" ! # which supercedes "sender". ! $from = &from($mail_header{"reply-to"} || ! $mail_header{"from"} || ! $mail_header{"sender"}); ! ! # Use the date from the incoming mail (in case it is a "Resent" message). ! $date = &get_date_header("Date") || $date; # Prepare the request file. ($active_file, $resolved_file) = &prep_file($num, $caller); *************** *** 425,431 **** $date = &get_date_header("Date") || $date; ! $requester = &get_header("From") || $caller; ($active_file, $resolved_file, $error_file) = &get_file_names($num); print "Using $active_file, $resolved_file.\n" if ($debug); --- 452,458 ---- $date = &get_date_header("Date") || $date; ! $requester = &get_header("Reply-to") || &get_header("From") || $caller; ($active_file, $resolved_file, $error_file) = &get_file_names($num); print "Using $active_file, $resolved_file.\n" if ($debug); *************** *** 474,480 **** &set_header("Subject:", $subject); &set_header("From:", $caller); &do_create($num, $requester); ! &set_header("X-Request-Priority:", $prio) if($prio); if($giveto) { @mailto = &do_give($active_file, $caller, $giveto); --- 501,507 ---- &set_header("Subject:", $subject); &set_header("From:", $caller); &do_create($num, $requester); ! &set_header("X-Request-Priority:", &normalize_priority($prio)) if($prio); if($giveto) { @mailto = &do_give($active_file, $caller, $giveto); *************** *** 535,541 **** &read_file($file); $owner = &get_header("X-Request-Owner"); ! if($owner ne "" && $owner ne $who && $owner ne "nobody") { return($owner); } &set_header("X-Request-Owner:", $who); --- 562,568 ---- &read_file($file); $owner = &get_header("X-Request-Owner"); ! unless ($owner eq '' || $owner eq 'nobody' || &match_users($owner,$who)) { return($owner); } &set_header("X-Request-Owner:", $who); *************** *** 556,562 **** ($active_file, $resolved_file) = &prep_file($num, $caller); if(&active_request($active_file)) { ! if(($owner = &do_untake($active_file, $caller)) != $caller) { print "Sorry, request $num is owned by $owner, not by you.\n"; &quit_and_die(); } --- 583,590 ---- ($active_file, $resolved_file) = &prep_file($num, $caller); if(&active_request($active_file)) { ! $owner = &do_untake($active_file, $caller); ! unless (&match_users($owner,$caller)) { print "Sorry, request $num is owned by $owner, not by you.\n"; &quit_and_die(); } *************** *** 577,583 **** &read_file($file); $owner = &get_header("X-Request-Owner"); ! if($owner ne $who) { return($owner); } &set_header("X-Request-Owner:", ""); --- 605,611 ---- &read_file($file); $owner = &get_header("X-Request-Owner"); ! unless (&match_users($owner, $who)) { return($owner); } &set_header("X-Request-Owner:", ""); *************** *** 624,635 **** # Look up who used to own it. $owner = &get_header("X-Request-Owner"); ! if(!($owner eq "" || $owner eq "nobody" || $owner eq $caller)) { push(@mailto, $owner); } # And who's getting it. ! if($receiver ne $owner && $receiver ne $caller) { push(@mailto, $receiver); } --- 652,663 ---- # Look up who used to own it. $owner = &get_header("X-Request-Owner"); ! unless ($owner eq "" || $owner eq "nobody" || &match_users($owner, $caller)) { push(@mailto, $owner); } # And who's getting it. ! unless (&match_users($receiver,$owner) || &match_users($receiver,$caller)) { push(@mailto, $receiver); } *************** *** 727,741 **** } &reread_file($from_active); ! $from_numline = &get_header("X-Request-Number"); ! $from_owner = &get_header("X-Request-Owner"); ! $from_user = &get_header("X-Request-User"); ! $from_date = &get_header("X-Request-Date"); $from_priority = &get_header("X-Request-Priority"); ! $from_updated = &get_header("X-Request-Updated"); $from_notified = &get_header("X-Request-Notified"); @from_contents = @file_contents; ! @from_header = @file_header; &reread_file($to_active); $to_numline = &get_header("X-Request-Number"); --- 755,769 ---- } &reread_file($from_active); ! $from_numline = &get_header("X-Request-Number"); ! $from_owner = &get_header("X-Request-Owner"); ! $from_user = &get_header("X-Request-User"); ! $from_date = &get_header("X-Request-Date"); $from_priority = &get_header("X-Request-Priority"); ! $from_updated = &get_header("X-Request-Updated"); $from_notified = &get_header("X-Request-Notified"); @from_contents = @file_contents; ! @from_header = @file_header; &reread_file($to_active); $to_numline = &get_header("X-Request-Number"); *************** *** 742,750 **** &set_header("X-Request-Number", "$to_numline, $from_numline"); print "$to_numline:$from_numline\n" if ($debug); $to_owner = &get_header("X-Request-Owner"); $owner = ($from_owner || $to_owner); ! if($to_owner && ($owner ne $to_owner)) { $owner = ""; } &set_header("X-Request-Owner", $owner); --- 770,783 ---- &set_header("X-Request-Number", "$to_numline, $from_numline"); print "$to_numline:$from_numline\n" if ($debug); + $to_priority = &get_header("X-Request-Priority"); + ($priority) = sort byPriority ($from_priority, $to_priority); + print "prio = $priority\n" if ($debug); + &set_header("X-Request-Priority", $priority); + $to_owner = &get_header("X-Request-Owner"); $owner = ($from_owner || $to_owner); ! if($to_owner && !&match_users($owner,$to_owner)) { $owner = ""; } &set_header("X-Request-Owner", $owner); *************** *** 816,821 **** --- 849,855 ---- ($active_file, $resolved_file) = &prep_file($num, $caller); if(&active_request($active_file)) { + $prio = &normalize_priority($prio); &do_prio($active_file, $caller, $prio); print "Priority of $num set to $prio.\n"; } else { *************** *** 835,841 **** &read_file($file); ! $prio =~ tr/A-Z/a-z/; &set_header("X-Request-Updated:", $date); &set_header("X-Request-Status:", "open"); --- 869,875 ---- &read_file($file); ! $prio = &normalize_prio($prio); &set_header("X-Request-Updated:", $date); &set_header("X-Request-Status:", "open"); *************** *** 843,848 **** --- 877,914 ---- &append_actions("X-Request-Action: Priority set to $prio by $caller."); } + # There doesn't seem to be any real definition of what keywords + # are allowed in the Priority field. Ad hoc, I guess. So, I + # currently implement the following heirarchy of known priorities: + + @priorities = ('critical', 'high', 'normal', 'low'); + + # Force the user's priority keyword to be one of the ones above + # This allows abbreviations to be normalized to the full words. + # 'None' is converted to the empty string. + + sub normalize_prio { + local($prio) = shift; + $prio =~ tr/A-Z/a-z/; + local(@p) = grep(!index($_,$prio),@priorities); + shift(@p) || ($prio eq 'none' ? '' : $prio); + } + + # This should be used to sort/compare priority keywords with the following + # precedence: + # critical > high > normal > low > {other} > {none} + + sub byPriority { + return 0 if $a eq $b; + local(@ap) = grep(/^$a/i,@priorities); + local(@bp) = grep(/^$b/i,@priorities); + return $ap[0] <=> $bp[0] if @ap && @bp; # compare a & b if both valid + @ap ? -1 : + @bp ? 1 : + length($a) && length($b) ? $a cmp $b : + length($a) ? -1 : + length($b) ? 1 : 0; + } # =========================================================================== # Reopen routines *************** *** 1163,1169 **** %file_header=(); for($i=0;$i<=$#file_header;$i++) { if($file_header[$i] =~ /^(\S+):(.*)\s*$/) { ! ($previous_header = $1) =~ tr/[A-Z]/[a-z/; $file_header{$previous_header} = $2; } elsif($file_header[$i] =~ /^(\s+)(.*)\s*$/) { $file_header{$previous_header} .= $file_header[$i]; --- 1229,1235 ---- %file_header=(); for($i=0;$i<=$#file_header;$i++) { if($file_header[$i] =~ /^(\S+):(.*)\s*$/) { ! ($previous_header = $1) =~ tr/[A-Z]/[a-z]/; $file_header{$previous_header} = $2; } elsif($file_header[$i] =~ /^(\s+)(.*)\s*$/) { $file_header{$previous_header} .= $file_header[$i]; *************** *** 1309,1315 **** if($who eq "") { return("nobody"); } ! if($who =~ /<(.*)>/) { return($1); } if($who =~ /\s*(.*)\(.*\)(.*)\s*/) { --- 1375,1381 ---- if($who eq "") { return("nobody"); } ! if($who =~ /<([^<>"(),]+)>/) { return($1); } if($who =~ /\s*(.*)\(.*\)(.*)\s*/) { *************** *** 1327,1335 **** # If there are multiple requesters (from a merge), we check to make # sure _all_ of them were notified. # ! # So we extract the original requester(s) our of the message, drop any ! # part of their name but their login name, and then see if that appears ! # in the to: or cc: lines. # # This isn't perfect, but it should mostly work. # --- 1393,1400 ---- # If there are multiple requesters (from a merge), we check to make # sure _all_ of them were notified. # ! # So we extract the original requester(s) our of the message, and then ! # see if the names in the To: or Cc: headers match. # # This isn't perfect, but it should mostly work. # *************** *** 1339,1347 **** $notified = 0; &read_file($filename); @users=split(",", &get_header("X-Request-User")); for $u (@users) { ! $u =~ s:@.*::; ! $notified++ if(($to =~ /\b$u\b/) || ($cc =~ /\b$u\b/)); } $notified == $#users+1; } --- 1404,1413 ---- $notified = 0; &read_file($filename); @users=split(",", &get_header("X-Request-User")); + local(@to) = split(/\s*,\s*/,$to); + local(@cc) = split(/\s*,\s*/,$cc); for $u (@users) { ! $notified++ if grep(&match_users($u,$_), @to, @cc); } $notified == $#users+1; } *************** *** 1376,1382 **** @do_these; } - # =========================================================================== # Imagine a useful description of what this set of routines does. # =========================================================================== --- 1442,1447 ---- *************** *** 1422,1427 **** --- 1487,1498 ---- } } + printf "req-op failed: Caller = %s\n",$caller; + printf "\tCurrent uid = %d, gid = %s\n",$<,$(; + printf "\tMailer name = %s (uid = %d)\n",$mailer_name,$mailer_uid; + printf "\tMailer group = %s (gid = %d)\n", $group_name,$group_gid; + $| = 1; + return(0); } *************** *** 1455,1461 **** sub take_out_req { local($line) = @_; ! $line =~ s:@{PERL_TAGLINE_COMPARE}\s*::; $line; } --- 1526,1532 ---- sub take_out_req { local($line) = @_; ! $line =~ s|@{PERL_TAGLINE_COMPARE}\s*||; $line; } *************** *** 1639,1644 **** --- 1710,1719 ---- return(++$locked{$file}); } + # Get the current hostname if we haven't already + if (!defined($HOSTNAME)) { + chop($HOSTNAME = `/bin/sh -c '(uname -n || hostname)2>/dev/null'`); + } do { while(-f "$file.lock") { print "$file.lock exists\n" if ($debug); *************** *** 1650,1656 **** sleep(5); } open(FOOLOCK, ">$file.lock") || die ("unable to open $file.lock"); ! print FOOLOCK "$file locked by process $$ on ", `hostname`; close(FOOLOCK); $locked{$file} = 1; --- 1725,1731 ---- sleep(5); } open(FOOLOCK, ">$file.lock") || die ("unable to open $file.lock"); ! print FOOLOCK "$file locked by process $$ on ", $HOSTNAME; close(FOOLOCK); $locked{$file} = 1; *************** *** 1707,1709 **** --- 1782,1788 ---- } } + # + # Emacs Local Variables: + # Emacs mode: perl + # Emacs End: diff -rc req-1.1.beta/src/request.rc req-1.1.eci/src/request.rc *** req-1.1.beta/src/request.rc Tue Jan 17 22:13:47 1995 --- req-1.1.eci/src/request.rc Tue Oct 18 11:23:23 1994 *************** *** 0 **** --- 1,42 ---- + # procmailrc for "request" + # Set "TO" and then include this rc file + + MAILDIR=@{MAIL_CODE_REQUEST_DIR} + VERBOSE=off + #LOGABSTRACT=all + UMASK=007 + + # Make sure that TO is set; use "@{MAILING_LIST_NAME}-dist" by default + TO=${TO:-@{MAILING_LIST_NAME}}-dist + + # Commands + FORMAIL=@{PROCMAIL_BIN_DIR}/formail + FIXSUBJ=@{MAIL_CODE_FIXSUBJ} + PROCESS="@{MAIL_CODE_REQ} -mail -" + + # If it's "to:" or "redist-to:" or "apparently-to:" systems, + # make sure it has a request number in the subject line. + # + # Note that we are piping stdin into $FIXSUBJ. + + # Filter out duplicate messages + :0 Wh: msgid.lock + | $FORMAIL -D 8192 msgid.cache + + # Fix the subject line according to "req" rules + :0 fw + | $FIXSUBJ + + # If the Subject line has a "request" tag then, process it + :0 c: process + * ^Subject:.*@{EGREP_TAGLINE_COMPARE} + | $PROCESS + + # Get the "From" line, using "request" if there isn't any + FROM=`$FORMAIL -x'From '` + FROM=${FROM:-`$FORMAIL -xFrom:`} + FROM=${FROM:-@{MAILING_LIST_NAME}} + + # Now deliver to the outgoing distribution as normal + :0 + |$SENDMAIL "-f$FROM" $TO diff -rc req-1.1.beta/src/requestrc req-1.1.eci/src/requestrc *** req-1.1.beta/src/requestrc Tue Jan 17 22:13:42 1995 --- req-1.1.eci/src/requestrc Tue Oct 18 11:23:40 1994 *************** *** 0 **** --- 1,7 ---- + # procmailrc for "@{ALT_MAILING_LIST_NAME}" filter + # usage: + # + # cat | procmail -m /etc/procmailrcs/@{ALT_MAILING_LIST_NAME} + # + TO=@{ALT_MAILING_LIST_NAME} + INCLUDERC=@{MAIL_CODE_REQUESTRC} diff -rc req-1.1.beta/utils/extract req-1.1.eci/utils/extract *** req-1.1.beta/utils/extract Fri Sep 23 09:48:15 1994 --- req-1.1.eci/utils/extract Fri Sep 30 18:49:33 1994 *************** *** 15,53 **** # A copy of the license may be found in docs/license of the source # distribution. ! if($ARGV[0] eq "-d") { ! $def_file = $ARGV[1]; ! shift; shift; ! } else { ! $def_file = "./defs"; ! } ! ! open(DEFS, $def_file) || die "Unable to open $def_file file"; ! ! while() { ! chop; ! next if(/^#/); ! next if(/^\s*$/); ! ! if(/^\s*(\w+)\s*=\s*(.*)\s*$/) { ! $lv=$1; $rv=$2; ! if($def{$lv}) { ! print "Definition for $lv ($rv) on line $. overrides previous value ", ! "$def{$lv}\n"; } ! while($rv =~ /@\{(\w+)\}/) { ! $sub = $def{$1}; ! $rv =~ s/@\{\w+\}/$sub/; } - $def{$lv} = $rv; } } ! close(DEFS); ! if($ARGV[0] eq "-DBUILD_FOR_MAIL") { ! shift; foreach $k (keys(%def)) { if($def{"MAIL_$k"}) { $def{$k} = $def{"MAIL_$k"}; --- 15,124 ---- # A copy of the license may be found in docs/license of the source # distribution. + $usage = "usage: extract [-v] [-d defs].. [-Ddef[=var]].. < infile > outfile \n"; ! @def_files = (); ! ! $verbose = ''; ! ! while ($_ = shift) { ! if (/^-d/) { ! $def_file = shift || die "Missing define file after -d option!\n",$usage; ! -f $def_file || die "Definition file '$def_file' doesn't exist!\n"; ! push(@def_files,$def_file); ! ! # If there is a .local version of the same file, include it *after*. ! # This allows the local version to supercede values, without actually ! # editing the original file ! ! push(@def_files,"$def_file.local") if -f "$def_file.local"; ! ! } elsif (/^-v/) { ! $verbose++; ! } elsif (/^-D(.*)/) { ! ($var,$val) = split(/=/,$1); ! length($var) || die "Missing variable after -D option.\n",$usage; ! $def{$var} = $val || 1; ! } elsif (/^-/) { ! die "Unknown option '$_'\n",$usage; ! } else { # non-option ! unshift(@ARGV,$_); ! last; ! } ! } ! ! unless (@def_files) { ! push(@def_files, "./defs"); ! push(@def_files, "./defs.local") if -f "./defs.local"; ! } ! ! while ($def_file = shift(@def_files)) { ! open(DEFS, $def_file) || die "Unable to open $def_file file"; ! ! while() { ! chop; ! next if(/^#/); ! next if(/^\s*$/); ! ! if(/^\s*(\w+)\s*=\s*(.*)\s*$/) { ! ($lv,$rv) = ($1,$2); ! ! # It might be an error for the same symbol to be defined ! # twice in the same file, but probably not if in different ! # files. In verbose mode, show all redefines anyway ! ! if($def{$lv} && ($verbose || $def_file{$lv} eq $def_file)) { ! print STDERR "Definition for $lv ($rv) on line $. overrides previous value ", ! "$def{$lv}\n"; ! } ! ! # # This doesn't work for forward reference macros ! # # leave for the efficient substituion loop below ! # while($rv =~ /@\{(\w+)\}/) { ! # $sub = $def{$1}; ! # $rv =~ s/@\{\w+\}/$sub/; ! # } ! ! $def{$lv} = $rv; ! $def_file{$lv} = $def_file; } ! } ! close(DEFS); ! } ! ! # Rather than searching for every key in each line, we find ! # macro refs in each line, and search for a matching definition. ! # This is much more efficient. ! ! sub do_subs { ! local($_,$macro) = @_; ! while (s/\@\{(\w+)\}/\001/) { ! if ($val = $def{$key = $1}) { ! s/\001/$val/; ! } else { ! print STDERR "Reference to undefined macro '$key' "; ! if ($macro) { ! print STDERR " from macro '$macro'.\n"; ! } else { ! print STDERR "at line $.\n"; ! } ! s/\001/\@\#$key\#/; } } + $_; + } + + # Now pass through all the defines, and do the internal substitutions + + foreach $k (keys(%def)) { + $def{$k} = &do_subs($def{$k},$k); } ! # If the user defined "BUILD_FOR_MAIL", then ! # translate all MAIL_symbol macros into the corresponding ! # symbol (without the "MAIL_" prefix). ! if ($def{'BUILD_FOR_MAIL'}) { foreach $k (keys(%def)) { if($def{"MAIL_$k"}) { $def{$k} = $def{"MAIL_$k"}; *************** *** 55,68 **** } } ! @keys = keys(%def); while(<>) { ! if (/@{.*}/) { ! foreach $k (@keys) { ! $_ =~ s/@\{$k\}/$def{$k}/; ! } ! } print; } --- 126,135 ---- } } ! # Now read the file and do the substitutions while(<>) { ! $_ = &do_subs($_); print; } diff -rc req-1.1.beta/utils/rq-aliases.csh req-1.1.eci/utils/rq-aliases.csh *** req-1.1.beta/utils/rq-aliases.csh Tue Jan 17 22:14:01 1995 --- req-1.1.eci/utils/rq-aliases.csh Fri Sep 30 18:58:50 1994 *************** *** 0 **** --- 1,30 ---- + # Csh aliases for the "req" system + # Source this file in your ~/.cshrc to enable them + # + # Rq & Req aliases + # + a rqt rq :15 + a rqun rq -un + a rqut rqun :15 + a rqown rq -owner + a rqhigh rq -prio high + a rqmy 'rqown $USER' + a rqmyold 'rqmy -r' + a rqmyoldt rqmyold :15 + # + if ( ! $?PAGER ) then + setenv PAGER more + endif + a rqs 'req -show \!^ | $PAGER' + a rqgive req -give + a rqtake req -take + a rqsubj 'req -subject \!^ "\!\!:2*"' + a rqcomm req -comment + a rqprio req -prio + a rqprhi 'rqprio \!^ high' + a rqprlo 'rqprio \!^ low' + a rqsolve req -resolve + a rqstall req -stall + a rqmerge req -merge + a rqkill req -kill + a rqnew req -create