[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:47:08 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=ceaa927

The following commit has been merged in the master branch:
commit ceaa92704f9f8bf922726f5e1012ac9e2447530e
Author: Robin Mills <robin at clanmills.com>
Date:   Tue Oct 4 12:39:36 2016 +0000

    #1230 Adding --verbose to print action to dump more information (to debug something on the buildserver)
---
 src/exiv2.cpp     | 29 ++++++++++++++++++-------
 src/exiv2app.hpp  |  9 +++++++-
 test/webp-test.sh | 63 ++++++++++++++++++++++++++++---------------------------
 3 files changed, 62 insertions(+), 39 deletions(-)

diff --git a/src/exiv2.cpp b/src/exiv2.cpp
index 1158b36..23563f9 100644
--- a/src/exiv2.cpp
+++ b/src/exiv2.cpp
@@ -138,6 +138,9 @@ int main(int argc, char* const argv[])
 
     // Handle command line arguments
     Params& params = Params::instance();
+    params.argc_=argc;
+    params.argv_=argv;
+
     if (params.getopt(argc, argv)) {
         params.usage();
         return 1;
@@ -603,8 +606,9 @@ int Params::evalPrint(const std::string& optarg)
         case 'S': action_ = Action::print; printMode_ = pmStructure  ; break;
         case 'X': action_ = Action::print; printMode_ = pmXMP        ; break;
         default:
-            std::cerr << progname() << ": " << _("Unrecognized print mode") << " `"
-                      << optarg << "'
";
+            std::cerr << progname() << ": " << _("Unrecognized print mode ")
+                     << "'"<< optarg<<"'"  << std::endl;
+            verboseDump();
             rc = 1;
             break;
         }
@@ -877,6 +881,17 @@ int Params::nonoption(const std::string& argv)
     return rc;
 } // Params::nonoption
 
