diff --git a/doc/innoextract.1 b/doc/innoextract.1 index ee578f1..52029e0 100644 --- a/doc/innoextract.1 +++ b/doc/innoextract.1 @@ -48,6 +48,7 @@ Here is a short summary of the options available in innoextract. Please refer to .TP .B Filters: .nf + \-m \-\-exclude\-temp Don't extract temporary files \-\-language \fILANG\fP Extract only files for this language \-I \-\-include \fIEXPR\fP Extract only files that match this path .fi @@ -73,6 +74,11 @@ will try to detect if the terminal supports shell escape codes and enable or dis \fB\-\-dump\fP Don't convert Windows paths to UNIX paths and don't substitute variables in paths. .TP +\fB\-m\fP, \fB\-\-exclude\-temp\fP +Don't extract files that would have been deleted at the end of the install process. Such files are marked with [temp] in the file listing. + +This option takes precedence over \fB\-\-include\fP and \fB\-\-language\fP: temporary files are never extracted when using the \fB\-\-exclude\-temp\fP, even if they match the selected language or include expressions. +.TP \fB\-e\fP, \fB\-\-extract\fP Extract all files to the current directory. This action is enabled by default, unless either \fB\-\-list\fP or \fB\-\-extract\fP is specified. You may only specify one of \fB\-\-extract\fP and \fB\-\-test\fP. .TP diff --git a/src/cli/extract.cpp b/src/cli/extract.cpp index 706d7ac..58eb002 100644 --- a/src/cli/extract.cpp +++ b/src/cli/extract.cpp @@ -439,6 +439,10 @@ void process_file(const fs::path & file, const extract_options & o) { continue; // Ignore external files (copy commands) } + if(!o.extract_temp && (file.options & setup::file_entry::DeleteAfterInstall)) { + continue; // Ignore temporary files + } + if(!file.languages.empty()) { if(!o.language.empty() && !setup::expression_match(o.language, file.languages)) { continue; // Ignore other languages diff --git a/src/cli/extract.hpp b/src/cli/extract.hpp index 4d881c1..eecb805 100644 --- a/src/cli/extract.hpp +++ b/src/cli/extract.hpp @@ -54,6 +54,7 @@ struct extract_options { bool preserve_file_times; //!< Set timestamps of extracted files bool local_timestamps; //!< Use local timezone for setting timestamps + bool extract_temp; //!< Extract temporary files std::string language; //!< Extract only files for this language std::vector include; //!< Extract only files matching these patterns diff --git a/src/cli/main.cpp b/src/cli/main.cpp index cf2f954..a5b7f4f 100644 --- a/src/cli/main.cpp +++ b/src/cli/main.cpp @@ -146,6 +146,7 @@ int main(int argc, char * argv[]) { po::options_description filter("Filters"); filter.add_options() + ("exclude-temp,m", "Don't extract temporary files") ("language", po::value(), "Extract only files for this language") ("include,I", po::value< std::vector >(), "Extract only files that match this path") ; @@ -284,6 +285,7 @@ int main(int argc, char * argv[]) { } } + o.extract_temp = (options.count("exclude-temp") == 0); { po::variables_map::const_iterator i = options.find("language"); if(i != options.end()) {