[backend] refactor rebuildmethod
[backend] guess repotype from binarytype