summaryrefslogtreecommitdiffstats
path: root/config/chroot_local-hooks/01-check-for-dot-orig-files
blob: d59b8cae4e153f913b873b692e978c3984a82cf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /bin/sh

set -e

echo "Checking for .orig files"

DOT_ORIG_WHITELIST=$(cat <<EOF
/bin/hostname.orig
/etc/resolv.conf.orig
/lib/systemd/system/alsa-utils.service.orig
/sbin/start-stop-daemon.orig
EOF
)

DOT_ORIG_FILES=$(find / -type f -name *.orig | grep -v -F "$DOT_ORIG_WHITELIST" || :)

if [ -n "$DOT_ORIG_FILES" ]; then
    echo "Some patches are fuzzy and leave .orig files around:" >&2
    echo "$DOT_ORIG_FILES" >&2
    exit 1
fi