Browse Source

Initial commit

master
mid-kid 12 months ago
commit
f6cab96748
  1. 3
      check.sh
  2. 16
      orphans.sh
  3. 23
      orphans_ignore.txt
  4. 3
      orphans_ignore/app-vim_gentoo-syntax.txt
  5. 2
      orphans_ignore/dev-lang_mono.txt
  6. 39
      orphans_ignore/dev-lang_perl.txt
  7. 3
      orphans_ignore/dev-libs_nss.txt
  8. 1
      orphans_ignore/dev-perl_XML-SAX.txt
  9. 3
      orphans_ignore/dev-perl_libwww-perl.txt
  10. 1
      orphans_ignore/eselect_arptables.txt
  11. 57
      orphans_ignore/eselect_binutils.txt
  12. 3
      orphans_ignore/eselect_compiler-shadow.txt
  13. 2
      orphans_ignore/eselect_ctags.txt
  14. 3
      orphans_ignore/eselect_ebtables.txt
  15. 30
      orphans_ignore/eselect_gcc.txt
  16. 7
      orphans_ignore/eselect_iptables.txt
  17. 4
      orphans_ignore/eselect_lua.txt
  18. 1
      orphans_ignore/eselect_notify-send.txt
  19. 1
      orphans_ignore/eselect_pinentry.txt
  20. 1
      orphans_ignore/eselect_python.txt
  21. 11
      orphans_ignore/eselect_rust.txt
  22. 6
      orphans_ignore/eselect_vi.txt
  23. 1
      orphans_ignore/media-gfx_graphviz.txt
  24. 1
      orphans_ignore/sys-apps_gawk.txt
  25. 3
      orphans_ignore/sys-apps_openrc.txt
  26. 1
      orphans_ignore/sys-libs_glibc.txt

3
check.sh

@ -0,0 +1,3 @@
#!/bin/sh
# Check the files in the filesystem against what is recorded in the package database
qcheck -vPB | tee check.txt

16
orphans.sh

@ -0,0 +1,16 @@
#!/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

23
orphans_ignore.txt

@ -0,0 +1,23 @@
/lib/modules
/lib/modules/.*
/lib/rc/cache
/lib/rc/cache/.*
/usr/lib/locale/locale-archive
/usr/local
/usr/local/.*
/usr/portage
/usr/portage/.*
/usr/share/applications/mimeinfo.cache
/usr/share/binutils-data/[^/]*/[^/]*/info/dir
/usr/share/fonts/.*\.uuid
/usr/share/fonts/[^/]*/encodings.dir
/usr/share/fonts/[^/]*/fonts.dir
/usr/share/fonts/[^/]*/fonts.scale
/usr/share/gcc-data/[^/]*/[^/]*/info/dir
/usr/share/icons/[^/]*/icon-theme.cache
/usr/share/info/dir
/usr/share/mime
/usr/share/mime/.*
/usr/src
/usr/src/.*
/usr/tmp

3
orphans_ignore/app-vim_gentoo-syntax.txt

@ -0,0 +1,3 @@
/usr/share/vim/vim90/doc/gentoo-syntax.txt
/usr/share/vim/vim90/doc/tags
/usr/share/vim/vim90/doc/eselect-syntax.txt

2
orphans_ignore/dev-lang_mono.txt

@ -0,0 +1,2 @@
/usr/share/.mono
/usr/share/.mono/.*

39
orphans_ignore/dev-lang_perl.txt

@ -0,0 +1,39 @@
/usr/bin/corelist
/usr/bin/cpan
/usr/bin/enc2xs
/usr/bin/instmodsh
/usr/bin/json_pp
/usr/bin/perldoc
/usr/bin/piconv
/usr/bin/pod2man
/usr/bin/pod2text
/usr/bin/pod2usage
/usr/bin/podchecker
/usr/bin/podselect
/usr/bin/prove
/usr/bin/ptar
/usr/bin/ptardiff
/usr/bin/ptargrep
/usr/bin/shasum
/usr/bin/xsubpp
/usr/bin/zipdetails
/usr/share/man/man1/corelist.1.bz2
/usr/share/man/man1/cpan.1.bz2
/usr/share/man/man1/enc2xs.1.bz2
/usr/share/man/man1/instmodsh.1.bz2
/usr/share/man/man1/json_pp.1.bz2
/usr/share/man/man1/perldoc.1.bz2
/usr/share/man/man1/perlpodstyle.1.bz2
/usr/share/man/man1/piconv.1.bz2
/usr/share/man/man1/pod2man.1.bz2
/usr/share/man/man1/pod2text.1.bz2
/usr/share/man/man1/pod2usage.1.bz2
/usr/share/man/man1/podchecker.1.bz2
/usr/share/man/man1/podselect.1.bz2
/usr/share/man/man1/prove.1.bz2
/usr/share/man/man1/ptar.1.bz2
/usr/share/man/man1/ptardiff.1.bz2
/usr/share/man/man1/ptargrep.1.bz2
/usr/share/man/man1/shasum.1.bz2
/usr/share/man/man1/xsubpp.1.bz2
/usr/share/man/man1/zipdetails.1.bz2

