Skip to content

Commit 3a30d11

Browse files
check_world_deps.sh: upgraded
1 parent b46d4b3 commit 3a30d11

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

check_world_deps.sh

+21-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
#!/bin/bash
22

3-
while read i ; do \
4-
if [[ -n "$(qdepends -Q $i)" ]]; then \
5-
echo '' ; echo 'checking '$i ;
6-
if [[ -n "$(emerge -p --quiet --depclean $i)" ]]; then \
7-
echo $i' needs to stay in @world'
8-
else
9-
echo $i' can be deselected'
10-
echo $i >> /tmp/deselect
11-
fi
3+
set -x
4+
5+
world_file='/var/lib/portage/world'
6+
deselect='/tmp/deselect'
7+
8+
while read package ; do
9+
printf "${package}: "
10+
check=$(qdepends -Q ${package} 2>&1)
11+
if [[ -n ${check} ]]; then
12+
if [[ ${check} == *'no matches found'* ]]; then
13+
printf "No matches found for your query\n"
14+
else
15+
emerge_check=$(emerge -p --quiet --depclean ${package} 2>&1)
16+
if [[ -n ${emerge_check} ]]; then
17+
printf "Needs to stay in @world\n"
18+
else
19+
printf "Can be deselected\n"
20+
printf "${package}\n" >> ${deselect}
21+
fi
1222
fi
13-
done < /var/lib/portage/world
23+
fi
24+
done < ${world_file}

0 commit comments

Comments
 (0)