def add(self, variant, arch, nevra, path, sigkey, category, srpm_nevra=None):
if arch not in productmd.common.RPM_ARCHES:<EOL><INDENT>raise ValueError("<STR_LIT>" % arch)<EOL><DEDENT>if arch in ["<STR_LIT:src>", "<STR_LIT>"]:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if category not in SUPPORTED_CATEGORIES:<EOL><INDENT>raise ValueError("<STR_LIT>" % category)<EOL><DEDENT>if path.startswith("<STR_LIT:/>"):<EOL><INDENT>raise ValueError("<STR_LIT>" % path)<EOL><DEDENT>nevra, nevra_dict = self._check_nevra(nevra)<EOL>if category == "<STR_LIT:source>" and srpm_nevra is not None:<EOL><INDENT>raise ValueError("<STR_LIT>" % nevra)<EOL><DEDENT>if category != "<STR_LIT:source>" and srpm_nevra is None:<EOL><INDENT>raise ValueError("<STR_LIT>" % nevra)<EOL><DEDENT>if (category == "<STR_LIT:source>") != (nevra_dict["<STR_LIT>"] in ("<STR_LIT:src>", "<STR_LIT>")):<EOL><INDENT>raise ValueError("<STR_LIT>" % (category, nevra))<EOL><DEDENT>if sigkey is not None:<EOL><INDENT>sigkey = sigkey.lower()<EOL><DEDENT>if srpm_nevra:<EOL><INDENT>srpm_nevra, _ = self._check_nevra(srpm_nevra)<EOL><DEDENT>else:<EOL><INDENT>srpm_nevra = nevra<EOL><DEDENT>arches = self.rpms.setdefault(variant, {})<EOL>srpms = arches.setdefault(arch, {})<EOL>rpms = srpms.setdefault(srpm_nevra, {})<EOL>rpms[nevra] = {"<STR_LIT>": sigkey, "<STR_LIT:path>": path, "<STR_LIT>": category}<EOL>
Map RPM to to variant and arch.

:param variant: compose variant UID
:type  variant: str
:param arch:    compose architecture
:type  arch:    str
:param nevra:   name-epoch:version-release.arch
:type  nevra:   str
:param sigkey:  sigkey hash
:type  sigkey:  str or None
:param category:    RPM category, one of binary, debug, source
:type  category:    str
:param srpm_nevra:  name-epoch:version-release.arch of RPM's SRPM
:type  srpm_nevra:  str