3
orphans_ignore/dev-libs_nss.txt

@ -0,0 +1,3 @@
/usr/lib64/libnssdbm3.chk
/usr/lib64/libsoftokn3.chk
/usr/lib64/libfreebl3.chk

1
orphans_ignore/dev-perl_XML-SAX.txt

@ -0,0 +1 @@
/usr/lib64/perl5/vendor_perl/[^/]*/XML/SAX/ParserDetails.ini

3
orphans_ignore/dev-perl_libwww-perl.txt

@ -0,0 +1,3 @@
/usr/bin/HEAD
/usr/bin/POST
/usr/bin/GET

1
orphans_ignore/eselect_arptables.txt

@ -0,0 +1 @@
/sbin/arptables

57
orphans_ignore/eselect_binutils.txt

@ -0,0 +1,57 @@
/usr/bin/addr2line
/usr/bin/ar
/usr/bin/as
/usr/bin/c++filt
/usr/bin/dwp
/usr/bin/elfedit
/usr/bin/gprof
/usr/bin/ld
/usr/bin/ld.bfd
/usr/bin/ld.gold
/usr/bin/nm
/usr/bin/objcopy
/usr/bin/objdump
/usr/bin/ranlib
/usr/bin/readelf
/usr/bin/size
/usr/bin/strings
/usr/bin/strip
/usr/bin/x86_64-pc-linux-gnu-addr2line
/usr/bin/x86_64-pc-linux-gnu-ar
/usr/bin/x86_64-pc-linux-gnu-as
/usr/bin/x86_64-pc-linux-gnu-c++filt
/usr/bin/x86_64-pc-linux-gnu-dwp
/usr/bin/x86_64-pc-linux-gnu-elfedit
/usr/bin/x86_64-pc-linux-gnu-gprof
/usr/bin/x86_64-pc-linux-gnu-ld
/usr/bin/x86_64-pc-linux-gnu-ld.bfd
/usr/bin/x86_64-pc-linux-gnu-ld.gold
/usr/bin/x86_64-pc-linux-gnu-nm
/usr/bin/x86_64-pc-linux-gnu-objcopy
/usr/bin/x86_64-pc-linux-gnu-objdump
/usr/bin/x86_64-pc-linux-gnu-ranlib
/usr/bin/x86_64-pc-linux-gnu-readelf
/usr/bin/x86_64-pc-linux-gnu-size
/usr/bin/x86_64-pc-linux-gnu-strings
/usr/bin/x86_64-pc-linux-gnu-strip
/usr/x86_64-pc-linux-gnu/bin
/usr/x86_64-pc-linux-gnu/bin/addr2line
/usr/x86_64-pc-linux-gnu/bin/ar
/usr/x86_64-pc-linux-gnu/bin/as
/usr/x86_64-pc-linux-gnu/bin/c++filt
/usr/x86_64-pc-linux-gnu/bin/dwp
/usr/x86_64-pc-linux-gnu/bin/elfedit
/usr/x86_64-pc-linux-gnu/bin/gprof
/usr/x86_64-pc-linux-gnu/bin/ld
/usr/x86_64-pc-linux-gnu/bin/ld.bfd
/usr/x86_64-pc-linux-gnu/bin/ld.gold
/usr/x86_64-pc-linux-gnu/bin/nm
/usr/x86_64-pc-linux-gnu/bin/objcopy
/usr/x86_64-pc-linux-gnu/bin/objdump
/usr/x86_64-pc-linux-gnu/bin/ranlib
/usr/x86_64-pc-linux-gnu/bin/readelf
/usr/x86_64-pc-linux-gnu/bin/size
/usr/x86_64-pc-linux-gnu/bin/strings
/usr/x86_64-pc-linux-gnu/bin/strip
/usr/x86_64-pc-linux-gnu/lib
/usr/x86_64-pc-linux-gnu/lib/ldscripts

