Differences between revisions 1 and 2
Revision 1 as of 2004-09-13 15:06:41
Size: 1385
Editor: anonymous
Comment:
Revision 2 as of 2004-09-13 15:08:52
Size: 757
Editor: anonymous
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
editchanges is a small shellscript that helps manage the changelog of a Debian host. [http://people.debian.org/~zugschlus/wiki.debian.net/EditChanges/editchanges editchanges] is a small shellscript that helps manage the changelog of a Debian host.
Line 11: Line 11:

{{{
#!/bin/bash

# $Id: EditChanges,v 1.1 2004/08/13 16:06:41 www-data Exp $
# $Source: /export/http/wiki/foo/plugin/archive/EditChanges,v $

CHANGELOGDIR="/usr/local/doc/localhost"
CHANGELOG="$CHANGELOGDIR/changelog"
CHANGEWRK="${CHANGELOG}.wrk"
CHANGEHDR="/usr/local/share/zgserver/editchanges.header"

umask 002

if [ -z "$CHANGESEDITOR" }}}; then{{{
  if [ -n "$VISUAL" ]; then
    CHANGESEDITOR="$VISUAL"
  elif [ -n "$EDITOR" ]; then
    CHANGESEDITOR="$EDITOR"
  elif [ -x "$(which sensible-editor)" ]; then
    CHANGESEDITOR="$(which sensible-editor)"
  elif [ -x "/usr/bin/vi" ]; then
    CHANGESEDITOR="/usr/bin/vi"
  else
    echo >&2 "ERR: no suitable editor found!"
    exit 1
  fi
}}}
fi

]

editchanges

[http://people.debian.org/~zugschlus/wiki.debian.net/EditChanges/editchanges editchanges] is a small shellscript that helps manage the changelog of a Debian host.

Features

  • flexible choice of editors, honoring the local user's settings.
  • rudimentary locking
  • makes sure that the changelog starts with the system's current /etc/motd

  • Positions the editor's insertion point on a newly created changelog entry after invocation
  • dumps changelog diff to syslog after editor was called to allow traceability and transparency. This will also prod somebody skimming the syslog to a change that was made (probably helping her find the cause for a behavior change of the system).