#!/bin/sh -ex

# TODO: implement proper $opt_destdir option support

shopt -s nullglob

# note on ./$stage && rm -f $stage are split in two lines:
# -e; if ./$stage fails, we do not get here; ./$stage must be the last for -e to work
set -x

for stage in .git/uupdate/__~.uupdate-step-*.sh ; do
    [ -x $stage ] && ./$stage
    rm -f $stage
done
