On Sat, Apr 01, 2006 at 06:23:02PM -0500, Justin Pryzby wrote: > On Fri, Mar 31, 2006 at 06:58:24PM +0100, Julian Gilbey wrote: > > On Thu, Mar 23, 2006 at 03:15:10PM -0500, Justin Pryzby wrote: > > > Here's an updated copy of the tool, which should be runnable now > > > without copying it; the dehs stuff might be in flux, though.. > > > > Anyone got an idea for a better name than dev-best-practice, since it > > seems like something we could just stick in /usr/bin and be done with > > it? > > > > Something like dev-check-system or dev-package-status or something > > like that? > Sure, whatever :) "devcheck" is too much like the QA debcheck, but > how about "dev-checker"?
Sounds good! > > BTW, I have an additional way of avoiding the "killing the BTS at > > 02:00 local time": just change the heading to say: > > > > # Best-practice information for Debian developers > > # intended to be run periodically as a cronjob, for example weekly as: > > # 0 hour * * day /usr/bin/dev-best-practice > > # (replacing hour and day by your preferred times!) > I prefer to give something copy-and-paste-able, and which doesn't > assume that everyone wont use day=0 hour=0. There are two options here: (1) Trust that developers are competent enough to make the change themselves, or (2) Not trust them. And everyone using day=0 hour=0 will be identical to everyone using day=0 hour=2! I'd prefer to go for option 1. Of course, if we want to do it automatically, we could stick it into /etc/cron.weekly ourselves, but I'd be inundated by bug reports if I did that! > I'm attaching the most recent copy; help2man output is even sane. Nice, thanks! Although I may well write my own manpage, 'cos I'm planning to tweak this some.... See comments on code below. > #! /bin/bash > # dev-checker > # Best-practice information for Debian developers; > # intended to be run periodically as a cronjob; > # weekly: > # 0 2 * * 0 /usr/share/doc/devscripts/examples/dev-best-practice --delay > --mail Need to change this line... > [...] > set -e; > > version=0; change to devscripts version and use generic devscripts usage/version functions. > # Options' default values are candidates for devscripts.conf... > XMAIL=''; > XDELAY=''; I have an alternative suggestion: if [ -t 1 ]; then do interactively, --no-mail and --no-delay else use --mail and --delay fi > function version () > { > echo "$0 ($version)" > echo; > echo "Copyright (C) 2006 Justin Pryzby <[EMAIL PROTECTED]>;"; > echo "Distributed under the MIT license grant."; > } Ah, a different license :) > echo " --mail Send mail rather than displaying to stdout" > echo " --delay Delay for a random time interval at startup" And will need --no-mail and --no-delay options too. > while test $# -gt 0; do Use getopt :) > if [ -n "$XMAIL" ]; then > exec 3>&1; > exec 1> >(mail -s "Debian fixme list for $LOGNAME on `date +%x`" > $LOGNAME) Nice one :) > fi; > > src "/etc/devscripts.conf"; > src "$HOME/.devscripts"; > > if [ -z "$DEBEMAIL" ]; then > echo "DEBEMAIL is unset; this output wont be as complete"; > echo "You should consider setting it in ~/.devscripts"; No, can't set DEBEMAIL in .devscripts, need to set it in the environment. Could also have a command-line option for setting it. > else [sequence of checks] > echo "Checking for your bugs tagged moreinfo:"; > lynx -dump "$bts/from:$DEBEMAIL&include=moreinfo" | I'd prefer not to rely on lynx/links if possible and make do with wget/sed/perl. Also, need to test for the presence of the required programs (such as wget) before running these checks. > sed -ne '/^[[:space:]]*\* \[[[:digit:]]\+\]\(#[[:digit:]]\)/s//\1/p'; > # grep -E '^[[:space:]]*\* \[[[:digit:]]+\]#[[:digit:]]+' | > # sed -e 's/^[^#]*//'; Why the commented out lines? > [...] > if [ -n "$XMAIL" ]; then > exec >&-; > exec 1>&3; > fi; Not sure what this bit does; wouldn't exec 1>&3- be adequate? Finally, I think it would be nice to have a devscripts option DEVCHECKER_EXCLUDE which would be a colon-separated list of tests to skip. Then each test would read: case ":$EXCLUDE:" in :thistest:) # skip test ;; *) # do test [...] ;; esac Julian -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]