Please replace all assignments of DIROPTIONS by diropts() calls. See tracker bug 566478 for an explanation and policy references.
I'm confused, dodir doesn't use DIROPTIONS at all, unless I'm missing something. It seems to make it, but I don't understand why at the moment.
I've replaced DIROPTIONS by diropts call