]>
Commit | Line | Data |
---|---|---|
e2b88def | 1 | #!/bin/sh |
a151895d | 2 | # |
b8ae064d | 3 | ## Copyright (C) 1996-2023 The Squid Software Foundation and contributors |
a151895d AJ |
4 | ## |
5 | ## Squid software is distributed under GPLv2+ license and includes | |
6 | ## contributions from numerous individuals and organizations. | |
7 | ## Please see the COPYING and CONTRIBUTORS files for details. | |
8 | ## | |
e2b88def AR |
9 | |
10 | # Removes an configuration file if it is identical to the default file, | |
11 | # preventing "make distcheck" failures due to configuration leftovers. | |
12 | # Intended to be used for installed configuration files. | |
13 | ||
14 | remover=$1 # the program to remove a file | |
15 | prime=$2 # the configuration file to be removed, including path | |
16 | default=$3 # the default configuration filename, including path | |
17 | ||
18 | # by default, use .default default extension | |
19 | if test -z "$default" | |
20 | then | |
21 | default="$prime.default" | |
22 | fi | |
23 | ||
24 | # is the primary configuration file present? | |
25 | if test -f $prime | |
26 | then | |
27 | # is the primary config identical to the default? | |
eb192be9 | 28 | if diff $default $prime > /dev/null |
e2b88def AR |
29 | then |
30 | echo " $remover -f $prime"; | |
31 | $remover -f $prime; | |
32 | fi | |
33 | fi | |
34 | ||
35 | exit 0 |