summaryrefslogtreecommitdiff
blob: 0439c1c81eb2a4eed7dd9d48dfd0c21476ad7795 (plain)
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
#!/bin/bash

SOURCE_DIR=$1
IGNORE_LIST=$2

if [[ ! -d ${SOURCE_DIR} ]]; then
	SOURCE_DIR=/usr/portage
	IGNORE_LIST=$1
fi

if [[ ! -f ${IGNORE_LIST} ]]; then
	IGNORE_LIST=doc/ignore_lists/portage
fi

echo ebuild listed in ${IGNORE_LIST} are ignored
echo the following ebuild are not in ${SOURCE_DIR}

IGNORED_EBUILD="$(cat ${IGNORE_LIST})"

for EBUILD in $(find . -name "*.ebuild" -a -not -path "./main_tree*"); do
	if [[ ! -f ${SOURCE_DIR}/${EBUILD} ]]; then
		EBUILDS_NOT_IN_SOURCE="${EBUILDS_NOT_IN_SOURCE} ${EBUILD}"
	fi
done

for EBUILD in ${IGNORED_EBUILD}; do
#	EBUILDS_NOT_IN_SOURCE="${EBUILDS_NOT_IN_SOURCE/"${EBUILD}"/}"
	EBUILDS_NOT_IN_SOURCE=$(echo -e "${EBUILDS_NOT_IN_SOURCE}" | sed "s@${EBUILD}@@" )
done

EBUILDS_NOT_IN_SOURCE="$(tr ' ' '\n' <<< "${EBUILDS_NOT_IN_SOURCE}" | sort -u)"

echo -e "${EBUILDS_NOT_IN_SOURCE}"