shouldn't this go into `src/upgrade.cpp` ?