summaryrefslogtreecommitdiff
path: root/dh_du
blob: c06f9c27b7478cf9a69a56077fe0a930fbde186e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh -e
#
# Generate a DEBIAN/du file, that lists the disk usage of the directories in 
# the package.

PATH=debian:$PATH:/usr/lib/debhelper
. dh_lib

for PACKAGE in $DH_DOPACKAGES; do
	TMP=`tmpdir $PACKAGE`

	if [ ! -d "$TMP/DEBIAN" ]; then
		doit "install -d $TMP/DEBIAN"
	fi

	# Note that the tabs in this next line are important.
	doit "du -k $TMP | sed 's:	$TMP/:	:' | grep -v '	DEBIAN$' | grep -v '	$TMP$' >$TMP/DEBIAN/du"
	doit "chown root.root debian/tmp/DEBIAN/du"
done