#!/bin/sh # refresh-fonts-data -- Refresh data about font packages in Debian # Copyright (C) 2008, 2009 Raphael Geissert # # This file is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # This file is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this file. If not, see . set -e if [ -z "$1" ]; then printf "Usage: %s []\n" "$(basename "$0")" cat < is specified, it should be the path to the Contents file from the current unstable distribution. It will be used to find all font files already packaged for Debian and update the list of known font files and the packages that contain them. should be the path to the root of the Lintian data directory to update. If the Contents file is not specified, the script will download the following files from a mirror. The mirror can be specified with the DEB_MIRROR environment variable. If it is not set, the default is http://i386-geomirror.debian.net/debian. * Contents-i386.gz Any necessary special parameters for wget can be set via the environment variable WGET_ARGS. The default arguments are -nv. INFO exit fi readonly lintian_data="$(readlink -f "$1")" if [ -n "$2" ] ; then contents="$(readlink -f "$2")" fi [ -d "$lintian_data" ] || { printf "%s is not a directory, aborting" "$lintian_data" >&2 exit 1 } readonly workdir="$(mktemp -d)" cleanup () { [ ! -d "$workdir" ] || rm -rf "$workdir" }; trap cleanup EXIT mirror="${DEB_MIRROR:=http://i386-geomirror.debian.net/debian}" WGET_ARGS="${WGET_ARGS:=-nv}" wget() { echo wget "$mirror"/"$1" /usr/bin/wget $WGET_ARGS -O "$workdir/$(basename "$1")" "$mirror"/"$1" } mkdir -p "$lintian_data/files" cat > "$workdir/fonts" <> "$workdir/fonts" # Fonts in xfonts-tipa are really shipped by tipa. sed -i 's/ xfonts-tipa$/ tipa/g' "$workdir/fonts" mv "$workdir/fonts" "$lintian_data/files/fonts" # Local Variables: # indent-tabs-mode: nil # End: # vim: syntax=sh sw=4 sts=4 sr et