public RPMInfo resolve(RPMRequest req) throws Exception {
        loadRepoInfo();

        List<RPMInfo> rpms=rpmInfo.get(req.name);
        if(rpms!=null&&!rpms.isEmpty()) {
            RPMInfo resolved=null;
            for(RPMInfo info:rpms) {
                if(req.arch==null||info.arch.equals(req.arch)) {
                    if(resolved==null) {
                        if(info.isMatch(req))
                            resolved=info;
                    }  else {
                        Boolean b=info.betterMatch(resolved,req);
                        if(b!=null&&b)
                            resolved=info;
                    }
                }
            }
            return resolved;
        } else
            return null;
    }