From owner-freebsd-rc@FreeBSD.ORG Wed Jun 15 03:45:31 2011 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19810106564A for ; Wed, 15 Jun 2011 03:45:31 +0000 (UTC) (envelope-from cmdlnkid@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id C84CB8FC12 for ; Wed, 15 Jun 2011 03:45:30 +0000 (UTC) Received: by iwn33 with SMTP id 33so7584926iwn.13 for ; Tue, 14 Jun 2011 20:45:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:date:from:to:subject:message-id :mime-version:content-type:content-disposition; bh=+sog7JV1PjSOoHEQ93OsQ06nU6Si1Jfkg9tfd0UW9uI=; b=WvShYymeC6X0rkn3shStGClRspH2/FtaE6zZIx47f++OXxxsOjnJFl+3suDV5CusYg jP6I1+j+391wDv4VJ5dD09q/rlSfSy2Yk1bU41feNIhGI8/HpOjRRUAg3FPKABlJdFAY n7Cfhh1+hiQngMjc2qXRkIO4vOT38WfzQxMGM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:subject:message-id:mime-version:content-type :content-disposition; b=LVLrv6USo9DS4zwrqFkKkHCZKpOkdIG+PGqTvJEOLnnPoSrInK1S5ZK3BKNJbSShEk RL0G+ZOOBeYKINe+jwRDA6ThzpoX7Rt+nqnBr5XIy92LQ4EEzNGL6BOzKyhnJMxC+3lc Ommte6lscXmgl4+8IFhOAJmuhgm4bxYdYn2c0= Received: by 10.231.212.216 with SMTP id gt24mr7168406ibb.145.1308109530233; Tue, 14 Jun 2011 20:45:30 -0700 (PDT) Received: from DataIX.net (adsl-99-181-139-216.dsl.klmzmi.sbcglobal.net [99.181.139.216]) by mx.google.com with ESMTPS id s9sm8481ibe.44.2011.06.14.20.45.28 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 14 Jun 2011 20:45:29 -0700 (PDT) Sender: The Command Line Kid Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.4/8.14.4) with ESMTP id p5F3jQVx031720 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 14 Jun 2011 23:45:27 -0400 (EDT) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.4/8.14.4/Submit) id p5F3jQJu031719 for freebsd-rc@freebsd.org; Tue, 14 Jun 2011 23:45:26 -0400 (EDT) (envelope-from jhell@DataIX.net) Date: Tue, 14 Jun 2011 23:45:26 -0400 From: jhell To: freebsd-rc@freebsd.org Message-ID: <20110615034526.GA12185@DataIX.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jho1yZJdad60DJr+" Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: [PATCH] Knock out two if statements, one eval & IDCMD with builtin test. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 03:45:31 -0000 --jho1yZJdad60DJr+ Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" Content-Disposition: inline --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline After looking over Jilles patch on this same list it made ID & IDCMD catch my eye when I seen the $(eval $IDCMD) where it was the only place it was used throughout the whole system in which it calls another if statement from IDCMD to check the presence of /usr/bin/id. This is not bad at all, don't get me wrong but this could be done from one location to knock out the eval and two if statements with one builtin test right from the ID variable itself and get rid of the need for the IDCMD. Slight speed improvement ? maybe... cleaner yes. As for functionality can anyone think of a need to wait for processing this till run_rc_command is thrown ? if so should it be escaped and re-eval'd as $(eval \$ID) or something similiar later ? --OgqxwSJOaUobr8KG-- --jho1yZJdad60DJr+ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) Comment: http://bit.ly/0x89D8547E iQEcBAEBAgAGBQJN+CrUAAoJEJBXh4mJ2FR+K9wIAIo9zUUKRRB0TzPqzBpmz8gb Q6XvX3vzUXHgEA4YOwte7a30wTt4RKwRloORCYljqMtgooCbuDwlTt/8b7UqRfyC pCsXoyB3jy2VAbF9G4TH2iVLu5/qzA28n5RMpUrcrJdwqGh21ADLF3LZsDIb3nIR myzf9xDPevlhlpbe+bDs9aRjEgiZQbqM/9JnMOBfcJU1PHf1+4eJ6N4Pcj2m65mZ zgCBMRBgvjLWD3J6jsEPG5llOaTkYwNEvh8szuChemWGOXxDldhQn5WAQUzG5kGA YVzxdGg21H/VCxLX/nRj09Tq/7XbMRFCju88qslCJ5fBC7h3sXvGvGBm8/QUo3g= =Tfkj -----END PGP SIGNATURE----- --jho1yZJdad60DJr+--