summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/deb/deblistparser.cc5
-rw-r--r--apt-pkg/tagfile-keys.list1
-rw-r--r--apt-pkg/tagfile-order.c2
-rw-r--r--ftparchive/writer.cc14
-rwxr-xr-xtest/integration/test-apt-tagfile-fields-order2
5 files changed, 3 insertions, 21 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index 2f0ebaa7b..a1247dd98 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -241,10 +241,7 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver)
return false;
if (ParseDepends(Ver,pkgTagSection::Key::Enhances,pkgCache::Dep::Enhances) == false)
return false;
- // Obsolete.
- if (ParseDepends(Ver,pkgTagSection::Key::Optional,pkgCache::Dep::Suggests) == false)
- return false;
-
+
if (ParseProvides(Ver) == false)
return false;
if (not APT::KernelAutoRemoveHelper::getUname(Ver.ParentPkg().Name()).empty())
diff --git a/apt-pkg/tagfile-keys.list b/apt-pkg/tagfile-keys.list
index a93052c2f..4b57e46c2 100644
--- a/apt-pkg/tagfile-keys.list
+++ b/apt-pkg/tagfile-keys.list
@@ -42,7 +42,6 @@ Installed-Size
Maintainer
MD5sum
Multi-Arch
-Optional
Origin
Original-Maintainer
Package
diff --git a/apt-pkg/tagfile-order.c b/apt-pkg/tagfile-order.c
index 510d6dd95..445961abe 100644
--- a/apt-pkg/tagfile-order.c
+++ b/apt-pkg/tagfile-order.c
@@ -46,7 +46,7 @@ static const char *iTFRewritePackageOrder[] = {
"Recommends",
"Recommended", // NO_KEY: dpkg nickname for Recommends
"Suggests",
- "Optional", // dpkg nickname for Suggests
+ "Optional", // NO_KEY: dpkg nickname for Suggests
"Conflicts",
"Breaks",
"Replaces",
diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc
index 5dcb98c9c..e5565fa47 100644
--- a/ftparchive/writer.cc
+++ b/ftparchive/writer.cc
@@ -486,7 +486,6 @@ bool PackagesWriter::DoPackage(string FileName)
Changes.push_back(pkgTagSection::Tag::Rewrite("Filename", NewFileName));
Changes.push_back(pkgTagSection::Tag::Rewrite("Priority", OverItem->Priority));
Changes.push_back(pkgTagSection::Tag::Remove("Status"));
- Changes.push_back(pkgTagSection::Tag::Remove("Optional"));
string DescriptionMd5;
if (LongDescription == false) {
@@ -514,19 +513,6 @@ bool PackagesWriter::DoPackage(string FileName)
if (NewMaint.empty() == false)
Changes.push_back(pkgTagSection::Tag::Rewrite("Maintainer", NewMaint));
- /* Get rid of the Optional tag. This is an ugly, ugly, ugly hack that
- dpkg-scanpackages does. Well sort of. dpkg-scanpackages just does renaming
- but dpkg does this append bit. So we do the append bit, at least that way the
- status file and package file will remain similar. There are other transforms
- but optional is the only legacy one still in use for some lazy reason. */
- string OptionalStr = Tags.FindS("Optional");
- if (OptionalStr.empty() == false)
- {
- if (Tags.FindS("Suggests").empty() == false)
- OptionalStr = Tags.FindS("Suggests") + ", " + OptionalStr;
- Changes.push_back(pkgTagSection::Tag::Rewrite("Suggests", OptionalStr));
- }
-
for (map<string,string>::const_iterator I = OverItem->FieldOverride.begin();
I != OverItem->FieldOverride.end(); ++I)
Changes.push_back(pkgTagSection::Tag::Rewrite(I->first, I->second));
diff --git a/test/integration/test-apt-tagfile-fields-order b/test/integration/test-apt-tagfile-fields-order
index d7bf0d137..54e545c8a 100755
--- a/test/integration/test-apt-tagfile-fields-order
+++ b/test/integration/test-apt-tagfile-fields-order
@@ -38,7 +38,7 @@ comparelsts() {
grep -v '^#' "${SOURCEDIRECTORY}/apt-pkg/tagfile-keys.list" > tagfile-keys.list
# Hardcoding this is a bit silly, but it might help preventing issues…
msgtest 'File is append only: do not sort, remove or insert keys in' 'tagfile-keys.list'
-testequal --nomsg 'Version' sed '73q;d' tagfile-keys.list
+testequal --nomsg 'Version' sed '72q;d' tagfile-keys.list
msgtest 'List has fewer entries than pkgTagSection buckets' 'tagfile-keys.list'
ENTRIES_LIST="$(wc -l tagfile-keys.list | cut -d' ' -f 1)"