3
orphans_ignore/eselect_compiler-shadow.txt

@ -0,0 +1,3 @@
/usr/lib/ccache
/usr/lib/ccache/bin
/usr/lib/ccache/bin/.*

2
orphans_ignore/eselect_ctags.txt

@ -0,0 +1,2 @@
/usr/bin/ctags
/usr/share/man/man1/ctags.1.bz2

3
orphans_ignore/eselect_ebtables.txt

@ -0,0 +1,3 @@
/sbin/ebtables-save
/sbin/ebtables-restore
/sbin/ebtables

30
orphans_ignore/eselect_gcc.txt

@ -0,0 +1,30 @@
/lib/cpp
/usr/bin/c++
/usr/bin/cc
/usr/bin/cpp
/usr/bin/g++
/usr/bin/gcc
/usr/bin/gcc-ar
/usr/bin/gcc-nm
/usr/bin/gcc-ranlib
/usr/bin/gcov
/usr/bin/gcov-dump
/usr/bin/gcov-tool
/usr/bin/gfortran
/usr/bin/lto-dump
/usr/bin/x86_64-pc-linux-gnu-c++
/usr/bin/x86_64-pc-linux-gnu-cc
/usr/bin/x86_64-pc-linux-gnu-cpp
/usr/bin/x86_64-pc-linux-gnu-g++
/usr/bin/x86_64-pc-linux-gnu-gcc
/usr/bin/x86_64-pc-linux-gnu-gcc-ar
/usr/bin/x86_64-pc-linux-gnu-gcc-nm
/usr/bin/x86_64-pc-linux-gnu-gcc-ranlib
/usr/bin/x86_64-pc-linux-gnu-gcov
/usr/bin/x86_64-pc-linux-gnu-gcov-dump
/usr/bin/x86_64-pc-linux-gnu-gcov-tool
/usr/bin/x86_64-pc-linux-gnu-gfortran
/usr/bin/x86_64-pc-linux-gnu-lto-dump
/usr/x86_64-pc-linux-gnu/binutils-bin/lib
/usr/x86_64-pc-linux-gnu/binutils-bin/lib/bfd-plugins
/usr/x86_64-pc-linux-gnu/binutils-bin/lib/bfd-plugins/liblto_plugin.so

7
orphans_ignore/eselect_iptables.txt

@ -0,0 +1,7 @@
/sbin/ip6tables
/sbin/ip6tables-restore
/sbin/ip6tables-save
/sbin/iptables
/sbin/iptables-restore
/sbin/iptables-save
/sbin/iptables-xml

4
orphans_ignore/eselect_lua.txt

@ -0,0 +1,4 @@
/usr/bin/lua
/usr/bin/luac
/usr/share/man/man1/lua.1.bz2
/usr/share/man/man1/luac.1.bz2

1
orphans_ignore/eselect_notify-send.txt

@ -0,0 +1 @@
/usr/bin/notify-send

1
orphans_ignore/eselect_pinentry.txt

@ -0,0 +1 @@
/usr/bin/pinentry

1
orphans_ignore/eselect_python.txt

@ -0,0 +1 @@
/usr/share/man/man1/python.1

11
orphans_ignore/eselect_rust.txt

@ -0,0 +1,11 @@
/usr/bin/cargo
/usr/bin/rust-gdb
/usr/bin/rust-gdbgui
/usr/bin/rust-lldb
/usr/bin/rustc
/usr/bin/rustdoc
/usr/lib/rust/lib
/usr/lib/rust/libexec
/usr/lib/rust/man
/usr/lib/rustlib
/usr/share/doc/rust

6
orphans_ignore/eselect_vi.txt

@ -0,0 +1,6 @@
/usr/bin/ex
/usr/bin/vi
/usr/bin/view
/usr/share/man/man1/ex.1.bz2
/usr/share/man/man1/vi.1.bz2
/usr/share/man/man1/view.1.bz2

1
orphans_ignore/media-gfx_graphviz.txt

@ -0,0 +1 @@
/usr/lib64/graphviz/config6

1
orphans_ignore/sys-apps_gawk.txt

@ -0,0 +1 @@
/usr/share/man/man1/awk.1.bz2

3
orphans_ignore/sys-apps_openrc.txt

@ -0,0 +1,3 @@
/lib/rc/console
/lib/rc/console/keymap
/lib/rc/console/unicode

1
orphans_ignore/sys-libs_glibc.txt

@ -0,0 +1 @@
/usr/lib64/gconv/gconv-modules.cache
Loading…
Cancel
Save