Allow to correct upgrade repos (bnc#889791)

Old style client. Writing proper tests would mean quite a big refactoring (believe me, I started doing it), which looks like a too big change for maintenance (most likely to be distributed as DUD for SLE12). I agreed with @kobliha that in order to merge it should be manually tested by me (already done) and another person.

So I'm not only looking for code review but also for manual testing.
Just a note: "name" is not unique, it's just any string displayed to user (kind of long name), "alias" is the actual ID of the repo (a short name, it has to be uniqe, it is the repository identifier).

IMHO "alias" should used here instead of name...