]> git.ipfire.org Git - thirdparty/squid.git/blob - scripts/remove-cfg.sh
Portability fix: non-GNU diff is not guarranteed to handle the -q switch
[thirdparty/squid.git] / scripts / remove-cfg.sh
1 #!/bin/sh
2
3 # Removes an configuration file if it is identical to the default file,
4 # preventing "make distcheck" failures due to configuration leftovers.
5 # Intended to be used for installed configuration files.
6
7 remover=$1 # the program to remove a file
8 prime=$2 # the configuration file to be removed, including path
9 default=$3 # the default configuration filename, including path
10
11 # by default, use .default default extension
12 if test -z "$default"
13 then
14 default="$prime.default"
15 fi
16
17 # is the primary configuration file present?
18 if test -f $prime
19 then
20 # is the primary config identical to the default?
21 if diff $default $prime > /dev/null
22 then
23 echo " $remover -f $prime";
24 $remover -f $prime;
25 fi
26 fi
27
28 exit 0