updated condition for obtaining a list of dependent packages, taking into account duplicates in the list