From owner-svn-src-user@FreeBSD.ORG Tue Sep 9 17:16:07 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7875FE7D; Tue, 9 Sep 2014 17:16:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49DD5A4E; Tue, 9 Sep 2014 17:16:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s89HG74e078936; Tue, 9 Sep 2014 17:16:07 GMT (envelope-from crees@FreeBSD.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s89HG6UG078934; Tue, 9 Sep 2014 17:16:06 GMT (envelope-from crees@FreeBSD.org) Message-Id: <201409091716.s89HG6UG078934@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: crees set sender to crees@FreeBSD.org using -f From: Chris Rees Date: Tue, 9 Sep 2014 17:16:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r271322 - user/crees/rclint X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Sep 2014 17:16:07 -0000 Author: crees (doc,ports committer) Date: Tue Sep 9 17:16:06 2014 New Revision: 271322 URL: http://svnweb.freebsd.org/changeset/base/271322 Log: Check for desc line too Modified: user/crees/rclint/errors.en user/crees/rclint/rclint.py Modified: user/crees/rclint/errors.en ============================================================================== --- user/crees/rclint/errors.en Tue Sep 9 17:03:58 2014 (r271321) +++ user/crees/rclint/errors.en Tue Sep 9 17:16:06 2014 (r271322) @@ -25,6 +25,8 @@ rcorder_order rcorder block in the wrong rcsid Missing FreeBSD RCSId keyword All rc scripts must contain a line beginning # $FreeBSD$. Do not include blank lines without comment markers at the beginning (#) until the script begins +no_description No description included All rc files should include a variable desc="Description of the service" + rcvar_incorrect rcvar is not set correctly rcvar must be directly set to name_enable. Do not quote, and do not use indirection; ${name}_enable is slower than example_enable. `set_rcvar` was removed from FreeBSD in January 2012, so definitely do not use that run_rc_argument Incorrect argument to run_rc_command The last line of the file should be run_rc_command $1 Modified: user/crees/rclint/rclint.py ============================================================================== --- user/crees/rclint/rclint.py Tue Sep 9 17:03:58 2014 (r271321) +++ user/crees/rclint/rclint.py Tue Sep 9 17:16:06 2014 (r271322) @@ -27,7 +27,7 @@ __version__ = '$FreeBSD$' MAJOR = 0 -MINOR = 1 +MINOR = 2 MICRO = 0 DATADIR = '.' @@ -143,7 +143,7 @@ class Variable(Statement): lines[number+self.length])) self.length += 1 self.type = ( - 'init' if self.name in ('name', 'rcvar') else 'basic') + 'init' if self.name in ('name', 'desc', 'rcvar') else 'basic') elif line[:4] == 'eval': self.value = line @@ -421,6 +421,14 @@ def do_rclint(filename): if v.is_empty(): error.give('value_empty', v.line) + descexists = False + for v in lineobj['Variable']: + if v.name == 'desc': + descexists = False + break + if not descexists: + error.give('no_description') + logging.debug('Checking for rcvar set correctly') for var in lineobj['Variable']: if var.name == 'name':