[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:37:14 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=d7c80de
The following commit has been merged in the master branch:
commit d7c80de351cc1f6b26cfd25b163aca5795b5a9d6
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Sun Sep 11 15:23:42 2005 +0000
Added -s <suffix> option to the utility. This allows, e.g, to use Canon THM files as source file for the insert command.
---
src/actions.cpp | 4 +++-
src/exiv2.cpp | 15 ++++++++++++---
src/exiv2.hpp | 3 ++-
test/data/exiv2-test.out | 3 ++-
4 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/src/actions.cpp b/src/actions.cpp
index a9e30fe..e61fa9b 100644
--- a/src/actions.cpp
+++ b/src/actions.cpp
@@ -960,8 +960,10 @@ namespace Action {
|| Params::instance().target_ & Params::ctComment) {
std::string directory = Params::instance().directory_;
if (directory.empty()) directory = Util::dirname(path);
+ std::string suffix = Params::instance().suffix_;
+ if (suffix.empty()) suffix = "exv";
std::string exvPath = directory + EXV_SEPERATOR_STR
- + Util::basename(path, true) + ".exv";
+ + Util::basename(path, true) + "." + suffix;
rc = metacopy(exvPath, path, true);
}
return rc;
diff --git a/src/exiv2.cpp b/src/exiv2.cpp
index c97e069..b9ca519 100644
--- a/src/exiv2.cpp
+++ b/src/exiv2.cpp
@@ -230,7 +230,8 @@ void Params::help(std::ostream& os) const
<< " set|add|del <key> [[<type>] <value>].
"
<< " -M cmd Command line for the modify action. The format for the
"
<< " commands is the same as that of the lines of a command file.
"
- << " -l dir Location (directory) for files to be inserted or extracted.
";
+ << " -l dir Location (directory) for files to be inserted from or extracted to.
"
+ << " -s ext Suffix of the files to be inserted from.
";
} // Params::help
int Params::option(int opt, const std::string& optarg, int optopt)
@@ -251,6 +252,7 @@ int Params::option(int opt, const std::string& optarg, int optopt)
case 'm': rc = evalModify(opt, optarg); break;
case 'M': rc = evalModify(opt, optarg); break;
case 'l': directory_ = optarg; break;
+ case 's': suffix_ = optarg; break;
case ':':
std::cerr << progname() << ": Option -" << static_cast<char>(optopt)
<< " requires an argument
";
@@ -572,10 +574,17 @@ int Params::getopt(int argc, char* const argv[])
rc = 1;
}
}
- if (!directory_.empty() && !(action_ == Action::insert || action_ == Action::extract)) {
- std::cerr << progname() << ": -l option can only be used with extract or insert actions
";
+ if ( !directory_.empty()
+ && !(action_ == Action::insert || action_ == Action::extract)) {
+ std::cerr << progname()
+ << ": -l option can only be used with extract or insert actions
";
rc = 1;
}
+ if (!suffix_.empty() && !action_ == Action::insert) {
+ std::cerr << progname()
+ << ": -s option can only be used with insert action
";
+ rc = 1;
+ }
return rc;
} // Params::getopt
diff --git a/src/exiv2.hpp b/src/exiv2.hpp
index dbdbc1a..836ec21 100644
--- a/src/exiv2.hpp
+++ b/src/exiv2.hpp
@@ -147,6 +147,7 @@ public:
CmdLines cmdLines_; //!< Commands from the command line
ModifyCmds modifyCmds_; //!< Parsed modification commands
std::string directory_; //!< Location for files to extract/insert
+ std::string suffix_; //!< File extension of the file to insert
Files files_; //!< List of non-option arguments.
private:
@@ -154,7 +155,7 @@ private:
@brief Default constructor. Note that optstring_ is initialized here.
The c'tor is private to force instantiation through instance().
*/
- Params() : optstring_(":hVvfFa:r:p:d:e:i:m:M:l:"),
+ Params() : optstring_(":hVvfFa:r:p:d:e:i:m:M:l:s:"),
help_(false),
version_(false),
verbose_(false),
diff --git a/test/data/exiv2-test.out b/test/data/exiv2-test.out
index cfa5c36..1f07cb8 100644
--- a/test/data/exiv2-test.out
+++ b/test/data/exiv2-test.out
@@ -57,7 +57,8 @@ Options:
set|add|del <key> [[<type>] <value>].
-M cmd Command line for the modify action. The format for the
commands is the same as that of the lines of a command file.
- -l dir Location (directory) for files to be inserted or extracted.
+ -l dir Location (directory) for files to be inserted from or extracted to.
+ -s ext Suffix of the files to be inserted from.
Adjust -------------------------------------------------------------------
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list