Name: ~parafin/linux/check_distfiles
Summary: finds corrupt/excess files in /usr/portage/distfiles
Author: parafin
Created: Thu, 29 Oct 2009 23:41:27 GMT
Last update: Fri, 30 Oct 2009 00:05:48 GMT by parafin
Atom feed
Modify access level: moderator

check_distfiles

This script verifies checksums and sizes of all files in /usr/portage/distfiles directory according to portage manifests (/usr/portage/*/*/Manifest) and reports corrupt or excess (eclean-dist also deals with this kind) ones. Proposed usage: rm -i $(./check_distfiles).

Dependencies

  • app-crypt/md5deep

Script assumes that DISTDIR and PORTDIR haven't been changed from default settings and that all overlays reside in /usr/local/portage or somewhere in /usr/portage/.

Code listing

check_distfiles
#!/bin/bash
hashdeep -x $(find /usr/portage/distfiles -maxdepth 1 -type f) -k <(
echo %%%% HASHDEEP-1.0
echo %%%% size,sha1,sha256,filename
find /usr/portage /usr/local/portage -name Manifest -exec grep DIST \{} \; | awk 'OFS="," {print $3,$7,$9,$2}'
)