#!/bin/sh #################### # Copyright (C) 2008, 2010 by 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 -eu if [ -z "${1:-}" ]; then printf "Usage: %s path/to/lintian/data\n" \ "$(basename "$0")" cat <&2 exit 1 } readonly workdir="$(mktemp -d)" cleanup () { [ ! -d "$workdir" ] || rm -rf "$workdir" }; trap cleanup EXIT cat > "$workdir/virtual_facilities" < entries cat entries \ | perl -p -w -E 's#'"$perl_regex"'#$1#g;' \ | LC_ALL=C sort -u > packages wget dists/sid/main/binary-i386/Packages.gz gunzip Packages.gz for package in $(cat packages); do fn="$(grep-dctrl -n -P -X "$package" -sFilename Packages)" wget "$fn" file="$(basename "$fn")" dpkg-deb -x "$file" "$(mktemp -d -p .)" rm -rf "$file" find */ | grep -Ev '^[^/]+/etc/insserv.+$' \ | xargs rm >/dev/null 2>&1 || true find */ -type l -print | xargs rm >/dev/null 2>&1 || true done sed -nr '/^\$/{s/\s.*$//;p}' */etc/insserv.conf */etc/insserv.conf.d/* | sort -u >> virtual_facilities mv virtual_facilities "$lintian_data/init.d/" # Local Variables: # indent-tabs-mode: nil # End: # vim: syntax=sh sw=4 sts=4 sr et