I took at look at the webrev; it looks okay. Thanks for cleaning up the misuse of $PDIR, $PF, $DIR, and $F. And thanks for the summary writeup in Bugzilla!
I did notice some (pre-existing) cruftiness in the build_old_new* functions. First wart: build_old_new gets passed in $olddir, $newdir, $DIR, and $F, but not $PDIR or $PF. Second wart: not all the build_old_new* functions use the arguments they're given. In particular, build_old_new_teamware just goes ahead and uses the globals. I'd like to see this cleaned up, but I don't think it needs to be done immediately. So your choice: you can fix this stuff now if you want. Otherwise, please file a bug. I think priority=P3 and milestone="ON migration" are appropriate. I'm not sure what the right cleanup is. Using function parameters and local variables seems cleaner, but it's real easy to accidentally use a global instead of a parameter, at which point we haven't really gained anything. (And in fact we might have made things even more confusing.) So if there's some way to make DIR, PDIR, F, and PF local to the loop, I'd favor using the function parameters for everything. If not, I'd get rid of the function parameters and just use the globals for DIR, PDIR, F, and PF; and maybe olddir and newdir, too. mike