have different dists
[camarabuntu.git] / dban / dban-1.0.7 / update-copyright.sh
blob4db451a286f6893b773f7e3adc2093be88c03e83
1 #!/bin/sh
3 # Update the copyright files for utilities that are bundled in the DBAN source
4 # tarball. This script assumes a Debian system, which is where I usually work.
6 if [ ! -e /etc/debian_version ]
7 then
8 echo "Error: This script is intended for Debian systems."
9 exit 1
12 for i in `ls ./bin/*`
15 DBAN_BASENAME=$(basename "$i")
16 DBAN_WHICH=$(which "$DBAN_BASENAME")
18 # Check whether a package specifically provides the file.
19 DBAN_PACKAGE=$(dpkg -S $DBAN_WHICH | cut -f1 -d:)
21 if [ "X$DBAN_PACKAGE" == "X" ]
22 then
23 # Just use the first package that provides the name.
24 DBAN_PACKAGE="`dpkg -S $DBAN_BASENAME | cut -f1 -d: | head -n1`"
27 if [ "X$DBAN_PACKAGE" != "X" ]
28 then
29 mkdir -v -p "./doc/$DBAN_PACKAGE"
30 cp -v "/usr/share/doc/$DBAN_PACKAGE/copyright" "./doc/$DBAN_PACKAGE/"
33 done
35 # eof