12 #include <tr1/functional> 32 bool operator() (
const std::string& a,
const std::string& b)
const {
33 return stricmp(a.c_str(), b.c_str()) < 0;
46 static const size_type npos=
static_cast<size_type
>(-1);
131 size_type _files_done;
134 size_type _files_total;
137 size_type _bytes_done;
140 size_type _bytes_total;
143 size_type _files_total_unpack;
146 size_type _files_total_remove;
149 size_type _bytes_total_unpack;
157 std::set<string> _packages_to_unpack;
161 std::set<string> _packages_pre_unpacked;
165 std::set<string> _packages_being_unpacked;
169 std::set<string> _packages_unpacked;
173 std::set<string> _packages_to_remove;
177 std::set<string> _packages_being_removed;
181 std::set<string> _packages_removed;
185 std::set<string> _files_to_unpack;
189 std::set<string> _files_being_unpacked;
193 std::set<string> _files_unpacked;
197 std::set<string> _empty_dirs_to_create;
200 std::set<string> _dirs_being_created;
204 std::set<string, case_insensitive_cmp> _files_to_remove;
208 std::set<string, case_insensitive_cmp> _dirs_to_remove;
212 std::set<string> _files_being_removed;
216 std::set<string> _files_removed;
220 std::set<string> _empty_dirs_to_check;
222 std::set<string> _dirs_removed;
224 std::set<string> _dirs_created;
227 std::set<string> _packages_cannot_process;
231 std::set<string, case_insensitive_cmp> _files_that_conflict;
235 std::set<string> _existing_module_packages;
250 std::tr1::function<void(LogCode code, const std::string &item, const std::string &what)> _warning;
253 bool _state_text_changed;
255 std::string _state_text;
277 {
return _files_done; }
283 {
return _files_total; }
289 {
return _bytes_done; }
295 {
return _bytes_total; }
310 if (_state_text_changed) {_state_text_changed=
false;
return true;}
316 {
return _state_text; }
325 {
return _packages_cannot_process; }
334 {
return _files_that_conflict; }
343 void warning_func(std::tr1::function<
void(
LogCode code,
const std::string &item,
const std::string &what)> &f) {_warning = f;}
367 void state_text(
const std::string &text);
375 void read_manifest(std::set<string>& mf,
const string& pkgname);
387 void build_manifest(std::set<string>& mf,
zipfile& zf,size_type* usize=0);
395 void prepare_manifest(std::set<string>& mf,
const string& pkgname);
402 void activate_manifest(
const string& pkgname);
409 void remove_manifest(
const string& pkgname);
414 void add_pre_install_trigger(
const string &pkgname,
bool has_unwind);
419 void add_post_install_trigger(
const string &pkgname);
424 void add_pre_remove_trigger(
const string &pkgname);
429 void set_post_install_unwind(
const string &pkgname);
436 void add_post_remove_trigger(
const string &pkgname, std::set<std::string> &mf);
454 void replace_file(
const string& dst_pathname,
bool overwrite);
461 void remove_file(
const string& dst_pathname);
467 void remove_backup(
const string& dst_pathname);
472 void unwind_remove_file(
const string& dst_pathname);
482 void unwind_replace_file(
const string& dst_pathname,
bool overwrite);
488 void unwind_unpack_file(
const string& dst_pathname);
501 bool already_installed(
const control& ctrl,
const std::set<string> &mf);
505 void update_existing_modules();
508 void unwind_existing_modules();
515 void get_trigger_versions(
const std::string &pkgname, std::string &old_version, std::string &new_version);
520 class riscos_info_not_found;
The state in which old versions of files are backed up and replaced with new versions.
Definition: unpack.h:71
size_type files_total() const
Get total number of files to process.
Definition: unpack.h:282
The state in which post remove triggers are run to unwind the actions of the pre install triggers...
Definition: unpack.h:97
A class to manage the package triggers executed during the commiting of the packages.
Definition: triggers.h:27
The state in which state_pre_remove is being backed out.
Definition: unpack.h:106
An exception class for reporting that a file information record could not be found.
Definition: unpack.cc:150
const std::set< string > & packages_cannot_process() const
Get the set of packages that cannot be processed.
Definition: unpack.h:324
The state in which state_pre_unpack is being backed out.
Definition: unpack.h:108
The state in which state_unpack is being backed out.
Definition: unpack.h:99
The state in which post install triggers are run to unwind the actions of the pre remove and/or pre i...
Definition: unpack.h:102
The namespace used to hold the package management library.
Definition: auto_dir.cc:12
const std::set< string, case_insensitive_cmp > & files_that_conflict() const
Get the set of destination pathnames that conflict with files already on the system.
Definition: unpack.h:333
bool operator()(const std::string &a, const std::string &b) const
Definition: unpack.h:32
An exception class for reporting that one or more files conflict with those already on the system...
Definition: unpack.cc:140
The state in which backups are deleted, and the states of packages to be removed are changed to statu...
Definition: unpack.h:78
size_type bytes_total() const
Get total number of bytes to process.
Definition: unpack.h:294
A class for unpacking and removing sets of packages.
Definition: unpack.h:38
size_type files_done() const
Get number of files processed.
Definition: unpack.h:276
The state in which files are unpacked from their zip archives and moved to temporary locations...
Definition: unpack.h:66
state_type
An enumeration for describing the state of the unpack operation.
Definition: unpack.h:49
A class for automatically creating and deleting directories.
Definition: auto_dir.h:20
The state in which the states of packages to be unpacked are changed to status::state_unpacked.
Definition: unpack.h:85
class to represent a trigger action from a script
Definition: trigger.h:22
bool clear_state_text_changed()
Check is state text has changed and clear the changed flag.
Definition: unpack.h:308
string message() const
Get error message.
Definition: unpack.h:302
The state in which empty diwas created are removed.
Definition: unpack.h:90
The state in which pre install triggers are run.
Definition: unpack.h:68
A class to represent the content of a RiscPkg control file.
Definition: control.h:24
A mixin class to represent a cooperative thread.
Definition: thread.h:12
Class to log actions that occur in LibPkg.
Definition: log.h:213
Interface to execute a trigger.
Definition: trigger.h:66
size_type bytes_done() const
Get number of bytes processed.
Definition: unpack.h:288
A class for representing the collection of package database tables.
Definition: pkgbase.h:24
An exception class for reporting that one or more packages cannot be processed.
Definition: unpack.cc:130
The state in which state_replace is being backed out.
Definition: unpack.h:94
The state in which any empty directwasries that need creating are created.
Definition: unpack.h:82
unsigned long long size_type
A type for representing byte counts.
Definition: unpack.h:43
The state in which the pre remove triggers are run.
Definition: unpack.h:63
Comparison that does not take into account the case of the string.
Definition: unpack.h:31
const char * dst_pathname
Definition: path_table.cc:21
const std::string & state_text() const
Return the current state text.
Definition: unpack.h:315
The state in which post remove trigger copies are removed.
Definition: unpack.h:104
The state in which all operations have been successfully completed.
Definition: unpack.h:88
The state in which post remove triggers are copied so they are preserved to be run after the packages...
Definition: unpack.h:61
The state in which old versions of files that do not have replacements are backed up then removed...
Definition: unpack.h:74
state_type state() const
Get current state of the unpack operation.
Definition: unpack.h:270
const char * src_pathname
Definition: path_table.cc:20
The state in which the states of packages to be removed are changed to status::state_half_unpacked.
Definition: unpack.h:58
An interface class to represent a zip file.
Definition: zipfile.h:20
The state in which state_remove is being backed out.
Definition: unpack.h:92
LogCode
An enumeration of all the items that can be logged.
Definition: log.h:19
The state in which the states of packages to be unpacked are changed to status::state_half_unpacked.
Definition: unpack.h:54
void warning_func(std::tr1::function< void(LogCode code, const std::string &item, const std::string &what)> &f)
Set the function to log and capture warnings.
Definition: unpack.h:343