Browse Source

Add an option to not extract temporary files

See: issue #12, issue #34
pull/53/head
Daniel Scharrer 11 years ago
parent
commit
dd6ec744f0
  1. 6
      doc/innoextract.1
  2. 4
      src/cli/extract.cpp
  3. 1
      src/cli/extract.hpp
  4. 2
      src/cli/main.cpp

6
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

4
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

1
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<std::string> include; //!< Extract only files matching these patterns

2
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<std::string>(), "Extract only files for this language")
("include,I", po::value< std::vector<std::string> >(), "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()) {

Loading…
Cancel
Save