#!/bin/ash -efu
#
# mki-cache-copy-subdirs
#
# This file is part of mkimage
# Copyright (C) 2007-2009  Alexey Gladkov <gladkov.alexey@gmail.com>
#
# This file is covered by the GNU General Public License,
# which should be included with mkimage as the file COPYING.
#

subdirs="${SUBDIRS:?subdirectories required}"

payload() {
	local d

	stat --printf='%A\t%s\t%Y\n' "$makefile"

	for d in $subdirs; do
		[ -d "$curdir/$d/$workdirname/$outdirname" ] ||
			continue

		cd "$curdir/$d/$workdirname/$outdirname"
		find -mindepth 1 -printf '%M\t%s\t%T@\t%p\n'
		cd - >/dev/null
	done
}
