xref: /openbsd/distrib/sets/checkflist (revision cd96d081)
1a1cc089fSrpe#!/bin/sh
2*cd96d081Sderaadt#	$OpenBSD: checkflist,v 1.13 2017/04/17 19:44:59 deraadt Exp $
31f02c04aSderaadt#
41f02c04aSderaadt# Copyright (c) 2001 Theo de Raadt
51f02c04aSderaadt# All rights reserved.
61f02c04aSderaadt#
71f02c04aSderaadt# Redistribution and use in source and binary forms, with or without
81f02c04aSderaadt# modification, are permitted provided that the following conditions
91f02c04aSderaadt# are met:
101f02c04aSderaadt# 1. Redistributions of source code must retain the above copyright
111f02c04aSderaadt#    notice, this list of conditions and the following disclaimer.
121f02c04aSderaadt# 2. Redistributions in binary form must reproduce the above copyright
131f02c04aSderaadt#    notice, this list of conditions and the following disclaimer in the
141f02c04aSderaadt#    documentation and/or other materials provided with the distribution.
151f02c04aSderaadt#
161f02c04aSderaadt# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
171f02c04aSderaadt# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
181f02c04aSderaadt# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
191f02c04aSderaadt# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
201f02c04aSderaadt# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
211f02c04aSderaadt# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
221f02c04aSderaadt# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
231f02c04aSderaadt# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
241f02c04aSderaadt# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
251f02c04aSderaadt# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2648b9bc7bStodd
2726d6c260Sderaadtif [ "X${DESTDIR}" = "X" ]; then
28df930be7Sderaadt	echo DESTDIR must be set
29df930be7Sderaadt	exit 1
3026d6c260Sderaadtfi
31df930be7Sderaadt
32a1cc089fSrpeTMP1=`mktemp /tmp/_ckr.XXXXXXXXXX` || exit 1
33df930be7Sderaadt
34a1cc089fSrpetrap '[ -f "$TMP1" ] && rm -f $TMP1' EXIT
35a1cc089fSrpetrap 'exit' HUP TERM
36a1cc089fSrpe
37a1cc089fSrpearch=`machine`
38a1cc089fSrpe
39a1cc089fSrpefor i in base comp etc game man; do
40a1cc089fSrpe	cat ./lists/$i/mi ./lists/$i/md.${arch}
41*cd96d081Sderaadt	if [ $i = comp ]; then
42*cd96d081Sderaadt		[ -f ./lists/comp/gcc.${arch} ] && \
43*cd96d081Sderaadt		    cat ./lists/comp/gcc.${arch}
44*cd96d081Sderaadt		[ -f ./lists/comp/clang.${arch} ] && \
45*cd96d081Sderaadt		    cat ./lists/comp/clang.${arch}
46*cd96d081Sderaadt	fi
47a1cc089fSrpedone | sort >$TMP1
48a1cc089fSrpe
4979f66708Sderaadt( cd $DESTDIR ; find . \( -type d -o -type f -o -type l \) ) | \
50a1cc089fSrpe    fgrep -vx '.' | sort -H | diff $TMP1 -
51