improved sort order and handling of os-codename dependencies