gluon-core: clean up upgrade main script