Long story short, I have a buggy Makefile that is missing a few prerequisite definitions and consequently accidentally relies on the "order" of files on disk (checked out from an SVN repo) as given by their inode number.*
This order seems to have changed after an SVN server migration (and, fair enough, this order is not something someone would deliberately rely upon). But the result is that my builds are broken, because the target that used to be built first (and triggered build of the prerequisite) is now built after other targets (that are erroneously missing that prerequisite).
I can fix the Makefile, but as a workaround for rebuilding older versions of the software (that still contain the Makefile bug), I would like a command or small script to:
- recreate files and directories in ascending filename order
- recursively across subdirectories
- so the end result is inodes increase as filenames increase
Is this even possible?
Bash ideal but Python acceptable.
* I don't actually know that Make is visiting files in inode number, but it's definitely not doing it in alphabetical filename order. It could be modification time, but if so then the question is the same. If the order is completely random then the question is moot anyway. (I appreciate that it's likely to be specified as being arbitrary, but run with it).