File: pre_remove_50_find_missing_copyright

package info (click to toggle)
piuparts 0.62
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 1,692 kB
  • sloc: python: 6,823; sh: 2,194; makefile: 126
file content (43 lines) | stat: -rwxr-xr-x 1,272 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
set -e

failed=
for pkg in ${PIUPARTS_OBJECTS%%=*}
do
	# ignore failures for some old packages with many rdepends
	ignore=
	case "${pkg}_${PIUPARTS_DISTRIBUTION}" in
		gij_lenny)			ignore=1 ;;
		gnumeric-common_lenny)		ignore=1 ;;  #554201
		libuim6_lenny)			ignore=1 ;;  #554204
		libuim-data_lenny)		ignore=1 ;;  #554200
		mozilla-plugin-vlc_lenny)	ignore=1 ;;  #687657
		postgresql-8.3-plsh_lenny)	ignore=1 ;;  # removed after lenny
		vlc_lenny)			ignore=1 ;;  #687657
		cdd-common_squeeze)		ignore=1 ;;  #692946
		libfbclient2_squeeze)		ignore=1 ;;  #692948
		libcucul0_wheezy)		ignore=1 ;;  # removed
	esac

	# skip check if the package is not installed
	dpkg-query -s "$pkg" >/dev/null 2>&1 || continue
	status="$(dpkg-query -W -f '${Status}' $pkg)"
	test "$status" != "unknown ok not-installed" || continue
	test "$status" != "deinstall ok config-files" || continue

	docdir="/usr/share/doc/$pkg"
	copyright="$docdir/copyright"
	if [ ! -f "$copyright" ]
	then
		if [ -n "$ignore" ]; then
			echo "ignoring failure of $pkg on $PIUPARTS_DISTRIBUTION"
		else
			failed="$failed $copyright"
		fi
		echo "MISSING COPYRIGHT FILE: $copyright"
		echo "# ls -lad $docdir"
		ls -lad "$docdir" || true
		echo "# ls -la $docdir/"
		ls -la "$docdir/" || true
	fi
done