From e8fb1cdfdd13e45f2b3abbd57a28b57ae6137f14 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 9 May 2015 18:55:41 +0200 Subject: sync TFRewrite*Order arrays with dpkg and dak dpkg and dak know various field names and order them in their output, while we have yet another order and have to play catch up with them as we are sitting between chairs here and neither order is ideal for us, too. A little testcase is from now on supposed to help ensureing that we do not derivate to far away from which fields dpkg knows and orders. --- apt-pkg/tagfile.cc | 63 +++--------------------------------------------------- 1 file changed, 3 insertions(+), 60 deletions(-) (limited to 'apt-pkg/tagfile.cc') diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 9c40c8c92..2f7900d93 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -623,71 +623,14 @@ APT_PURE unsigned int pkgTagSection::Count() const { /*{{{*/ return d->Tags.size() - 1; } /*}}}*/ + +#include "tagfile-order.c" + // TFRewrite - Rewrite a control record /*{{{*/ // --------------------------------------------------------------------- /* This writes the control record to stdout rewriting it as necessary. The override map item specificies the rewriting rules to follow. This also takes the time to sort the feild list. */ - -/* The order of this list is taken from dpkg source lib/parse.c the fieldinfos - array. */ -static const char *iTFRewritePackageOrder[] = { - "Package", - "Essential", - "Status", - "Priority", - "Section", - "Installed-Size", - "Maintainer", - "Original-Maintainer", - "Architecture", - "Source", - "Version", - "Revision", // Obsolete - "Config-Version", // Obsolete - "Replaces", - "Provides", - "Depends", - "Pre-Depends", - "Recommends", - "Suggests", - "Conflicts", - "Breaks", - "Conffiles", - "Filename", - "Size", - "MD5sum", - "SHA1", - "SHA256", - "SHA512", - "MSDOS-Filename", // Obsolete - "Description", - 0}; -static const char *iTFRewriteSourceOrder[] = {"Package", - "Source", - "Binary", - "Version", - "Priority", - "Section", - "Maintainer", - "Original-Maintainer", - "Build-Depends", - "Build-Depends-Indep", - "Build-Conflicts", - "Build-Conflicts-Indep", - "Architecture", - "Standards-Version", - "Format", - "Directory", - "Files", - 0}; - -/* Two levels of initialization are used because gcc will set the symbol - size of an array to the length of the array, causing dynamic relinking - errors. Doing this makes the symbol size constant */ -const char **TFRewritePackageOrder = iTFRewritePackageOrder; -const char **TFRewriteSourceOrder = iTFRewriteSourceOrder; - bool TFRewrite(FILE *Output,pkgTagSection const &Tags,const char *Order[], TFRewriteData *Rewrite) { -- cgit v1.2.3