|
|
[Gentoo Linux Home] [GLEP Index] [GLEP Source] |
| GLEP: | 42 |
|---|---|
| Title: | Critical News Reporting |
| Version: | 1.2 |
| Author: | Ciaran McCreesh <ciaranm at gentoo.org> |
| Last-Modified: | 2005/11/07 17:02:42 |
| Status: | Draft |
| Type: | Standards Track |
| Content-Type: | text/x-rst |
| Created: | 31-Oct-2005 |
| Post-History: | 1-Nov-2005, 5-Nov-2005 |
This GLEP proposes a new way of informing users about important updates and news regarding tree-related items.
There are currently several ways of getting news out to our users, none of them particularly effective:
A more reliable way of getting news of critical updates out to users is required to avoid repeats of the various recent upgrade debacles. This GLEP proposes a solution based around pushing news items out to the user via the rsync tree.
An adequate solution must meet all of the following requirements:
The following characteristics would be desirable:
News items are published and delivered to users as follows:
Each news item will be represented by a single text file. This file will be encoded using UTF-8 for compatibility with and for the same reason as existing Gentoo documentation [1] and tree [6] practices.
The news item will be named in the form yyyy-mm-dd-item-name.en.txt, where item-name is a very short name (e.g. apache-updates) and en is the two letter ISO 639 [9] language code for the news item. The short name must consist only of characters a-z, A-Z, 0-9 and - (hyphen).
News items may be signed using GPG. If this is done, a detached signature should be used.
The directory and file name rules are designed specifically to allow easy sorting by date.
An English (en) version must be available for all news items. Other languages may be provided either by the original author or by other translators who have commit access. This anglocentricity is justified on the grounds that nobody objected to it with GLEP 34 [7].
A news item's content will consist of an RFC 822 [11] style header followed by the main body of the message as plain text. This GLEP defines various optional and mandatory headers. Future GLEPs may propose new headers -- tools handling these news items must ignore any unrecognised header.
The following headers describe the purpose and format of the news item:
The following headers are used for filtering. If none of these headers are specified, the news item is displayed for all users. Otherwise, the news item is displayed if at least one header matches.
The header section must be followed by a blank line, then the main body of the text.
The text body should be wrapped at 72 characters. No fancy formatting or tab characters should be used -- the news item may be being displayed directly to a terminal. Paragraphs should be separated by a blank line.
Hyperlinks may be used to refer to further information (for example, an upgrade guide). However, the main body of the news item should be descriptive and not simply a "read this link" text. It is assumed that the user will have access to a web browser somewhere, but not necessarily on the box which is being administrated -- this will be the case on may servers and routers, for example.
The following hypothetical news item could be used for an upgrade to the YourSQL database format which breaks forward compatibility. It should be named 2005-11/2005-11-01-yoursql-upgrades.en.txt.
Title: YourSQL Upgrades from 4.0 to 4.1
Author: Ciaran McCreesh <ciaranm@gentoo.org>
Content-Type: text/plain
Posted: 01-Nov-2005
Display-If-Installed: <dev-db/yoursql-4.1_alpha
YourSQL databases created using YourSQL version 4.0 are incompatible
with YourSQL version 4.1 or later. There is no reliable way to
automate the database format conversion, so action from the system
administrator is required before an upgrade can take place.
Please see the Gentoo YourSQL Upgrade Guide for instructions:
http://www.gentoo.org/doc/en/yoursql-upgrading.xml
Also see the official YourSQL documentation:
http://dev.yoursql.com/doc/refman/4.1/en/upgrading-from-4-0.html
After upgrading, you should also recompile any packages which link
against YourSQL:
revdep-rebuild --library=libyoursqlclient.so.12
The revdep-rebuild tool is provided by app-portage/gentoolkit.
There have been complaints regarding the comprehensibility of some upgrade notices and news items in the past. This is understandable -- not every Gentoo developer speaks English as a first language. However, for the sake of clarity and professionalism it is important that any language problems be corrected before inflicting a news item upon end users.
Thus, all proposed news items must be posted to the gentoo-dev or gentoo-core mailing list, and Cc:ed to pr@gentoo.org at least 72 hours before being committed (exceptions may be made in exceptional circumstances). Any complaints regarding wording or clarity must be addressed before the news item goes live.
News items must only be for important changes that may cause serious upgrade or compatibility problems. Ordinary upgrade messages and non-critical news items should remain in einfo notices. The importance of the message to its intended audience should be justified with the proposal.
Important
The filtering system means that it is appropriate to send out news items which are aimed at users of an uncommon package or architecture. Thus, the justification should be in the form "this message is important to YourSQL users because ...", not "YourSQL is important because ...".
News items are to be made available via the Portage tree. This removes any need for polling of a remote source.
A new repository will be created for news items. The type (CVS or Subversion), location and access controls on this repository are beyond the scope of this GLEP.
Note
A previous draft of this GLEP instead used the main gentoo-x86 tree. This was changed following advice from Infrastructure [10]. Both solutions have the same end result.
This repository will contain directories named yyyy-mm/, where yyyy is the current year and mm is the current month number (01 for January through 12 for December). This separation will help keep news items more manageable.
The contents of this repository will automatically be merged with the main rsync tree, placing the items under a top-level news/ directory. The method used for merging these items is beyond the scope of this GLEP -- a similar setup is already used for merging GLSAs into the rsync tree.
Note
The profiles/ directory will not be used. This fits in with the Portage team's future plans for profiles/ and metadata/ separation.
Whenever relevant unread news items are found, emerge will copy or symlink the news file into /var/lib/gentoo/news/.
Notification that new relevant news items will be displayed via the emerge tool in a similar way to the existing "configuration files need updating" messages:
* Important: 3 config files in /etc need updating. * Type emerge --help config to learn how to update config files. * Important: there are 5 unread news items. * Type emerge --help news to learn how to read news files.
The unread news message will also be displayed immediately after an emerge sync.
Portage may also warn of unread news items using, for example, a red flashy before actions such as merging a package.
Portage must keep track of news items which have already been installed to avoid repeatedly reinstalling a deleted news item.
Users who really don't care about news items can use rsync_excludes to filter out the news/ directory.
Once a news item is 'installed', third party tools (or a traditional Unix pager and rm) can be used to display and view the news files. An eselect [2] module shall be created as the 'suggested' display tool; other display tools (for example, a news to email forwarder, which would be ideal for users who sync on a cron) are left as options for those who desire them -- the simple file format make this relatively simple.
News items can be removed (by removing the news file from the main tree) when they are no longer relevant, if they are made obsolete by a future news item or after a long period of time. This is the same as the method used for updates entries.
It would be trivial to convert these news items into the format used for news items on the Gentoo website or posts for the gentoo-announce mailing list.
There is an existing automated tool [3] for posting GLSAs to the forums. A similar tool can be used for these news items.
Backwards compatibility is not a concern here. Existing tools will simply ignore the news/ directory.
TODO
A demonstration eselect news display script follows:
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id: glep-0042.html,v 1.3 2005/11/07 22:26:59 ciaranm Exp $
DESCRIPTION="Read important Gentoo news items"
MAINTAINER="ciaranm@gentoo.org"
SVN_DATE='$Date: 2005/11/07 22:26:59 $'
VERSION=$(svn_date_to_version "${SVN_DATE}" )
get_news_item_list() {
[[ -d "${ROOT}/var/lib/gentoo/news" ]] || return
(
local news
for news in "${ROOT}/var/lib/gentoo/news/"*.txt ; do
echo $(basename ${news%%.*} )
done
) | sort -u
}
get_filename() {
local best_lang=${LANG%%_*} lang= filename="${1}"
[[ -e "/${filename}" ]] || for lang in "${best_lang}" "en" ; do
filename="${ROOT}/var/lib/gentoo/news/${1}.${lang}.txt"
[[ -e "${filename}" ]] && break
done
[[ -e "${filename}" ]] && echo "${filename}" || die -q "Can't find '${1}'"
}
get_all_filenames() {
if [[ -z "${1}" ]] ; then
echo "${ROOT}/var/lib/gentoo/news/"*.??".txt"
else
echo "${ROOT}/var/lib/gentoo/news/${1}."??".txt"
fi
}
get_headers() {
sed -e '/^$/Q' < $(get_filename "${1}" )
}
get_body() {
sed -e '1,/^$/d' < $(get_filename "${1}" )
}
get_title() {
get_headers "${1}" | sed -n -e '/^[Tt]itle: /s/^[^:]\+:[ \t]*//p'
}
### list action
## {{{ list stuff
describe_list() {
echo "List available news items"
}
do_list() {
write_list_start "Available news items:"
local empty=yes n=1
for news in $(get_news_item_list ) ; do
write_numbered_list_entry ${n} "$(highlight $(get_title ${news} ) ) (${news})"
n=$(( n + 1 ))
done
}
## }}}
## {{{ show stuff
describe_show(){
echo "Show a news item"
}
do_show() {
[[ -z "${1}" ]] && die -q "You didn't tell me which news item to read"
local target=${1} filename=
if is_number "${target}" && [[ ${target} -ge 1 ]] ; then
targets=( $(get_news_item_list ) )
target=${targets[$(( ${target} - 1 ))]}
fi
(
get_headers "${target}" | grep -v '^Display-If-\|Content-Type:'
echo
get_body "${target}"
) | ${PAGER:-cat}
}
## }}}
# {{{ delete stuff
describe_delete() {
echo "Delete a news item"
}
do_delete() {
[[ -z "${1}" ]] && die -q "You didn't tell me which news item to delete"
for target in $@ ; do
if is_number "${target}" && [[ ${target} -ge 1 ]] ; then
targets=( $(get_news_item_list ) )
target=${targets[$(( ${target} - 1 ))]}
fi
rm $(get_all_filenames "${target}" ) || die -q "Couldn't delete ${target}"
done
}
# }}}
# {{{ delete-all
describe_delete-all() {
echo "Delete all news items"
}
do_delete-all() {
rm $(get_all_filenames ) || die -q "Couldn't delete news items"
}
# }}}
A demonstration shell script which delivers news items via email follows:
#!/bin/bash
to_address="root@localhost"
mail="mailx"
best_lang="${LANG%%_*}"
for news in /var/lib/gentoo/news/*.*.txt ; do
[[ -z "${best_lang}" ]] || news="${news%%.*}.${best_lang}.txt"
[[ -f "${news}" ]] || news="${news%%.*}.en.txt"
[[ -f "${news}" ]] || continue
title=$(sed -n -e '/^Title:/ { s,^[^:]\+:[ \t]\+,,p ; q }' < ${news} )
sed -e '1,/^$/ { /^Display-If\|Content-Type/d }' < "${news}" | \
${mail} -s "Gentoo news: ${title}" "${to_address}" && \
for file in ${news%%.*}.*.txt ; do rm "${file}" ; done
done
The idea behind notifying users of news updates via Portage comes from Stuart Herbert [12].
Thanks to Lance Albertson, Donnie Berkholz, Grant Goodyear, Brian Harring, Dan Meltzer, Paul de Vrieze and Alec Warner for input. Some of the ideas presented here are theirs, others go completely against their suggestions.
| [1] | Gentoo XML Guide, Daniel Robbins et al., http://www.gentoo.org/doc/en/xml-guide.xml |
| [2] | eselect modular framework for configuration and administration utilities, http://www.gentoo.org/proj/en/eselect/index.xml |
| [3] | Forums user GLSA, http://forums.gentoo.org/profile.php?mode=viewprofile&u=55648 |
| [4] | (1, 2) Forums thread "Gentoo Apache2 Config Change Idiocy", http://forums.gentoo.org/viewtopic-t-384368.html |
| [5] | GLEP 22: "New "keyword" system to incorporate various userlands/kernels/archs", Grant Goodyear, http://www.gentoo.org/proj/en/glep/glep-0022.html |
| [6] | GLEP 31: "Character Sets for Portage Tree Items", Ciaran McCreesh, http://www.gentoo.org/proj/en/glep/glep-0031.html |
| [7] | GLEP 34: "Per-Category metadata.xml Files", Ciaran McCreesh, http://www.gentoo.org/proj/en/glep/glep-0034.html |
| [8] | GLEP 36: "Subversion/CVS for Gentoo Hosted Projects", Aaron Walker, http://www.gentoo.org/proj/en/glep/glep-0036.html |
| [9] | ISO 639 "Code for the representation of names of languages" |
| [10] | "Re: [gentoo-dev] GLEP ??: Critical News Reporting", Lance Albertson, http://marc.theaimsgroup.com/?l=gentoo-dev&m=113111585907703&w=2 |
| [11] | RFC 822 "Standard for the format of ARPA Internet text messages" |
| [12] | "Favouring an automatic news mechanism", Stuart Herbert, http://stu.gnqs.org/diary/gentoo.php/2005/10/28/favouring_an_automatic_news_mechanism |
This document has been placed in the public domain.