Split repo generation from major version of index format

This makes the code easier to understand, if nothing else,
though in principle we could rely on repo generation alone.
The major version check is just extra paranoia.