From owner-freebsd-standards@FreeBSD.ORG Wed Dec 10 18:20:02 2008 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37D101065677 for ; Wed, 10 Dec 2008 18:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 0DBB18FC25 for ; Wed, 10 Dec 2008 18:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id mBAIK1fn056678 for ; Wed, 10 Dec 2008 18:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id mBAIK1gt056677; Wed, 10 Dec 2008 18:20:01 GMT (envelope-from gnats) Resent-Date: Wed, 10 Dec 2008 18:20:01 GMT Resent-Message-Id: <200812101820.mBAIK1gt056677@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-standards@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Gavin Atkinson Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75E2D1065673 for ; Wed, 10 Dec 2008 18:18:34 +0000 (UTC) (envelope-from ga9@buffy.york.ac.uk) Received: from mail-gw2.york.ac.uk (mail-gw2.york.ac.uk [144.32.128.247]) by mx1.freebsd.org (Postfix) with ESMTP id 2C1CD8FC17 for ; Wed, 10 Dec 2008 18:18:33 +0000 (UTC) (envelope-from ga9@buffy.york.ac.uk) Received: from mail-gw7.york.ac.uk (mail-gw7.york.ac.uk [144.32.129.30]) by mail-gw2.york.ac.uk (8.13.6/8.13.6) with ESMTP id mBAHkrF4003415 for ; Wed, 10 Dec 2008 17:46:53 GMT Received: from buffy-128.york.ac.uk ([144.32.128.160] helo=buffy.york.ac.uk) by mail-gw7.york.ac.uk with esmtps (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1LAT9B-0001Za-4t for FreeBSD-gnats-submit@freebsd.org; Wed, 10 Dec 2008 17:46:53 +0000 Received: from buffy.york.ac.uk (localhost [127.0.0.1]) by buffy.york.ac.uk (8.14.2/8.14.2) with ESMTP id mBAHkqpq051292 for ; Wed, 10 Dec 2008 17:46:52 GMT (envelope-from ga9@buffy.york.ac.uk) Received: (from ga9@localhost) by buffy.york.ac.uk (8.14.2/8.14.2/Submit) id mBAHkqoZ051291; Wed, 10 Dec 2008 17:46:52 GMT (envelope-from ga9) Message-Id: <200812101746.mBAHkqoZ051291@buffy.york.ac.uk> Date: Wed, 10 Dec 2008 17:46:52 GMT From: Gavin Atkinson To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: standards/129554: lp(1) [patch] Implement -m and -t options X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Gavin Atkinson List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 18:20:02 -0000 >Number: 129554 >Category: standards >Synopsis: lp(1) [patch] Implement -m and -t options >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-standards >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Dec 10 18:20:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Gavin Atkinson >Release: FreeBSD 7.0-STABLE amd64 >Organization: >Environment: System: FreeBSD buffy.york.ac.uk 7.0-STABLE FreeBSD 7.0-STABLE #3: Fri Jun 20 09:21:51 UTC 2008 root@buffy.york.ac.uk:/usr/obj/usr/src/sys/GENERIC amd64 >Description: lp(1) doesn't support the -t option, as required by me and POSIX. Implement it. While here, I've implemented the -m option, leaving the -w option as the only one missing for full compliance (although -o and -s are not fully implemented). Note that I have implemented the -t option because I needed it, and not because I necessarily wanted to see this utility closer to compliance. Therefore, I've not updated any reference to compliance in the code or man page (I wouldn't know if they need updating or not) >How-To-Repeat: N/A >Fix: --- lp-t-moptions.diff begins here --- Index: src-head/usr.sbin/lpr/lp/lp.1 =================================================================== RCS file: /home/ncvs/src/usr.sbin/lpr/lp/lp.1,v retrieving revision 1.18 diff -u -r1.18 lp.1 --- src-head/usr.sbin/lpr/lp/lp.1 2 Jul 2004 23:12:46 -0000 1.18 +++ src-head/usr.sbin/lpr/lp/lp.1 10 Dec 2008 17:34:18 -0000 @@ -78,6 +78,8 @@ .Ev PRINTER (with this precedence) are taken as the destination printer. +.It Fl m +Send mail upon completion. .It Fl n Ar num Specify that .Ar num @@ -91,6 +93,9 @@ Not supported, provided only as a compatibility option for .St -susv2 . +.It Fl t Ar title +Set the job title to +.Ar title . .El .Sh ENVIRONMENT As described above, the variables Index: src-head/usr.sbin/lpr/lp/lp.sh =================================================================== RCS file: /home/ncvs/src/usr.sbin/lpr/lp/lp.sh,v retrieving revision 1.7 diff -u -r1.7 lp.sh --- src-head/usr.sbin/lpr/lp/lp.sh 8 Mar 2000 10:02:11 -0000 1.7 +++ src-head/usr.sbin/lpr/lp/lp.sh 10 Dec 2008 17:36:52 -0000 @@ -41,6 +41,8 @@ ncopies="" symlink="-s" +mailafter="" +title="" # Posix says LPDEST gets precedence over PRINTER dest=${LPDEST:-${PRINTER:-lp}} @@ -51,7 +53,7 @@ # XXX We include the -s flag as a dummy. SUSv2 requires it, # although we do not yet emit the affected messages. # -while getopts "cd:n:o:s" option +while getopts "cd:mn:o:st:" option do case $option in @@ -59,12 +61,16 @@ symlink="";; d) # destination dest="${OPTARG}";; + m) # mail after job + mailafter="-m";; n) # number of copies ncopies="-#${OPTARG}";; o) # (printer option) : ;; s) # (silent option) : ;; + t) # title for banner page + title="-J${OPTARG}";; *) # (error msg printed by getopts) exit 2;; esac @@ -72,4 +78,4 @@ shift $(($OPTIND - 1)) -exec /usr/bin/lpr "-P${dest}" ${symlink} ${ncopies} "$@" +exec /usr/bin/lpr "-P${dest}" ${symlink} ${ncopies} ${mailafter} "${title}" "$@" --- lp-t-moptions.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: