uint deps_add(struct deps *deps, const char *name, int flags, const char *vers) { uint epoch = 0; char *v = NULL, *r = NULL, buf[1000]; if (vers && *vers) { buf[sizeof (buf) - 1] = '\0'; strncpy(buf, vers, sizeof (buf) - 1); v = parse_epoch(buf, &epoch); r = parse_ver(v); } return deps_add_evr(deps, name, flags, epoch, v, r); }
const Schema & get_schema (boost::string_ref str_ver) { if (auto ver = parse_ver (str_ver)) return get_schema (*ver); throw std::runtime_error ("Unknown fix version: " + str_ver.to_string ()); }