#!/bin/bash
# diff old and new logs to validate conversion
# set -x
# set -e
cd ~/irclogs

IFS=$'\n'

find -maxdepth 1 -type d | while read -r tag; do
  (
    cd "$tag"
    find -maxdepth 1 -iname '#*.log' | while read -r chanlog; do
      chan="$( basename $chanlog .log )"
      diff -puN <( grep -va ^--- "$chanlog" ) <(xzcat "$chan"/*.xz | grep -av ^--- ) || ( echo "$tag" "$chan" ) #&& exit 2 )
    done
  )
done


