build/common, build/repositories: fix add_rhn_* functions