3
// Copyright (C) 2001 Daniel Burrows
4
// Copyright (C) 2012 Daniel Hartwig
6
// This program is free software; you can redistribute it and/or modify
7
// it under the terms of the GNU General Public License as published by
8
// the Free Software Foundation; either version 2 of the License, or
9
// (at your option) any later version.
11
// This program is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
// GNU General Public License for more details.
16
// You should have received a copy of the GNU General Public License along
17
// with this program; if not, write to the Free Software Foundation, Inc.,
18
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24
#include <apt-pkg/pkgcache.h>
30
/** \brief Handles parsing the list of tasks and getting the task of a given
44
bool keys_present_cache;
45
bool keys_present_cache_stale;
48
: keys_present_cache(false),
49
keys_present_cache_stale(true),
56
std::wstring shortdesc;
57
std::wstring longdesc;
58
std::set<std::string> keys;
59
std::vector<std::string> packages;
66
// Stores the various tasks.
67
extern std::map<std::string, task> *task_list;
69
task *find_task(const std::string &name);
71
/** \brief Get the set of tasks associated with the given package.
73
* The caller should not delete this set; it's managed internally by
76
std::set<std::string> *get_tasks(const pkgCache::PkgIterator &pkg);
78
bool get_task_packages(std::set<pkgCache::PkgIterator> * const pkgset,
80
const std::string &arch);
82
/** \brief Returns \b true if the given package is a task package.
84
* A task package is one that appears in the Key stanza of a task
85
* definition which has no Packages stanza. For example, the package
86
* task-ssh-server in the following definition is a task package:
93
bool is_task_package(const pkgCache::PkgIterator &pkg);
95
// (re)loads in the current list of available tasks. Necessary after a
96
// cache reload, for obvious reasons. apt_reload_cache will call this.
97
void load_tasks(OpProgress &progress);
99
// Discards the current task list and readies a new one to be loaded.
100
// Since the task list contains package iterators, we have to do something
101
// in case they're still hanging around.