1 // -*- mode: cpp; mode: fold -*-
4 Wrappers around std::set to have set::iterators which behave
5 similar to the Iterators of the cache structures.
7 Provides also a few helper methods which work with these sets */
10 #define APT_CACHESET_H
11 // Include Files /*{{{*/
20 #include <apt-pkg/error.h>
21 #include <apt-pkg/pkgcache.h>
27 class PackageContainerInterface
;
28 class VersionContainerInterface
;
30 class CacheSetHelper
{ /*{{{*/
31 /** \class APT::CacheSetHelper
32 Simple base class with a lot of virtual methods which can be overridden
33 to alter the behavior or the output of the CacheSets.
35 This helper is passed around by the static methods in the CacheSets and
36 used every time they hit an error condition or something could be
40 CacheSetHelper(bool const ShowError
= true,
41 GlobalError::MsgType ErrorType
= GlobalError::ERROR
) :
42 ShowError(ShowError
), ErrorType(ErrorType
) {};
43 virtual ~CacheSetHelper() {};
45 virtual void showTaskSelection(pkgCache::PkgIterator
const &pkg
, std::string
const &pattern
);
46 virtual void showRegExSelection(pkgCache::PkgIterator
const &pkg
, std::string
const &pattern
);
47 virtual void showSelectedVersion(pkgCache::PkgIterator
const &Pkg
, pkgCache::VerIterator
const Ver
,
48 std::string
const &ver
, bool const verIsRel
);
50 virtual void canNotFindTask(PackageContainerInterface
* const pci
, pkgCacheFile
&Cache
, std::string pattern
);
51 virtual void canNotFindRegEx(PackageContainerInterface
* const pci
, pkgCacheFile
&Cache
, std::string pattern
);
52 virtual void canNotFindPackage(PackageContainerInterface
* const pci
, pkgCacheFile
&Cache
, std::string
const &str
);
54 virtual void canNotFindAllVer(VersionContainerInterface
* const vci
, pkgCacheFile
&Cache
, pkgCache::PkgIterator
const &Pkg
);
55 virtual void canNotFindInstCandVer(VersionContainerInterface
* const vci
, pkgCacheFile
&Cache
,
56 pkgCache::PkgIterator
const &Pkg
);
57 virtual void canNotFindCandInstVer(VersionContainerInterface
* const vci
,
59 pkgCache::PkgIterator
const &Pkg
);
61 virtual pkgCache::PkgIterator
canNotFindPkgName(pkgCacheFile
&Cache
, std::string
const &str
);
62 virtual pkgCache::VerIterator
canNotFindNewestVer(pkgCacheFile
&Cache
,
63 pkgCache::PkgIterator
const &Pkg
);
64 virtual pkgCache::VerIterator
canNotFindCandidateVer(pkgCacheFile
&Cache
,
65 pkgCache::PkgIterator
const &Pkg
);
66 virtual pkgCache::VerIterator
canNotFindInstalledVer(pkgCacheFile
&Cache
,
67 pkgCache::PkgIterator
const &Pkg
);
69 bool showErrors() const { return ShowError
; };
70 bool showErrors(bool const newValue
) { if (ShowError
== newValue
) return ShowError
; else return ((ShowError
= newValue
) == false); };
71 GlobalError::MsgType
errorType() const { return ErrorType
; };
72 GlobalError::MsgType
errorType(GlobalError::MsgType
const &newValue
)
74 if (ErrorType
== newValue
) return ErrorType
;
76 GlobalError::MsgType
const &oldValue
= ErrorType
;
85 GlobalError::MsgType ErrorType
;
87 class PackageContainerInterface
{ /*{{{*/
88 /** \class PackageContainerInterface
90 * Interface ensuring that all operations can be executed on the yet to
91 * define concrete PackageContainer - access to all methods is possible,
92 * but in general the wrappers provided by the PackageContainer template
95 * This class mostly protects use from the need to write all implementation
96 * of the methods working on containers in the template */
98 class const_iterator
{ /*{{{*/
100 virtual pkgCache::PkgIterator
getPkg() const = 0;
101 operator pkgCache::PkgIterator(void) const { return getPkg(); }
103 inline const char *Name() const {return getPkg().Name(); }
104 inline std::string
FullName(bool const Pretty
) const { return getPkg().FullName(Pretty
); }
105 inline std::string
FullName() const { return getPkg().FullName(); }
106 inline const char *Section() const {return getPkg().Section(); }
107 inline bool Purge() const {return getPkg().Purge(); }
108 inline const char *Arch() const {return getPkg().Arch(); }
109 inline pkgCache::GrpIterator
Group() const { return getPkg().Group(); }
110 inline pkgCache::VerIterator
VersionList() const { return getPkg().VersionList(); }
111 inline pkgCache::VerIterator
CurrentVer() const { return getPkg().CurrentVer(); }
112 inline pkgCache::DepIterator
RevDependsList() const { return getPkg().RevDependsList(); }
113 inline pkgCache::PrvIterator
ProvidesList() const { return getPkg().ProvidesList(); }
114 inline pkgCache::PkgIterator::OkState
State() const { return getPkg().State(); }
115 inline const char *CandVersion() const { return getPkg().CandVersion(); }
116 inline const char *CurVersion() const { return getPkg().CurVersion(); }
117 inline pkgCache
*Cache() const { return getPkg().Cache(); };
118 inline unsigned long Index() const {return getPkg().Index();};
119 // we have only valid iterators here
120 inline bool end() const { return false; };
122 inline pkgCache::Package
const * operator->() const {return &*getPkg();};
126 virtual bool insert(pkgCache::PkgIterator
const &P
) = 0;
127 virtual bool empty() const = 0;
128 virtual void clear() = 0;
130 enum Constructor
{ UNKNOWN
, REGEX
, TASK
};
131 virtual void setConstructor(Constructor
const &con
) = 0;
132 virtual Constructor
getConstructor() const = 0;
134 static bool FromTask(PackageContainerInterface
* const pci
, pkgCacheFile
&Cache
, std::string pattern
, CacheSetHelper
&helper
);
135 static bool FromRegEx(PackageContainerInterface
* const pci
, pkgCacheFile
&Cache
, std::string pattern
, CacheSetHelper
&helper
);
136 static pkgCache::PkgIterator
FromName(pkgCacheFile
&Cache
, std::string
const &pattern
, CacheSetHelper
&helper
);
137 static bool FromString(PackageContainerInterface
* const pci
, pkgCacheFile
&Cache
, std::string
const &pattern
, CacheSetHelper
&helper
);
138 static bool FromCommandLine(PackageContainerInterface
* const pci
, pkgCacheFile
&Cache
, const char **cmdline
, CacheSetHelper
&helper
);
141 enum Position
{ NONE
, PREFIX
, POSTFIX
};
143 const char * const Alias
;
145 Modifier (unsigned short const &id
, const char * const alias
, Position
const &pos
) : ID(id
), Alias(alias
), Pos(pos
) {};
148 static bool FromModifierCommandLine(unsigned short &modID
, PackageContainerInterface
* const pci
,
149 pkgCacheFile
&Cache
, const char * cmdline
,
150 std::list
<Modifier
> const &mods
, CacheSetHelper
&helper
);
153 template<class Container
> class PackageContainer
: public PackageContainerInterface
{/*{{{*/
154 /** \class APT::PackageContainer
156 Simple wrapper around a container class like std::set to provide a similar
157 interface to a set of packages as to the complete set of all packages in the
161 /** \brief smell like a pkgCache::PkgIterator */
162 class const_iterator
: public PackageContainerInterface::const_iterator
,
163 public std::iterator
<std::forward_iterator_tag
, typename
Container::const_iterator
> {/*{{{*/
164 typename
Container::const_iterator _iter
;
166 const_iterator(typename
Container::const_iterator i
) : _iter(i
) {}
167 pkgCache::PkgIterator
getPkg(void) const { return *_iter
; }
168 inline pkgCache::PkgIterator
operator*(void) const { return *_iter
; };
169 operator typename
Container::const_iterator(void) const { return _iter
; }
170 inline void operator++(void) { ++_iter
; };
171 inline bool operator!=(const_iterator
const &i
) const { return _iter
!= i
._iter
; };
172 inline bool operator==(const_iterator
const &i
) const { return _iter
== i
._iter
; };
173 friend std::ostream
& operator<<(std::ostream
& out
, const_iterator i
) { return operator<<(out
, *i
); }
175 // we are not going to allow modify our pkgiterators (it doesn't make sense)…
176 typedef APT::PackageContainer
<Container
>::const_iterator iterator
;
179 bool insert(pkgCache::PkgIterator
const &P
) { if (P
.end() == true) return false; _cont
.insert(P
); return true; };
180 template<class Cont
> void insert(PackageContainer
<Cont
> const &pkgcont
) { _cont
.insert((typename
Cont::const_iterator
)pkgcont
.begin(), (typename
Cont::const_iterator
)pkgcont
.end()); };
181 void insert(const_iterator begin
, const_iterator end
) { _cont
.insert(begin
, end
); };
182 bool empty() const { return _cont
.empty(); };
183 void clear() { return _cont
.clear(); };
184 void erase(iterator position
) { _cont
.erase((typename
Container::const_iterator
)position
); };
185 size_t erase(const pkgCache::PkgIterator x
) { return _cont
.erase(x
); };
186 void erase(iterator first
, iterator last
) { _cont
.erase(first
, last
); };
187 size_t size() const { return _cont
.size(); };
189 const_iterator
begin() const { return const_iterator(_cont
.begin()); };
190 const_iterator
end() const { return const_iterator(_cont
.end()); };
191 const_iterator
find(pkgCache::PkgIterator
const &P
) const { return const_iterator(_cont
.find(P
)); };
193 void setConstructor(Constructor
const &by
) { ConstructedBy
= by
; };
194 Constructor
getConstructor() const { return ConstructedBy
; };
196 PackageContainer() : ConstructedBy(UNKNOWN
) {};
197 PackageContainer(Constructor
const &by
) : ConstructedBy(by
) {};
199 /** \brief returns all packages in the cache who belong to the given task
201 A simple helper responsible for search for all members of a task
202 in the cache. Optional it prints a a notice about the
203 packages chosen cause of the given task.
204 \param Cache the packages are in
205 \param pattern name of the task
206 \param helper responsible for error and message handling */
207 static PackageContainer
FromTask(pkgCacheFile
&Cache
, std::string
const &pattern
, CacheSetHelper
&helper
) {
208 PackageContainer
cont(TASK
);
209 PackageContainerInterface::FromTask(&cont
, Cache
, pattern
, helper
);
212 static PackageContainer
FromTask(pkgCacheFile
&Cache
, std::string
const &pattern
) {
213 CacheSetHelper helper
;
214 return FromTask(Cache
, pattern
, helper
);
217 /** \brief returns all packages in the cache whose name matchs a given pattern
219 A simple helper responsible for executing a regular expression on all
220 package names in the cache. Optional it prints a a notice about the
221 packages chosen cause of the given package.
222 \param Cache the packages are in
223 \param pattern regular expression for package names
224 \param helper responsible for error and message handling */
225 static PackageContainer
FromRegEx(pkgCacheFile
&Cache
, std::string pattern
, CacheSetHelper
&helper
) {
226 PackageContainer
cont(REGEX
);
227 PackageContainerInterface::FromRegEx(&cont
, Cache
, pattern
, helper
);
231 static PackageContainer
FromRegEx(pkgCacheFile
&Cache
, std::string
const &pattern
) {
232 CacheSetHelper helper
;
233 return FromRegEx(Cache
, pattern
, helper
);
236 /** \brief returns a package specified by a string
238 \param Cache the package is in
239 \param pattern String the package name should be extracted from
240 \param helper responsible for error and message handling */
241 static pkgCache::PkgIterator
FromName(pkgCacheFile
&Cache
, std::string
const &pattern
, CacheSetHelper
&helper
) {
242 return PackageContainerInterface::FromName(Cache
, pattern
, helper
);
244 static pkgCache::PkgIterator
FromName(pkgCacheFile
&Cache
, std::string
const &pattern
) {
245 CacheSetHelper helper
;
246 return PackageContainerInterface::FromName(Cache
, pattern
, helper
);
249 /** \brief returns all packages specified by a string
251 \param Cache the packages are in
252 \param pattern String the package name(s) should be extracted from
253 \param helper responsible for error and message handling */
254 static PackageContainer
FromString(pkgCacheFile
&Cache
, std::string
const &pattern
, CacheSetHelper
&helper
) {
255 PackageContainer cont
;
256 PackageContainerInterface::FromString(&cont
, Cache
, pattern
, helper
);
259 static PackageContainer
FromString(pkgCacheFile
&Cache
, std::string
const &pattern
) {
260 CacheSetHelper helper
;
261 return FromString(Cache
, pattern
, helper
);
264 /** \brief returns all packages specified on the commandline
266 Get all package names from the commandline and executes regex's if needed.
267 No special package command is supported, just plain names.
268 \param Cache the packages are in
269 \param cmdline Command line the package names should be extracted from
270 \param helper responsible for error and message handling */
271 static PackageContainer
FromCommandLine(pkgCacheFile
&Cache
, const char **cmdline
, CacheSetHelper
&helper
) {
272 PackageContainer cont
;
273 PackageContainerInterface::FromCommandLine(&cont
, Cache
, cmdline
, helper
);
276 static PackageContainer
FromCommandLine(pkgCacheFile
&Cache
, const char **cmdline
) {
277 CacheSetHelper helper
;
278 return FromCommandLine(Cache
, cmdline
, helper
);
281 /** \brief group packages by a action modifiers
283 At some point it is needed to get from the same commandline
284 different package sets grouped by a modifier. Take
285 apt-get install apt awesome-
287 \param Cache the packages are in
288 \param cmdline Command line the package names should be extracted from
289 \param mods list of modifiers the method should accept
290 \param fallback the default modifier group for a package
291 \param helper responsible for error and message handling */
292 static std::map
<unsigned short, PackageContainer
> GroupedFromCommandLine(
294 const char **cmdline
,
295 std::list
<Modifier
> const &mods
,
296 unsigned short const &fallback
,
297 CacheSetHelper
&helper
) {
298 std::map
<unsigned short, PackageContainer
> pkgsets
;
299 for (const char **I
= cmdline
; *I
!= 0; ++I
) {
300 unsigned short modID
= fallback
;
301 PackageContainer pkgset
;
302 PackageContainerInterface::FromModifierCommandLine(modID
, &pkgset
, Cache
, *I
, mods
, helper
);
303 pkgsets
[modID
].insert(pkgset
);
307 static std::map
<unsigned short, PackageContainer
> GroupedFromCommandLine(
309 const char **cmdline
,
310 std::list
<Modifier
> const &mods
,
311 unsigned short const &fallback
) {
312 CacheSetHelper helper
;
313 return GroupedFromCommandLine(Cache
, cmdline
,
314 mods
, fallback
, helper
);
318 Constructor ConstructedBy
;
321 typedef PackageContainer
<std::set
<pkgCache::PkgIterator
> > PackageSet
;
323 class VersionContainerInterface
{ /*{{{*/
324 /** \class APT::VersionContainerInterface
326 Same as APT::PackageContainerInterface, just for Versions */
328 /** \brief smell like a pkgCache::VerIterator */
329 class const_iterator
{ /*{{{*/
331 virtual pkgCache::VerIterator
getVer() const = 0;
332 operator pkgCache::VerIterator(void) { return getVer(); }
334 inline pkgCache
*Cache() const { return getVer().Cache(); };
335 inline unsigned long Index() const {return getVer().Index();};
336 inline int CompareVer(const pkgCache::VerIterator
&B
) const { return getVer().CompareVer(B
); };
337 inline const char *VerStr() const { return getVer().VerStr(); };
338 inline const char *Section() const { return getVer().Section(); };
339 inline const char *Arch() const { return getVer().Arch(); };
340 inline pkgCache::PkgIterator
ParentPkg() const { return getVer().ParentPkg(); };
341 inline pkgCache::DescIterator
DescriptionList() const { return getVer().DescriptionList(); };
342 inline pkgCache::DescIterator
TranslatedDescription() const { return getVer().TranslatedDescription(); };
343 inline pkgCache::DepIterator
DependsList() const { return getVer().DependsList(); };
344 inline pkgCache::PrvIterator
ProvidesList() const { return getVer().ProvidesList(); };
345 inline pkgCache::VerFileIterator
FileList() const { return getVer().FileList(); };
346 inline bool Downloadable() const { return getVer().Downloadable(); };
347 inline const char *PriorityType() const { return getVer().PriorityType(); };
348 inline std::string
RelStr() const { return getVer().RelStr(); };
349 inline bool Automatic() const { return getVer().Automatic(); };
350 inline pkgCache::VerFileIterator
NewestFile() const { return getVer().NewestFile(); };
351 // we have only valid iterators here
352 inline bool end() const { return false; };
354 inline pkgCache::Version
const * operator->() const { return &*getVer(); };
358 virtual bool insert(pkgCache::VerIterator
const &V
) = 0;
359 virtual bool empty() const = 0;
360 virtual void clear() = 0;
362 /** \brief specifies which version(s) will be returned if non is given */
366 /** Candidate and installed version */
368 /** Candidate version */
370 /** Installed version */
372 /** Candidate or if non installed version */
374 /** Installed or if non candidate version */
376 /** Newest version */
381 enum Position
{ NONE
, PREFIX
, POSTFIX
};
383 const char * const Alias
;
385 Version SelectVersion
;
386 Modifier (unsigned short const &id
, const char * const alias
, Position
const &pos
,
387 Version
const &select
) : ID(id
), Alias(alias
), Pos(pos
),
388 SelectVersion(select
) {};
391 static bool FromCommandLine(VersionContainerInterface
* const vci
, pkgCacheFile
&Cache
,
392 const char **cmdline
, Version
const &fallback
,
393 CacheSetHelper
&helper
);
395 static bool FromString(VersionContainerInterface
* const vci
, pkgCacheFile
&Cache
,
396 std::string pkg
, Version
const &fallback
, CacheSetHelper
&helper
,
397 bool const onlyFromName
= false);
399 static bool FromPackage(VersionContainerInterface
* const vci
, pkgCacheFile
&Cache
,
400 pkgCache::PkgIterator
const &P
, Version
const &fallback
,
401 CacheSetHelper
&helper
);
403 static bool FromModifierCommandLine(unsigned short &modID
,
404 VersionContainerInterface
* const vci
,
405 pkgCacheFile
&Cache
, const char * cmdline
,
406 std::list
<Modifier
> const &mods
,
407 CacheSetHelper
&helper
);
411 /** \brief returns the candidate version of the package
413 \param Cache to be used to query for information
414 \param Pkg we want the candidate version from this package */
415 static pkgCache::VerIterator
getCandidateVer(pkgCacheFile
&Cache
,
416 pkgCache::PkgIterator
const &Pkg
, CacheSetHelper
&helper
);
418 /** \brief returns the installed version of the package
420 \param Cache to be used to query for information
421 \param Pkg we want the installed version from this package */
422 static pkgCache::VerIterator
getInstalledVer(pkgCacheFile
&Cache
,
423 pkgCache::PkgIterator
const &Pkg
, CacheSetHelper
&helper
);
427 template<class Container
> class VersionContainer
: public VersionContainerInterface
{/*{{{*/
428 /** \class APT::PackageContainer
430 Simple wrapper around a container class like std::set to provide a similar
431 interface to a set of versions as to the complete set of all versions in the
435 /** \brief smell like a pkgCache::VerIterator */
436 class const_iterator
: public VersionContainerInterface::const_iterator
,
437 public std::iterator
<std::forward_iterator_tag
, typename
Container::const_iterator
> {/*{{{*/
438 typename
Container::const_iterator _iter
;
440 const_iterator(typename
Container::const_iterator i
) : _iter(i
) {}
441 pkgCache::VerIterator
getVer(void) const { return *_iter
; }
442 inline pkgCache::VerIterator
operator*(void) const { return *_iter
; };
443 operator typename
Container::const_iterator(void) const { return _iter
; }
444 inline void operator++(void) { ++_iter
; };
445 inline bool operator!=(const_iterator
const &i
) const { return _iter
!= i
._iter
; };
446 inline bool operator==(const_iterator
const &i
) const { return _iter
== i
._iter
; };
447 friend std::ostream
& operator<<(std::ostream
& out
, const_iterator i
) { return operator<<(out
, *i
); }
449 // we are not going to allow modify our veriterators (it doesn't make sense)…
450 typedef APT::VersionContainer
<Container
>::const_iterator iterator
;
453 bool insert(pkgCache::VerIterator
const &V
) { if (V
.end() == true) return false; _cont
.insert(V
); return true; };
454 template<class Cont
> void insert(VersionContainer
<Cont
> const &vercont
) { _cont
.insert((typename
Cont::const_iterator
)vercont
.begin(), (typename
Cont::const_iterator
)vercont
.end()); };
455 void insert(const_iterator begin
, const_iterator end
) { _cont
.insert(begin
, end
); };
456 bool empty() const { return _cont
.empty(); };
457 void clear() { return _cont
.clear(); };
458 void erase(iterator position
) { _cont
.erase((typename
Container::const_iterator
)position
); };
459 size_t erase(const pkgCache::PkgIterator x
) { return _cont
.erase(x
); };
460 void erase(iterator first
, iterator last
) { _cont
.erase(first
, last
); };
461 size_t size() const { return _cont
.size(); };
463 const_iterator
begin() const { return const_iterator(_cont
.begin()); };
464 const_iterator
end() const { return const_iterator(_cont
.end()); };
465 const_iterator
find(pkgCache::VerIterator
const &V
) const { return const_iterator(_cont
.find(V
)); };
467 /** \brief returns all versions specified on the commandline
469 Get all versions from the commandline, uses given default version if
470 non specifically requested and executes regex's if needed on names.
471 \param Cache the packages and versions are in
472 \param cmdline Command line the versions should be extracted from
473 \param helper responsible for error and message handling */
474 static VersionContainer
FromCommandLine(pkgCacheFile
&Cache
, const char **cmdline
,
475 Version
const &fallback
, CacheSetHelper
&helper
) {
476 VersionContainer vercon
;
477 VersionContainerInterface::FromCommandLine(&vercon
, Cache
, cmdline
, fallback
, helper
);
480 static VersionContainer
FromCommandLine(pkgCacheFile
&Cache
, const char **cmdline
,
481 Version
const &fallback
) {
482 CacheSetHelper helper
;
483 return FromCommandLine(Cache
, cmdline
, fallback
, helper
);
485 static VersionContainer
FromCommandLine(pkgCacheFile
&Cache
, const char **cmdline
) {
486 return FromCommandLine(Cache
, cmdline
, CANDINST
);
489 static VersionContainer
FromString(pkgCacheFile
&Cache
, std::string
const &pkg
,
490 Version
const &fallback
, CacheSetHelper
&helper
,
491 bool const onlyFromName
= false) {
492 VersionContainer vercon
;
493 VersionContainerInterface::FromString(&vercon
, Cache
, pkg
, fallback
, helper
);
496 static VersionContainer
FromString(pkgCacheFile
&Cache
, std::string pkg
,
497 Version
const &fallback
) {
498 CacheSetHelper helper
;
499 return FromString(Cache
, pkg
, fallback
, helper
);
501 static VersionContainer
FromString(pkgCacheFile
&Cache
, std::string pkg
) {
502 return FromString(Cache
, pkg
, CANDINST
);
505 /** \brief returns all versions specified for the package
507 \param Cache the package and versions are in
508 \param P the package in question
509 \param fallback the version(s) you want to get
510 \param helper the helper used for display and error handling */
511 static VersionContainer
FromPackage(pkgCacheFile
&Cache
, pkgCache::PkgIterator
const &P
,
512 Version
const &fallback
, CacheSetHelper
&helper
) {
513 VersionContainer vercon
;
514 VersionContainerInterface::FromPackage(&vercon
, Cache
, P
, fallback
, helper
);
517 static VersionContainer
FromPackage(pkgCacheFile
&Cache
, pkgCache::PkgIterator
const &P
,
518 Version
const &fallback
) {
519 CacheSetHelper helper
;
520 return FromPackage(Cache
, P
, fallback
, helper
);
522 static VersionContainer
FromPackage(pkgCacheFile
&Cache
, pkgCache::PkgIterator
const &P
) {
523 return FromPackage(Cache
, P
, CANDINST
);
526 static std::map
<unsigned short, VersionContainer
> GroupedFromCommandLine(
528 const char **cmdline
,
529 std::list
<Modifier
> const &mods
,
530 unsigned short const fallback
,
531 CacheSetHelper
&helper
) {
532 std::map
<unsigned short, VersionContainer
> versets
;
533 for (const char **I
= cmdline
; *I
!= 0; ++I
) {
534 unsigned short modID
= fallback
;
535 VersionContainer verset
;
536 VersionContainerInterface::FromModifierCommandLine(modID
, &verset
, Cache
, *I
, mods
, helper
);
537 versets
[modID
].insert(verset
);
542 static std::map
<unsigned short, VersionContainer
> GroupedFromCommandLine(
543 pkgCacheFile
&Cache
, const char **cmdline
,
544 std::list
<Modifier
> const &mods
,
545 unsigned short const fallback
) {
546 CacheSetHelper helper
;
547 return GroupedFromCommandLine(Cache
, cmdline
,
548 mods
, fallback
, helper
);
552 typedef VersionContainer
<std::set
<pkgCache::VerIterator
> > VersionSet
;