From 8194f97685b4af2bbf0cdbdc88fe5332ad147353 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 20 May 2014 15:08:21 +0200 Subject: add sorting by priority --- apt-pkg/contrib/srvrec.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'apt-pkg/contrib/srvrec.cc') diff --git a/apt-pkg/contrib/srvrec.cc b/apt-pkg/contrib/srvrec.cc index d5d89fc67..352a56970 100644 --- a/apt-pkg/contrib/srvrec.cc +++ b/apt-pkg/contrib/srvrec.cc @@ -12,6 +12,8 @@ #include #include +#include + #include #include "srvrec.h" @@ -89,5 +91,10 @@ bool GetSrvRecords(std::string name, std::vector &Result) Result.push_back(rec); } + // sort them + std::stable_sort(Result.begin(), Result.end()); + + // FIXME: implement weight selection as specified in RFC-2782 + return true; } -- cgit v1.2.3