summaryrefslogtreecommitdiffstats
path: root/bin/md5check.sh
blob: fc5122a9025c5d8f61e7a8221321c4fbe2d37b8a (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
#!/bin/bash
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

# pipe in the data.

sort -u -                    > md5check.tmp
grep '^Extra'   md5check.tmp > md5check.tmp.extra
grep '^Missing' md5check.tmp > md5check.tmp.missing
grep '^Coll'    md5check.tmp > md5check.tmp.colliding

sed -i "
s:^Col:\nCol:
s:,:\n  :g
s: of :\n  :g
s: and :\n  :g" md5check.tmp.colliding
sed -i "s/^[^ ]\+ md5sum: \(.*\) in \(.*\)$/  \2: \1/g" md5check.tmp.missing
sed -i "s/^[^ ]\+ md5sum: \(.*\) in \(.*\)$/  \2: \1/g" md5check.tmp.extra

#echo "Colliding files:" > md5check.colliding
#sort -u md5check.tmp.colliding >> md5check.colliding
cp md5check.tmp.colliding md5check.colliding

echo "Missing from digest:" > md5check.missing
sort -u md5check.tmp.missing >> md5check.missing

echo "Extra files in digest:" > md5check.extra
sort -u md5check.tmp.extra >> md5check.extra

rm md5check.tmp*