~ubuntu-branches/ubuntu/trusty/apt/trusty

« back to all changes in this revision

Viewing changes to apt-private/private-output.cc

  • Committer: Package Import Robot
  • Author(s): Michael Vogt
  • Date: 2014-04-01 17:48:58 UTC
  • mfrom: (1.4.87 sid)
  • Revision ID: package-import@ubuntu.com-20140401174858-4mv29mm29zu22fn1
Tags: 1.0.1ubuntu1
merge with the debian/sid 1.0.1 version
(LP: #1302033)

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
#include <apt-pkg/cachefile.h>
8
8
#include <apt-pkg/pkgrecords.h>
9
9
#include <apt-pkg/policy.h>
10
 
 
 
10
#include <apt-pkg/depcache.h>
 
11
#include <apt-pkg/pkgcache.h>
 
12
#include <apt-pkg/cacheiterators.h>
 
13
 
 
14
#include <apt-private/private-output.h>
 
15
#include <apt-private/private-cachefile.h>
 
16
 
 
17
#include <regex.h>
 
18
#include <stdio.h>
 
19
#include <stdlib.h>
 
20
#include <string.h>
11
21
#include <iomanip>
12
22
#include <iostream>
13
 
#include <locale.h>
14
23
#include <langinfo.h>
15
24
#include <unistd.h>
16
25
 
17
 
#include "private-output.h"
18
 
#include "private-cachefile.h"
19
 
 
20
26
#include <apti18n.h>
21
27
                                                                        /*}}}*/
22
28
 
63
69
   return true;
64
70
}
65
71
                                                                        /*}}}*/
66
 
std::string GetArchiveSuite(pkgCacheFile &CacheFile, pkgCache::VerIterator ver) /*{{{*/
 
72
static std::string GetArchiveSuite(pkgCacheFile &/*CacheFile*/, pkgCache::VerIterator ver) /*{{{*/
67
73
{
68
74
   std::string suite = "";
69
75
   if (ver && ver.FileList() && ver.FileList())
82
88
   return suite;
83
89
}
84
90
                                                                        /*}}}*/
85
 
std::string GetFlagsStr(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)/*{{{*/
 
91
static std::string GetFlagsStr(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)/*{{{*/
86
92
{
87
93
   pkgDepCache *DepCache = CacheFile.GetDepCache();
88
94
   pkgDepCache::StateCache &state = (*DepCache)[P];
99
105
   return flags_str;
100
106
}
101
107
                                                                        /*}}}*/
102
 
std::string GetCandidateVersion(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)/*{{{*/
 
108
static std::string GetCandidateVersion(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)/*{{{*/
103
109
{
104
110
   pkgPolicy *policy = CacheFile.GetPolicy();
105
111
   pkgCache::VerIterator cand = policy->GetCandidateVer(P);
107
113
   return cand ? cand.VerStr() : "(none)";
108
114
}
109
115
                                                                        /*}}}*/
110
 
std::string GetInstalledVersion(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)/*{{{*/
 
116
static std::string GetInstalledVersion(pkgCacheFile &/*CacheFile*/, pkgCache::PkgIterator P)/*{{{*/
111
117
{
112
118
   pkgCache::VerIterator inst = P.CurrentVer();
113
119
 
114
120
   return inst ? inst.VerStr() : "(none)";
115
121
}
116
122
                                                                        /*}}}*/
117
 
std::string GetVersion(pkgCacheFile &CacheFile, pkgCache::VerIterator V)/*{{{*/
 
123
static std::string GetVersion(pkgCacheFile &/*CacheFile*/, pkgCache::VerIterator V)/*{{{*/
118
124
{
119
125
   pkgCache::PkgIterator P = V.ParentPkg();
120
126
   if (V == P.CurrentVer())
134
140
   return "(none)";
135
141
}
136
142
                                                                        /*}}}*/
137
 
std::string GetArchitecture(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)/*{{{*/
 
143
static std::string GetArchitecture(pkgCacheFile &CacheFile, pkgCache::PkgIterator P)/*{{{*/
138
144
{
139
145
   pkgPolicy *policy = CacheFile.GetPolicy();
140
146
   pkgCache::VerIterator inst = P.CurrentVer();
141
147
   pkgCache::VerIterator cand = policy->GetCandidateVer(P);
142
 
   
 
148
 
143
149
   return inst ? inst.Arch() : cand.Arch();
144
150
}
145
151
                                                                        /*}}}*/
146
 
std::string GetShortDescription(pkgCacheFile &CacheFile, pkgRecords &records, pkgCache::PkgIterator P)/*{{{*/
 
152
static std::string GetShortDescription(pkgCacheFile &CacheFile, pkgRecords &records, pkgCache::PkgIterator P)/*{{{*/
147
153
{
148
154
   pkgPolicy *policy = CacheFile.GetPolicy();
149
155