static public String generalizeVersion(String v) {
        if (v==null)
            return "*";
        String[] vs=v.split(".");
        int ix=v.length()-1;
        if(ix<=1)
            return "*";
        while(ix>0 && vs[ix].equals("*"))
            ix--; // skip any * fields starting from the end
        String new_v="";
        for(int i=0;i<ix;i++) { // copy all fields up to but not including this
            new_v += vs[ix]+"."; 
        }
        new_v+="*"; // last field is a *
        return new_v;
    }