#!/bin/sh

THISDIR=`dirname "$0"`

PACKAGE=${1:-"pkg/landfall-examples"}
BASEDIR=`realpath "$THISDIR/.."`

for FILENAME in `find "$PACKAGE" -newer "$BASEDIR/$PACKAGE" -type f` ; do
    if [ `basename "$FILENAME"` != `basename "$FILENAME" .orig` ] ; then
        continue
    fi

    if [ -e "$BASEDIR/$FILENAME" ] ; then
        diff -u "$BASEDIR/$FILENAME" "$FILENAME"
    else
        diff -u /dev/null "$FILENAME"
    fi
done
