Просмотр исходного кода

ensure that architectures are not added multiple times

David Kalnischkies лет назад: 14
Родитель
Сommit
dd7233af3e
2 измененных файлов с 5 добавлено и 2 удалено
  1. 3 1
      apt-pkg/aptconfiguration.cc
  2. 2 1
      debian/changelog

+ 3 - 1
apt-pkg/aptconfiguration.cc

@@ -392,7 +392,9 @@ std::vector<std::string> const Configuration::getArchitectures(bool const &Cache
 					if (arch[0] != '\0') {
 						char const* archend = arch;
 						for (; isspace(*archend) == 0 && *archend != '\0'; ++archend);
-						archs.push_back(string(arch, (archend - arch)));
+						string a(arch, (archend - arch));
+						if (std::find(archs.begin(), archs.end(), a) == archs.end())
+							archs.push_back(a);
 					}
 					arch = strtok(NULL, " ");
 				}

+ 2 - 1
debian/changelog

@@ -16,6 +16,7 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low
       in a content-negotation attempt (Closes: #657560)
   * apt-pkg/aptconfiguration.cc:
     - chroot if needed before calling dpkg --print-foreign-architectures
+    - ensure that architectures are not added multiple times
 
   [ Steve Langasek ]
   * cmdline/apt-get.cc:
@@ -38,7 +39,7 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low
   * apt-pkg/contrib/fileutl.h:
     - fix compat with FileFd::OpenDescriptor() in ReadOnlyGzip mode
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Thu, 09 Feb 2012 18:05:34 +0100
+ -- David Kalnischkies <kalnischkies@gmail.com>  Fri, 10 Feb 2012 15:00:10 +0100
 
 apt (0.8.16~exp12) experimental; urgency=low