You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
624 B
17 lines
624 B
11 months ago
|
#!/bin/sh
|
||
|
# Scan the filesystem for orphaned/unused files (super slow because portage-utils doesn't accept stdin)
|
||
|
# Note that this files a *lot* of pre/postinstall files that should(!) exist
|
||
|
tmp1="$(mktemp)"
|
||
|
tmp2="$(mktemp)"
|
||
|
trap "rm -f '$tmp1' '$tmp2'" EXIT
|
||
|
|
||
|
cat orphans_ignore.txt orphans_ignore/*.txt | grep '^/' | sort > "$tmp1"
|
||
|
find /bin /sbin /lib /lib64 /usr > "$tmp2"
|
||
|
|
||
|
grep -xvf "$tmp1" "$tmp2" | xargs -P$(nproc) -d '\n' qfile -o | tee orphans.txt
|
||
|
grep -Fxvf "$tmp2" "$tmp1" | grep -v '\*' | tee orphans_missing.txt
|
||
|
|
||
|
#find /etc | \
|
||
|
#grep -xvf "$tmp" | \
|
||
|
#xargs -P$(nproc) -d '\n' qfile -o | tee orphans.txt
|