EG install scripts: handle translation packages more elegantly
[sitka/sitka-tools.git] / marc_export_custom / stats.sh
CommitLineData
8ec81273 1#!/bin/bash
e38e56a8 2basedir=$(readlink -f $(dirname $0))
7716c3a7 3files=$(ls *.marc.bz2 *.marc 2>/dev/null |grep -v split |sed 's,\.bz2,,g' | sort | uniq)
8ec81273 4for i in $files; do
c91db487
RJ
5 s=${i}.stats
6 j=${i}.bz2
8ec81273
RJ
7 [ -f $s ] && continue
8 echo === $i
9 if [ -f $j -a ! -f $i ]; then
10 bunzip2 -k $j
11 fi
12 if [ -f $i -a ! -f $j ]; then
2ec1922a 13 pbzip2 -9k -p4 $i
8ec81273
RJ
14 fi
15 if [ ! -f $i -o ! -f $j ]; then
16 echo "Missing $i or $j"
17 continue
18 fi
7716c3a7
RJ
19 echo -n '' >$s
20 $basedir/stats-distribution.pl $i | tee $s-holding-distribution.csv
21 ls -la $i $j | tee -a $s
8ec81273
RJ
22 sha1sum $i $j | tee -a $s
23 marcdump --stats --quiet --noprint $i | tee -a ${s}
c91db487 24 [ "$DELETE" != "0" ] && rm -f $i
8ec81273 25done