+void Params::verboseDump()
+{
+    //if ( verbose_ ) {
+        std::cerr << "argc = " << argc_ << std::endl;
+        if ( argv_ )
+            for ( int a = 0 ; a < argc_ ; a++)
+                std::cerr << "argv[" <<a<< "] =" << argv_[a] << std::endl;
+    //    Exiv2::dumpLibraryInfo(std::cerr,greps_);
+    //}
+}
+
 static int readFileToBuf(FILE* f,Exiv2::DataBuf& buf)
 {
     const int buff_size = 4*1028;
@@ -906,7 +921,7 @@ static int readFileToBuf(FILE* f,Exiv2::DataBuf& buf)
 void Params::getStdin(Exiv2::DataBuf& buf)
 {
     // copy stdin to stdinBuf
-    if ( stdinBuf.size_ == 0 ) {
+    if ( stdinBuf_.size_ == 0 ) {
 #if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW__) || defined(_MSC_VER)
         DWORD fdwMode;
         _setmode(fileno(stdin), O_BINARY);
@@ -925,7 +940,7 @@ void Params::getStdin(Exiv2::DataBuf& buf)
 #ifdef DEBUG
             std::cerr << "stdin has data" << std::endl;
 #endif
-            readFileToBuf(stdin,stdinBuf);
+            readFileToBuf(stdin,stdinBuf_);
         }
 #ifdef DEBUG
         // this is only used to simulate reading from stdin when debugging
@@ -947,9 +962,9 @@ void Params::getStdin(Exiv2::DataBuf& buf)
     }
 
     // copy stdinBuf to buf
-    if ( stdinBuf.size_ ) {
-        buf.alloc(stdinBuf.size_);
-        memcpy(buf.pData_,stdinBuf.pData_,buf.size_);
+    if ( stdinBuf_.size_ ) {
+        buf.alloc(stdinBuf_.size_);
+        memcpy(buf.pData_,stdinBuf_.pData_,buf.size_);
     }
 #ifdef DEBUG
     std::cerr << "getStdin stdinBuf.size_ = " << stdinBuf.size_ << std::endl;
diff --git a/src/exiv2app.hpp b/src/exiv2app.hpp
index d3b5957..379f4e1 100644
--- a/src/exiv2app.hpp
+++ b/src/exiv2app.hpp
@@ -256,7 +256,9 @@ public:
     Keys  keys_;                        //!< List of keys to match from the metadata
     std::string charset_;               //!< Charset to use for UNICODE Exif user comment
 
-    Exiv2::DataBuf  stdinBuf;           //! < DataBuf with the binary bytes from stdin
+    Exiv2::DataBuf  stdinBuf_;         //! < DataBuf with the binary bytes from stdin
+    int             argc_;             //! < command-line arg count
+    char* const*    argv_;             //! < command-line arg vector
 
 private:
     //! Pointer to the global Params object.
@@ -293,6 +295,8 @@ private:
                formatSet_(false),
                first_(true)
     {
+        argc_=0;
+        argv_=NULL;
         yodAdjust_[yodYear]  = emptyYodAdjust_[yodYear];
         yodAdjust_[yodMonth] = emptyYodAdjust_[yodMonth];
         yodAdjust_[yodDay]   = emptyYodAdjust_[yodDay];
@@ -355,6 +359,9 @@ public:
     */
     void getStdin(Exiv2::DataBuf& buf);
 
+    //! verboseDump is used to debug the command line
+    void verboseDump();
+
 }; // class Params
 
 #endif                                  // #ifndef EXIV2APP_HPP_
diff --git a/test/webp-test.sh b/test/webp-test.sh
index b09a9d6..54174c3 100755
--- a/test/webp-test.sh
+++ b/test/webp-test.sh
@@ -7,77 +7,78 @@ source ./functions.source
 
     num=1199                    # WebPImage
     printf "WebP " >&3
+#    verbose=--verbose
     filename=exiv2-bug$num.webp # http://dev.exiv2.org/attachments/download/1033/Stonehenge-with-icc.webp
     icc_name=exiv2-bug$num.icc
     exv_name=exiv2-bug$num.exv
     xmp_name=exiv2-bug$num.xmp
 
     copyTestFile                        $filename
-    runTest exiv2 -pS                   $filename
-    runTest exiv2 -pR                   $filename
-    runTest exiv2 -pX                   $filename | xmllint --format -
+    runTest exiv2 $verbose -pS          $filename
+    runTest exiv2 $verbose -pR          $filename
+    runTest exiv2 $verbose -pX          $filename | xmllint --format -
     printf "delete " >&3
     # test deleting metadata
     for option in -dC -de -dx -dCe -dCx -dCxe; do
       copyTestFile                      $filename
-      runTest exiv2 -pS                 $filename
+      runTest exiv2 $verbose -pS        $filename
       runTest exiv2 $option             $filename
-      runTest exiv2 -pS                 $filename
+      runTest exiv2 $verbose -pS        $filename
     done
 
     printf "insert " >&3
     printf "ICC "    >&3
     copyTestFile                        $filename
-    exiv2 -pS                           $filename
+    exiv2 $verbose -pS                  $filename
     copyTestFile                        Reagan.tiff
-    exiv2 -pC                           Reagan.tiff > $icc_name
-    exiv2 -iC                           $filename
+    exiv2 $verbose -pC                  Reagan.tiff > $icc_name
+    exiv2 $verbose -iC                  $filename
     exiv2 -pS                           $filename
 
     printf "XMP " >&3
     # copy the XMP from the test file
     copyTestFile                        $filename
-    exiv2 -pX                           $filename   > $xmp_name;
-    exiv2 -ea --force                   $filename
+    exiv2 $verbose -pX                  $filename   > $xmp_name;
+    exiv2 $verbose -ea --force          $filename
 
     copyTestFile                        $filename
-    exiv2 -pS                           $filename
-    exiv2 -iXX                          $filename
-    exiv2 -pS                           $filename
-    exiv2 -ix                           $filename
+    exiv2 $verbose -pS                  $filename
+    exiv2 $verbose -iXX                 $filename
+    exiv2 $verbose -pS                  $filename
+    exiv2 $verbose -ix                  $filename
 
     # copy the XMP from Reagan.tiff to test file
     copyTestFile                        Reagan.tiff
-    exiv2 -pX                           Reagan.tiff > $xmp_name;
-    exiv2 -ea --force                   Reagan.tiff
+    exiv2 $verbose -pX                  Reagan.tiff > $xmp_name;
+    exiv2 $verbose -ea --force          Reagan.tiff
     mv                                  Reagan.exv    $exv_name
 
     copyTestFile                        $filename
-    exiv2 -pS                           $filename
-    exiv2 -iXX                          $filename
-    exiv2 -pS                           $filename
-    exiv2 -ix                           $filename
+    exiv2 $verbose -pS                  $filename
+    exiv2 $verbose -iXX                 $filename
+    exiv2 $verbose -pS                  $filename
+    exiv2 $verbose -ix                  $filename
 
     # copy the XMP from exiv2-bug922.jpg to test file
     copyTestFile                        exiv2-bug922.jpg
-    exiv2 -pX                           exiv2-bug922.jpg > $xmp_name
-    exiv2 -ea --force                   exiv2-bug922.jpg 2>/dev/null
+    exiv2 $verbose -pX                  exiv2-bug922.jpg > $xmp_name
+    exiv2 $verbose -ea --force          exiv2-bug922.jpg 2>/dev/null
     mv                                  exiv2-bug922.exv   $exv_name
 
     copyTestFile                        $filename
-    exiv2 -pS                           $filename
-    exiv2 -ix                           $filename
-    exiv2 -pS                           $filename
-    exiv2 -iXX                          $filename
-    exiv2 -pS                           $filename
+    exiv2 $verbose -pS                  $filename
+    exiv2 $verbose -ix                  $filename
+    exiv2 $verbose -pS                  $filename
+    exiv2 $verbose -iXX                 $filename
+    exiv2 $verbose -pS                  $filename
 
     printf "EXIF " >&3
     copyTestFile                        exiv2-bug922.jpg $filename
-    exiv2 --force -ea                   $filename
+    exiv2 $verbose --force -ea          $filename
     copyTestFile                        $filename
-    exiv2 -pS                           $filename
-    exiv2 -ie                           $filename
-    exiv2 -pS                           $filename
+    exiv2 $verbose -pS                  $filename
+    exiv2 $verbose -ie                  $filename
+    exiv2 $verbose -pS                  $filename
 
 ) 3>&1 > $results 2>&1
 

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list