Control: tags -1 + patch

Please find attached a patch.
Tested with an example COLLADA file.
>From f1772e60500e6cbdf3231792a6f7216eb1ac53e0 Mon Sep 17 00:00:00 2001
From: Yavor Doganov <ya...@gnu.org>
Date: Sat, 16 Dec 2023 15:34:11 +0200
Subject: [PATCH] Port to PCRE2 (#1000009)

---
 debian/changelog           |   7 +
 debian/control             |   2 +-
 debian/patches/pcre2.patch | 785 +++++++++++++++++++++++++++++++++++++
 debian/patches/series      |   1 +
 4 files changed, 794 insertions(+), 1 deletion(-)
 create mode 100644 debian/patches/pcre2.patch

diff --git a/debian/changelog b/debian/changelog
index c87ac4f..f0634a2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+opencollada (0.1.0~20180719.619d942+dfsg0-3) UNRELEASED; urgency=medium
+
+  * debian/patches/pcre2.patch: New; port to PCRE2 (Closes: #1000009).
+  * debian/control (Build-Depends): Replace libpcre3-dev with libpcre2-dev.
+
+ -- Yavor Doganov <ya...@gnu.org>  Sat, 16 Dec 2023 15:32:13 +0200
+
 opencollada (0.1.0~20180719.619d942+dfsg0-2) unstable; urgency=medium
 
   * Upload to unstable
diff --git a/debian/control b/debian/control
index da6c13e..4c64ef8 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Uploaders: Matteo F. Vescovi <m...@debian.org>
 Build-Depends:
  cmake,
  debhelper-compat (= 11),
- libpcre3-dev,
+ libpcre2-dev,
  libxml2-dev
 Standards-Version: 4.2.1
 Homepage: http://www.opencollada.org/
diff --git a/debian/patches/pcre2.patch b/debian/patches/pcre2.patch
new file mode 100644
index 0000000..6849bc6
--- /dev/null
+++ b/debian/patches/pcre2.patch
@@ -0,0 +1,785 @@
+Description: Port to PCRE2.
+Bug-Debian: https://bugs.debian.org/1000009
+Author: Yavor Doganov <ya...@gnu.org>
+Forwarded: no
+Last-Update: 2023-12-16
+---
+
+--- opencollada.orig/CMakeLists.txt
++++ opencollada/CMakeLists.txt
+@@ -257,16 +257,8 @@
+ find_package(PCRE)

+ if (PCRE_FOUND)

+       message(STATUS "SUCCESSFUL: PCRE found")

+-else ()  # if pcre not found building its local copy from ./Externals

+-      if (WIN32 OR APPLE)

+-              message("WARNING: Native PCRE not found, taking PCRE from 
./Externals")

+-              add_definitions(-DPCRE_STATIC)

+-              add_subdirectory(${EXTERNAL_LIBRARIES}/pcre)

+-              set(PCRE_INCLUDE_DIR ${libpcre_include_dirs})

+-              set(PCRE_LIBRARIES pcre)

+-      else ()

+-              message("ERROR: PCRE not found, please install pcre library")

+-      endif ()

++else ()

++      message("ERROR: PCRE not found, please install pcre library")

+ endif ()

+ 

+ # building required libs

+--- opencollada.orig/COLLADABaseUtils/include/COLLADABUPcreCompiledPattern.h
++++ opencollada/COLLADABaseUtils/include/COLLADABUPcreCompiledPattern.h
+@@ -12,6 +12,8 @@
+ #define __COLLADABU_PCRECOMPILEDPATTERN_H__

+ 

+ #include "COLLADABUPrerequisites.h"

++#define PCRE2_CODE_UNIT_WIDTH 8
++#include <pcre2.h>
+ 

+ struct real_pcre;
+ typedef struct real_pcre pcre;
+@@ -29,7 +31,7 @@
+       {

+       private:

+               /** The compiled pattern.*/

+-              pcre *mCompiledPattern;

++              pcre2_code *mCompiledPattern;

+ 

+               /** True, if we need to free the pattern in the destructor, 
false otherwise.*/

+               bool mFreePattern;

+@@ -44,7 +46,7 @@
+               virtual ~PcreCompiledPattern();

+ 

+               /** Returns the compiled pattern. */

+-              pcre* getCompiledPattern() const;

++              pcre2_code* getCompiledPattern() const;

+ 

+       private:

+ 

+@@ -55,7 +57,7 @@
+               const PcreCompiledPattern& operator= ( const 
PcreCompiledPattern& pre );

+ 

+               /** Compiles the pattern.*/

+-              pcre* compilePattern( const char* pattern );

++              pcre2_code* compilePattern( const char* pattern );

+ 

+       };

+ 

+--- opencollada.orig/COLLADABaseUtils/src/COLLADABUPcreCompiledPattern.cpp
++++ opencollada/COLLADABaseUtils/src/COLLADABUPcreCompiledPattern.cpp
+@@ -11,7 +11,6 @@
+ #include "COLLADABUStableHeaders.h"
+ #include "COLLADABUPcreCompiledPattern.h"
+ 
+-#include "pcre.h"
+ 
+ namespace COLLADABU
+ {
+@@ -30,17 +29,18 @@
+       {
+               if ( mFreePattern )
+               {
+-                      pcre_free(mCompiledPattern);
++                      pcre2_code_free(mCompiledPattern);
+               }
+       }
+ 
+       //------------------------------
+-      pcre* PcreCompiledPattern::compilePattern( const char* pattern )
++      pcre2_code* PcreCompiledPattern::compilePattern( const char* pattern )
+       {
+-              const char *error;
+-              int erroffset;
+-              pcre* compiledPattern = pcre_compile(
+-                                                          pattern,            
  /* the pattern */
++              int error;
++              size_t erroffset;
++              pcre2_code* compiledPattern = pcre2_compile(
++                                                          
(PCRE2_SPTR)pattern,              /* the pattern */
++                                                          
PCRE2_ZERO_TERMINATED,
+                                                       0,                    
/* default options */
+                                           &error,               /* for error 
message */
+                                           &erroffset,           /* for error 
offset */
+@@ -50,7 +50,7 @@
+       }
+ 
+       //------------------------------
+-      pcre* PcreCompiledPattern::getCompiledPattern() const
++      pcre2_code* PcreCompiledPattern::getCompiledPattern() const
+       {
+               return mCompiledPattern;
+       }
+--- opencollada.orig/COLLADABaseUtils/src/COLLADABUURI.cpp
++++ opencollada/COLLADABaseUtils/src/COLLADABUURI.cpp
+@@ -15,7 +15,8 @@
+ #include "COLLADABUHashFunctions.h"

+ 

+ #include <algorithm>

+-#include "pcre.h"

++#define PCRE2_CODE_UNIT_WIDTH 8

++#include <pcre2.h>

+ 

+ namespace COLLADABU

+ {

+@@ -130,11 +131,11 @@
+       }

+ 

+ 

+-      void setStringFromMatches(String& matchString, const String& 
entireString, int *resultPositions, int index)

++      void setStringFromMatches(String& matchString, const String& 
entireString, size_t *resultPositions, int index)

+       {

+-              int& startPosition = resultPositions[2*index];

+-              int& endPosition = resultPositions[2*index+1];

+-              if ( startPosition >= 0)

++              size_t& startPosition = resultPositions[2*index];

++              size_t& endPosition = resultPositions[2*index+1];

++              if ( (int)startPosition >= 0)

+               {

+                       matchString.assign( entireString, startPosition, 
endPosition - startPosition);

+               }

+@@ -294,54 +295,60 @@
+                       // regular expression: "(.*/)?(.*)?"

+                       static const PcreCompiledPattern 
findDirCompiledPattern("(.*/)?(.*)?");

+ 

+-                      pcre* findDir = 
findDirCompiledPattern.getCompiledPattern();

++                      pcre2_code* findDir = 
findDirCompiledPattern.getCompiledPattern();

+ 

+ 

+                       // regular expression: "([^.]*)?(\.(.*))?"

+                       static const PcreCompiledPattern 
findExtCompiledPattern("([^.]*)?(\\.(.*))?");

+-                      pcre* findExt = 
findExtCompiledPattern.getCompiledPattern();

++                      pcre2_code* findExt = 
findExtCompiledPattern.getCompiledPattern();

+                       

++                      pcre2_match_data *dirMD;

+                       String tmpFile;

+                       dir.clear();

+                       baseName.clear();

+                       extension.clear();

+ 

+-                      int dirMatches[regExpMatchesVectorLength];

++                      size_t *dirMatches;

+ 

+-                      int  dirResult = pcre_exec(

++                      dirMD = 
pcre2_match_data_create(regExpMatchesVectorLength, NULL);

++                      int  dirResult = pcre2_match(

+                                                                               
findDir,           /* the compiled pattern */

+-                                                                              
0,                 /* no extra data - we didn't study the pattern */

+-                                                                              
path.c_str(),      /* the subject string */

+-                                                                              
(int)path.size(),  /* the length of the subject */

++                                                                              
  (PCRE2_SPTR)path.c_str(),      /* the subject string */

++                                                                              
path.size(),      /* the length of the subject */

+                                                                               
0,                 /* start at offset 0 in the subject */

+                                                                               
0,                 /* default options */

+-                                                                              
dirMatches,     /* output vector for substring information */

+-                                                                              
regExpMatchesVectorLength); /* number of elements in the output vector */

++                                                                              
dirMD,             /* match data */

++                                                                              
NULL);            /* match context */

+ 

+                       if ( dirResult >= 0 )

+                       {       

++                              dirMatches = pcre2_get_ovector_pointer(dirMD);

+                               setStringFromMatches(dir, path, dirMatches, 1);

+                               setStringFromMatches(tmpFile, path, dirMatches, 
2);

+ 

+-                              int extMatches[regExpMatchesVectorLength];

++                              pcre2_match_data *extMD;

++                              size_t *extMatches;

+ 

+-                              int  extResult = pcre_exec(

++                              extMD = 
pcre2_match_data_create(regExpMatchesVectorLength, NULL);

++                              int  extResult = pcre2_match(

+                                                                               
        findExt,           /* the compiled pattern */

+-                                                                              
        0,                 /* no extra data - we didn't study the pattern */

+-                                                                              
        tmpFile.c_str(),      /* the subject string */

+-                                                                              
        (int)tmpFile.size(),  /* the length of the subject */

++                                                                              
        (PCRE2_SPTR)tmpFile.c_str(),      /* the subject string */

++                                                                              
        tmpFile.size(),    /* the length of the subject */

+                                                                               
        0,                 /* start at offset 0 in the subject */

+                                                                               
        0,                 /* default options */

+-                                                                              
        extMatches,     /* output vector for substring information */

+-                                                                              
        regExpMatchesVectorLength); /* number of elements in the output vector 
*/

++                                                                              
        extMD,             /*  match data */

++                                                                              
        NULL);             /* match context */

+ 

+                               

+                               if ( extResult >= 0 )

+                               {

++                                      extMatches = 
pcre2_get_ovector_pointer(extMD);

+                                       setStringFromMatches(baseName, tmpFile, 
extMatches, 1);

+                                       setStringFromMatches(extension, 
tmpFile, extMatches, 3);

+                               }

++                              pcre2_match_data_free(extMD);

+                       }

++                      pcre2_match_data_free(dirMD);

+       }

+ 

+       void URI::set(const String& uriStr_, const URI* baseURI) {

+@@ -918,32 +925,36 @@
+               //   http://tools.ietf.org/html/rfc3986#appendix-B

+               // regular expression: 
"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?"

+               static const PcreCompiledPattern 
matchUriCompiledPattern("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?");

+-              pcre* matchUri = matchUriCompiledPattern.getCompiledPattern();

++              pcre2_code* matchUri = 
matchUriCompiledPattern.getCompiledPattern();

+ 

+ 

+-              int uriMatches[regExpMatchesVectorLength];

++              pcre2_match_data *uriMD;

++              size_t *uriMatches;

+ 

+-              int  uriResult = pcre_exec(

++              uriMD = pcre2_match_data_create(regExpMatchesVectorLength, 
NULL);

++              int  uriResult = pcre2_match(

+                                                                       
matchUri,                                       /* the compiled pattern */

+-                                                                      0,      
                                                /* no extra data - we didn't 
study the pattern */

+-                                                                      
uriRef.c_str(),                         /* the subject string */

+-                                                                      
(int)uriRef.size(),                     /* the length of the subject */

++                                                                      
(PCRE2_SPTR)uriRef.c_str(),                             /* the subject string */

++                                                                      
uriRef.size(),                  /* the length of the subject */

+                                                                       0,      
                                                /* start at offset 0 in the 
subject */

+                                                                       0,      
                                                /* default options */

+-                                                                      
uriMatches,                             /* output vector for substring 
information */

+-                                                                      
regExpMatchesVectorLength);             /* number of elements in the output 
vector */

++                                                                      uriMD,  
                                /* match data */

++                                                                      NULL);  
                                /* match context */

+ 

+ 

+               if ( uriResult >= 0 )

+               {

++                      uriMatches = pcre2_get_ovector_pointer(uriMD);

+                       setStringFromMatches(scheme, uriRef, uriMatches, 2);

+                       setStringFromMatches(authority, uriRef, uriMatches, 4);

+                       setStringFromMatches(path, uriRef, uriMatches, 5);

+                       setStringFromMatches(query, uriRef, uriMatches, 6);

+                       setStringFromMatches(fragment, uriRef, uriMatches, 9);

++                      pcre2_match_data_free(uriMD);

+                       return true;

+               }

+ 

++              pcre2_match_data_free(uriMD);

+               return false;

+       }

+ 

+--- 
opencollada.orig/COLLADASaxFrameworkLoader/include/generated14/COLLADASaxFWLColladaParserAutoGen14Private.h
++++ 
opencollada/COLLADASaxFrameworkLoader/include/generated14/COLLADASaxFWLColladaParserAutoGen14Private.h
+@@ -17,7 +17,8 @@
+ #include "GeneratedSaxParserPrerequisites.h"
+ #include "GeneratedSaxParserTypes.h"
+ #include "GeneratedSaxParserParserTemplate.h"
+-#include "pcre.h"
++#define PCRE2_CODE_UNIT_WIDTH 8
++#include <pcre2.h>
+ #include "COLLADASaxFWLColladaParserAutoGen14Attributes.h"
+ #include "COLLADASaxFWLColladaParserAutoGen14.h"
+ #include "COLLADASaxFWLColladaParserAutoGen14ValidationData.h"
+--- 
opencollada.orig/COLLADASaxFrameworkLoader/include/generated15/COLLADASaxFWLColladaParserAutoGen15Private.h
++++ 
opencollada/COLLADASaxFrameworkLoader/include/generated15/COLLADASaxFWLColladaParserAutoGen15Private.h
+@@ -17,7 +17,8 @@
+ #include "GeneratedSaxParserPrerequisites.h"

+ #include "GeneratedSaxParserTypes.h"

+ #include "GeneratedSaxParserParserTemplate.h"

+-#include "pcre.h"

++#define PCRE2_CODE_UNIT_WIDTH 8
++#include <pcre2.h>
+ #include "COLLADASaxFWLColladaParserAutoGen15Attributes.h"

+ #include "COLLADASaxFWLColladaParserAutoGen15.h"

+ #include "COLLADASaxFWLColladaParserAutoGen15ValidationData.h"

+--- opencollada.orig/COLLADASaxFrameworkLoader/src/COLLADASaxFWLSidAddress.cpp
++++ opencollada/COLLADASaxFrameworkLoader/src/COLLADASaxFWLSidAddress.cpp
+@@ -12,7 +12,8 @@
+ #include "COLLADASaxFWLSidAddress.h"

+ #include "COLLADABUPcreCompiledPattern.h"

+ 

+-#include "pcre.h"
++#define PCRE2_CODE_UNIT_WIDTH 8
++#include <pcre2.h>
+ 

+ 

+ namespace COLLADASaxFWL

+@@ -113,30 +114,32 @@
+ 
+               // regular expression: "(.+)\.(.+)"

+               static const COLLADABU::PcreCompiledPattern 
accessorNameRegexCompiledPattern("(.+)\\.(.+)");
+-              pcre* accessorNameRegex = 
accessorNameRegexCompiledPattern.getCompiledPattern();
++              pcre2_code* accessorNameRegex = 
accessorNameRegexCompiledPattern.getCompiledPattern();
+ 
+-              int accessorNameMatches[regExpMatchesVectorLength];

++              pcre2_match_data* accessorNameMD;
++              size_t* accessorNameMatches;

+ 
+ 

+-              int  accessorNameResult = pcre_exec(

++              accessorNameMD = 
pcre2_match_data_create(regExpMatchesVectorLength, NULL);
++              int  accessorNameResult = pcre2_match(

+                                                                               
        accessorNameRegex,                      /* the compiled pattern */

+-                                                                              
        0,                                                      /* no extra 
data - we didn't study the pattern */

+-                                                                              
        secondPart,                                     /* the subject string */

++                                                                              
          (PCRE2_SPTR)secondPart,                       /* the subject string */

+                                                                               
        secondPartLength,                       /* the length of the subject */

+                                                                               
        0,                                                      /* start at 
offset 0 in the subject */

+                                                                               
        0,                                                      /* default 
options */

+-                                                                              
        accessorNameMatches,            /* output vector for substring 
information */

+-                                                                              
        regExpMatchesVectorLength);     /* number of elements in the output 
vector */

++                                                                              
        accessorNameMD,                 /* match data */

++                                                                              
        NULL);                          /* match context */

+ 

+ 

+               if ( accessorNameResult >= 0 )
+               {

+                       // first try the name accessor

+                       // this matches only, if the name accessor is present. 
Therefor there are exactly two matches 

+-                      int idOrSidStart = accessorNameMatches[2*1];

+-                      int idOrSidEnd = accessorNameMatches[2*1+1];

++                      accessorNameMatches = 
pcre2_get_ovector_pointer(accessorNameMD);
++                      size_t idOrSidStart = accessorNameMatches[2*1];

++                      size_t idOrSidEnd = accessorNameMatches[2*1+1];

+                       COLLADABU_ASSERT( idOrSidStart >= 0 );
+-                      if ( idOrSidStart >= 0 )
++                      if ( (int)idOrSidStart >= 0 )
+                       {
+                               if ( hasId )

+                               {

+@@ -150,10 +153,10 @@
+                               }

+                       }
+ 

+-                      int& nameStart = accessorNameMatches[2*2];

+-                      int& nameEnd = accessorNameMatches[2*2+1];

++                      size_t& nameStart = accessorNameMatches[2*2];

++                      size_t& nameEnd = accessorNameMatches[2*2+1];

+                       COLLADABU_ASSERT(nameStart>=0);
+-                      if ( nameStart>=0 )
++                      if ( (int)nameStart>=0 )
+                       {
+                               mMemberSelectionName.assign(secondPart + 
nameStart, nameEnd - nameStart);
+                       }
+@@ -166,29 +169,31 @@
+               {

+                       // regular expression: 
"([^(]+)(?:\(([0-9]+)\))?(?:\(([0-9]+)\))?"

+                       static const COLLADABU::PcreCompiledPattern 
accessorIndexRegexCompiledPattern("([^(]+)(?:\\(([0-9]+)\\))?(?:\\(([0-9]+)\\))?");
+-                      pcre* accessorIndexRegex = 
accessorIndexRegexCompiledPattern.getCompiledPattern();
++                      pcre2_code* accessorIndexRegex = 
accessorIndexRegexCompiledPattern.getCompiledPattern();
+ 
+-                      int accessorIndexMatches[regExpMatchesVectorLength];

++                      pcre2_match_data* accessorIndexMD;
++                      size_t* accessorIndexMatches;

+ 

+-                      int  accessorIndexResult = pcre_exec(

++                      accessorIndexMD = 
pcre2_match_data_create(regExpMatchesVectorLength, NULL);
++                      int  accessorIndexResult = pcre2_match(

+                               accessorIndexRegex,                     /* the 
compiled pattern */

+-                              0,                                              
        /* no extra data - we didn't study the pattern */

+-                              secondPart,                                     
/* the subject string */

++                              (PCRE2_SPTR)secondPart,                 /* the 
subject string */

+                               secondPartLength,                       /* the 
length of the subject */

+                               0,                                              
        /* start at offset 0 in the subject */

+                               0,                                              
        /* default options */

+-                              accessorIndexMatches,           /* output 
vector for substring information */

+-                              regExpMatchesVectorLength);

++                              accessorIndexMD,                        /* 
match data */

++                              NULL);

+ 

+                       if ( accessorIndexResult >= 0 )
+                       {

++                              accessorIndexMatches = 
pcre2_get_ovector_pointer(accessorIndexMD);
+                               //check all other cases

+                               // the first match is id or sid

+-                              int& idOrSidStart = accessorIndexMatches[2*1];

+-                              int& idOrSidEnd = accessorIndexMatches[2*1+1];

++                              size_t& idOrSidStart = 
accessorIndexMatches[2*1];

++                              size_t& idOrSidEnd = 
accessorIndexMatches[2*1+1];

+                               COLLADABU_ASSERT( idOrSidStart >= 0 );
+ 
+-                              if ( idOrSidStart >= 0 )
++                              if ( (int)idOrSidStart >= 0 )
+                               {
+                                       if ( hasId )

+                                       {

+@@ -204,9 +209,9 @@
+                               mMemberSelection = MEMBER_SELECTION_NONE;
+ 
+                               // this one matches only if two indices are 
specified. In case of one index, only the next matches
+-                              int& firstIndexStart = 
accessorIndexMatches[2*2];

+-                              int& firstIndexEnd = 
accessorIndexMatches[2*2+1];

+-                              if ( firstIndexStart >= 0)
++                              size_t& firstIndexStart = 
accessorIndexMatches[2*2];

++                              size_t& firstIndexEnd = 
accessorIndexMatches[2*2+1];

++                              if ( (int)firstIndexStart >= 0)
+                               {
+                                       mMemberSelection = 
MEMBER_SELECTION_ONE_INDEX;
+                                       bool failed = false;
+@@ -215,14 +220,16 @@
+                                       if ( failed )
+                                       {
+                                               mIsValid = false;
++                                              
pcre2_match_data_free(accessorNameMD);
++                                              
pcre2_match_data_free(accessorIndexMD);
+                                               return;
+                                       }
+                               }
+ 
+                               // this one matches if two indices or only 
index are specified. 
+-                              int& secondIndexStart = 
accessorIndexMatches[2*3];

+-                              int& secondIndexEnd = 
accessorIndexMatches[2*3+1];

+-                              if ( secondIndexStart >= 0)
++                              size_t& secondIndexStart = 
accessorIndexMatches[2*3];

++                              size_t& secondIndexEnd = 
accessorIndexMatches[2*3+1];

++                              if ( (int)secondIndexStart >= 0)
+                               {
+                                       bool failed = false;
+                                       const char* bufferBegin = secondPart + 
secondIndexStart;
+@@ -233,6 +240,8 @@
+                                       if ( failed )
+                                       {
+                                               mIsValid = false;
++                                              
pcre2_match_data_free(accessorNameMD);
++                                              
pcre2_match_data_free(accessorIndexMD);
+                                               return;
+                                       }
+                               }
+@@ -243,8 +252,10 @@
+                       {

+                               mIsValid = false;
+                       }

++                      pcre2_match_data_free(accessorIndexMD);
+               }
+ 
++              pcre2_match_data_free(accessorNameMD);
+       }

+ 

+       //------------------------------

+--- 
opencollada.orig/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLColladaParserAutoGen14PrivateValidation.cpp
++++ 
opencollada/COLLADASaxFrameworkLoader/src/generated14/COLLADASaxFWLColladaParserAutoGen14PrivateValidation.cpp
+@@ -1639,17 +1639,17 @@
+ {
+ // regular expression: "^([A-Z]|[_]|[a-z]|[:]|[-]|[.]|[0-9])+$"
+ static const COLLADABU::PcreCompiledPattern 
compiledPattern("^([A-Z]|[_]|[a-z]|[:]|[-]|[.]|[0-9])+$");
+-pcre* pattern = compiledPattern.getCompiledPattern();
+-int ovector[ PCRE_OVECCOUNT ];
+-int pcre_result = pcre_exec(
++pcre2_code* pattern = compiledPattern.getCompiledPattern();
++pcre2_match_data* ovector = pcre2_match_data_create(PCRE_OVECCOUNT, NULL);
++int pcre_result = pcre2_match(
+     pattern,
+-    0,
+     value,
+-    (int)length,
++    length,
+     0,
+     0,
+     ovector,
+-    PCRE_OVECCOUNT);
++    NULL);
++pcre2_match_data_free(ovector);
+ if (pcre_result < 0)
+     return ParserError::ERROR_VALIDATION_PATTERN;
+ 
+@@ -1774,17 +1774,17 @@
+ {
+ // regular expression: "^([A-Z]|[_]|[a-z])([A-Z]|[_]|[a-z]|[-]|[.]|[0-9])*$"
+ static const COLLADABU::PcreCompiledPattern 
compiledPattern("^([A-Z]|[_]|[a-z])([A-Z]|[_]|[a-z]|[-]|[.]|[0-9])*$");
+-pcre* pattern = compiledPattern.getCompiledPattern();
+-int ovector[ PCRE_OVECCOUNT ];
+-int pcre_result = pcre_exec(
++pcre2_code* pattern = compiledPattern.getCompiledPattern();
++pcre2_match_data* ovector = pcre2_match_data_create(PCRE_OVECCOUNT, NULL);
++int pcre_result = pcre2_match(
+     pattern,
+-    0,
+     value,
+-    (int)length,
++    length,
+     0,
+     0,
+     ovector,
+-    PCRE_OVECCOUNT);
++    NULL);
++pcre2_match_data_free(ovector);
+ if (pcre_result < 0)
+     return ParserError::ERROR_VALIDATION_PATTERN;
+ 
+@@ -2165,17 +2165,17 @@
+ {
+ // regular expression: 
"^([A-Z]|[_]|[a-z]|[:])([A-Z]|[_]|[a-z]|[:]|[-]|[.]|[0-9])*$"
+ static const COLLADABU::PcreCompiledPattern 
compiledPattern("^([A-Z]|[_]|[a-z]|[:])([A-Z]|[_]|[a-z]|[:]|[-]|[.]|[0-9])*$");
+-pcre* pattern = compiledPattern.getCompiledPattern();
+-int ovector[ PCRE_OVECCOUNT ];
+-int pcre_result = pcre_exec(
++pcre2_code* pattern = compiledPattern.getCompiledPattern();
++pcre2_match_data* ovector = pcre2_match_data_create(PCRE_OVECCOUNT, NULL);
++int pcre_result = pcre2_match(
+     pattern,
+-    0,
+     value,
+-    (int)length,
++    length,
+     0,
+     0,
+     ovector,
+-    PCRE_OVECCOUNT);
++    NULL);
++pcre2_match_data_free(ovector);
+ if (pcre_result < 0)
+     return ParserError::ERROR_VALIDATION_PATTERN;
+ 
+@@ -2774,17 +2774,17 @@
+ {
+ // regular expression: "^(#(.*))$"
+ static const COLLADABU::PcreCompiledPattern compiledPattern("^(#(.*))$");
+-pcre* pattern = compiledPattern.getCompiledPattern();
+-int ovector[ PCRE_OVECCOUNT ];
+-int pcre_result = pcre_exec(
++pcre2_code* pattern = compiledPattern.getCompiledPattern();
++pcre2_match_data* ovector = pcre2_match_data_create(PCRE_OVECCOUNT, NULL);
++int pcre_result = pcre2_match(
+     pattern,
+-    0,
+     value,
+-    (int)length,
++    length,
+     0,
+     0,
+     ovector,
+-    PCRE_OVECCOUNT);
++    NULL);
++pcre2_match_data_free(ovector);
+ if (pcre_result < 0)
+     return ParserError::ERROR_VALIDATION_PATTERN;
+ 
+@@ -29218,17 +29218,17 @@
+ {
+ // regular expression: "^([A-Z]|[_]|[a-z])([A-Z]|[_]|[a-z]|[-]|[.]|[0-9])*$"
+ static const COLLADABU::PcreCompiledPattern 
compiledPattern("^([A-Z]|[_]|[a-z])([A-Z]|[_]|[a-z]|[-]|[.]|[0-9])*$");
+-pcre* pattern = compiledPattern.getCompiledPattern();
+-int ovector[ PCRE_OVECCOUNT ];
+-int pcre_result = pcre_exec(
++pcre2_code* pattern = compiledPattern.getCompiledPattern();
++pcre2_match_data* ovector = pcre2_match_data_create(PCRE_OVECCOUNT, NULL);
++int pcre_result = pcre2_match(
+     pattern,
+-    0,
+     value,
+-    (int)length,
++    length,
+     0,
+     0,
+     ovector,
+-    PCRE_OVECCOUNT);
++    NULL);
++pcre2_match_data_free(ovector);
+ if (pcre_result < 0)
+     return ParserError::ERROR_VALIDATION_PATTERN;
+ 
+--- 
opencollada.orig/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLColladaParserAutoGen15PrivateValidation.cpp
++++ 
opencollada/COLLADASaxFrameworkLoader/src/generated15/COLLADASaxFWLColladaParserAutoGen15PrivateValidation.cpp
+@@ -1567,17 +1567,17 @@
+ {

+ // regular expression: 
"^[A-Za-z0-9!#-'\*\+\-/=\?\^_`\{-~]+(\.[A-Za-z0-9!#-'\*\+\-/=\?\^_`\{-~]+)*@[A-Za-z0-9!#-'\*\+\-/=\?\^_`\{-~]+(\.[A-Za-z0-9!#-'\*\+\-/=\?\^_`\{-~]+)*$"
+ static const COLLADABU::PcreCompiledPattern 
compiledPattern("^[A-Za-z0-9!#-'\\*\\+\\-/=\\?\\^_`\\{-~]+(\\.[A-Za-z0-9!#-'\\*\\+\\-/=\\?\\^_`\\{-~]+)*@[A-Za-z0-9!#-'\\*\\+\\-/=\\?\\^_`\\{-~]+(\\.[A-Za-z0-9!#-'\\*\\+\\-/=\\?\\^_`\\{-~]+)*$");

+-pcre* pattern = compiledPattern.getCompiledPattern();
+-int ovector[ PCRE_OVECCOUNT ];
+-int pcre_result = pcre_exec(
++pcre2_code* pattern = compiledPattern.getCompiledPattern();
++pcre2_match_data* ovector = pcre2_match_data_create(PCRE_OVECCOUNT, NULL);
++int pcre_result = pcre2_match(
+     pattern,
+-    0,
+     value,
+-    (int)length,
++    length,
+     0,
+     0,
+     ovector,
+-    PCRE_OVECCOUNT);
++    NULL);
++pcre2_match_data_free(ovector);
+ if (pcre_result < 0)
+     return ParserError::ERROR_VALIDATION_PATTERN;
+ 

+@@ -2476,17 +2476,17 @@
+ {

+ // regular expression: "^([A-Z]|[_]|[a-z]|[:]|[-]|[.]|[0-9])+$"
+ static const COLLADABU::PcreCompiledPattern 
compiledPattern("^([A-Z]|[_]|[a-z]|[:]|[-]|[.]|[0-9])+$");

+-pcre* pattern = compiledPattern.getCompiledPattern();
+-int ovector[ PCRE_OVECCOUNT ];
+-int pcre_result = pcre_exec(
++pcre2_code* pattern = compiledPattern.getCompiledPattern();
++pcre2_match_data* ovector = pcre2_match_data_create(PCRE_OVECCOUNT, NULL);
++int pcre_result = pcre2_match(
+     pattern,
+-    0,
+     value,
+-    (int)length,
++    length,
+     0,
+     0,
+     ovector,
+-    PCRE_OVECCOUNT);
++    NULL);
++pcre2_match_data_free(ovector);
+ if (pcre_result < 0)
+     return ParserError::ERROR_VALIDATION_PATTERN;
+ 

+@@ -5276,17 +5276,17 @@
+ {

+ // regular expression: 
"^([A-Z]|[_]|[a-z]|[:])([A-Z]|[_]|[a-z]|[:]|[-]|[.]|[0-9])*$"
+ static const COLLADABU::PcreCompiledPattern 
compiledPattern("^([A-Z]|[_]|[a-z]|[:])([A-Z]|[_]|[a-z]|[:]|[-]|[.]|[0-9])*$");

+-pcre* pattern = compiledPattern.getCompiledPattern();
+-int ovector[ PCRE_OVECCOUNT ];
+-int pcre_result = pcre_exec(
++pcre2_code* pattern = compiledPattern.getCompiledPattern();
++pcre2_match_data* ovector = pcre2_match_data_create(PCRE_OVECCOUNT, NULL);
++int pcre_result = pcre2_match(
+     pattern,
+-    0,
+     value,
+-    (int)length,
++    length,
+     0,
+     0,
+     ovector,
+-    PCRE_OVECCOUNT);
++    NULL);
++pcre2_match_data_free(ovector);
+ if (pcre_result < 0)
+     return ParserError::ERROR_VALIDATION_PATTERN;
+ 

+@@ -5465,17 +5465,18 @@
+ ParserError::ErrorType validate__sidref_type( const ParserChar* value, size_t 
length )

+ {

+ // regular expression: 
"^((([A-Z]|[_]|[a-z])([A-Z]|[_]|[a-z]|[-]|[.]|[0-9])*)|.)(/([A-Z]|[_]|[a-z])([A-Z]|[_]|[a-z]|[-]|[.]|[0-9])*)+((\.([A-Z]|[_]|[a-z])([A-Z]|[_]|[a-z]|[-]|[.]|[0-9])*)|(\([0-9]+\)){1,2})?$"
+-static const COLLADABU::PcreCompiledPattern 
compiledPattern("^((([A-Z]|[_]|[a-z])([A-Z]|[_]|[a-z]|[-]|[.]|[0-9])*)|.)(/([A-Z]|[_]|[a-z])([A-Z]|[_]|[a-z]|[-]|[.]|[0-9])*)+((\\.([A-Z]|[_]|[a-z])([A-Z]|[_]|[a-z]|[-]|[.]|[0-9])*)|(\\([0-9]+\\)){1,2})?$");pcre*
 pattern = compiledPattern.getCompiledPattern();
+-int ovector[ PCRE_OVECCOUNT ];
+-int pcre_result = pcre_exec(
++static const COLLADABU::PcreCompiledPattern 
compiledPattern("^((([A-Z]|[_]|[a-z])([A-Z]|[_]|[a-z]|[-]|[.]|[0-9])*)|.)(/([A-Z]|[_]|[a-z])([A-Z]|[_]|[a-z]|[-]|[.]|[0-9])*)+((\\.([A-Z]|[_]|[a-z])([A-Z]|[_]|[a-z]|[-]|[.]|[0-9])*)|(\\([0-9]+\\)){1,2})?$");
++pcre2_code* pattern = compiledPattern.getCompiledPattern();
++pcre2_match_data* ovector = pcre2_match_data_create(PCRE_OVECCOUNT, NULL);
++int pcre_result = pcre2_match(
+     pattern,
+-    0,
+     value,
+-    (int)length,
++    length,
+     0,
+     0,
+     ovector,
+-    PCRE_OVECCOUNT);
++    NULL);
++pcre2_match_data_free(ovector);
+ if (pcre_result < 0)
+     return ParserError::ERROR_VALIDATION_PATTERN;
+ 

+@@ -5635,17 +5636,17 @@
+ {

+ // regular expression: "^([A-Z]|[_]|[a-z])([A-Z]|[_]|[a-z]|[-]|[.]|[0-9])*$"
+ static const COLLADABU::PcreCompiledPattern 
compiledPattern("^([A-Z]|[_]|[a-z])([A-Z]|[_]|[a-z]|[-]|[.]|[0-9])*$");

+-pcre* pattern = compiledPattern.getCompiledPattern();
+-int ovector[ PCRE_OVECCOUNT ];
+-int pcre_result = pcre_exec(
++pcre2_code* pattern = compiledPattern.getCompiledPattern();
++pcre2_match_data* ovector = pcre2_match_data_create(PCRE_OVECCOUNT, NULL);
++int pcre_result = pcre2_match(
+     pattern,
+-    0,
+     value,
+-    (int)length,
++    length,
+     0,
+     0,
+     ovector,
+-    PCRE_OVECCOUNT);
++    NULL);
++pcre2_match_data_free(ovector);
+ if (pcre_result < 0)
+     return ParserError::ERROR_VALIDATION_PATTERN;
+ 

+@@ -5810,17 +5811,17 @@
+ {

+ // regular expression: "^(#(.*))$"
+ static const COLLADABU::PcreCompiledPattern compiledPattern("^(#(.*))$");

+-pcre* pattern = compiledPattern.getCompiledPattern();
+-int ovector[ PCRE_OVECCOUNT ];
+-int pcre_result = pcre_exec(
++pcre2_code* pattern = compiledPattern.getCompiledPattern();
++pcre2_match_data* ovector = pcre2_match_data_create(PCRE_OVECCOUNT, NULL);
++int pcre_result = pcre2_match(
+     pattern,
+-    0,
+     value,
+-    (int)length,
++    length,
+     0,
+     0,
+     ovector,
+-    PCRE_OVECCOUNT);
++    NULL);
++pcre2_match_data_free(ovector);
+ if (pcre_result < 0)
+     return ParserError::ERROR_VALIDATION_PATTERN;
+ 

+@@ -10050,17 +10051,17 @@
+ {

+ // regular expression: "^([A-Z]|[_]|[a-z])([A-Z]|[_]|[a-z]|[-]|[.]|[0-9])*$"
+ static const COLLADABU::PcreCompiledPattern 
compiledPattern("^([A-Z]|[_]|[a-z])([A-Z]|[_]|[a-z]|[-]|[.]|[0-9])*$");

+-pcre* pattern = compiledPattern.getCompiledPattern();
+-int ovector[ PCRE_OVECCOUNT ];
+-int pcre_result = pcre_exec(
++pcre2_code* pattern = compiledPattern.getCompiledPattern();
++pcre2_match_data *ovector = pcre2_match_data_create(PCRE_OVECCOUNT, NULL);
++int pcre_result = pcre2_match(
+     pattern,
+-    0,
+     value,
+-    (int)length,
++    length,
+     0,
+     0,
+     ovector,
+-    PCRE_OVECCOUNT);
++    NULL);
++pcre2_match_data_free(ovector);
+ if (pcre_result < 0)
+     return ParserError::ERROR_VALIDATION_PATTERN;
+ 

+--- opencollada.orig/Externals/cmake-modules/FindPCRE.cmake
++++ opencollada/Externals/cmake-modules/FindPCRE.cmake
+@@ -10,33 +10,31 @@
+ # Redistribution and use is allowed according to the terms of the BSD license.

+ # For details see the accompanying COPYING-CMAKE-SCRIPTS file.

+ 

+-if (PCRE_INCLUDE_DIR AND PCRE_PCREPOSIX_LIBRARY AND PCRE_PCRE_LIBRARY)

++if (PCRE_INCLUDE_DIR AND PCRE_PCRE_LIBRARY)

+   # Already in cache, be silent

+   set(PCRE_FIND_QUIETLY TRUE)

+-endif (PCRE_INCLUDE_DIR AND PCRE_PCREPOSIX_LIBRARY AND PCRE_PCRE_LIBRARY)

++endif (PCRE_INCLUDE_DIR AND PCRE_PCRE_LIBRARY)

+       

+ if (NOT WIN32)

+   # use pkg-config to get the directories and then use these values

+   # in the FIND_PATH() and FIND_LIBRARY() calls

+   find_package(PkgConfig)

+-  pkg_check_modules(PC_PCRE QUIET libpcre)

++  pkg_check_modules(PC_PCRE QUIET libpcre2-8)

+   set(PCRE_DEFINITIONS ${PC_PCRE_CFLAGS_OTHER})

+ endif (NOT WIN32)

+ 

+-find_path(PCRE_INCLUDE_DIR pcre.h

++find_path(PCRE_INCLUDE_DIR pcre2.h

+           HINTS ${PC_PCRE_INCLUDEDIR} ${PC_PCRE_INCLUDE_DIRS}

+           PATH_SUFFIXES pcre)

+ 

+-find_library(PCRE_PCRE_LIBRARY NAMES pcre HINTS ${PC_PCRE_LIBDIR} 
${PC_PCRE_LIBRARY_DIRS})

+-

+-find_library(PCRE_PCREPOSIX_LIBRARY NAMES pcreposix HINTS ${PC_PCRE_LIBDIR} 
${PC_PCRE_LIBRARY_DIRS})

++find_library(PCRE_PCRE_LIBRARY NAMES pcre2-8 HINTS ${PC_PCRE_LIBDIR} 
${PC_PCRE_LIBRARY_DIRS})

+ 

+ include(FindPackageHandleStandardArgs)

+ 

+ IF(NOT WIN32)

+-        find_package_handle_standard_args(PCRE DEFAULT_MSG PCRE_INCLUDE_DIR 
PCRE_PCRE_LIBRARY PCRE_PCREPOSIX_LIBRARY )

+-        mark_as_advanced(PCRE_INCLUDE_DIR PCRE_LIBRARIES 
PCRE_PCREPOSIX_LIBRARY PCRE_PCRE_LIBRARY)

+-        set(PCRE_LIBRARIES ${PCRE_PCRE_LIBRARY} ${PCRE_PCREPOSIX_LIBRARY})

++        find_package_handle_standard_args(PCRE DEFAULT_MSG PCRE_INCLUDE_DIR 
PCRE_PCRE_LIBRARY)

++        mark_as_advanced(PCRE_INCLUDE_DIR PCRE_LIBRARIES PCRE_PCRE_LIBRARY)

++        set(PCRE_LIBRARIES ${PCRE_PCRE_LIBRARY})

+ ELSE()

+         find_package_handle_standard_args(PCRE DEFAULT_MSG PCRE_INCLUDE_DIR 
PCRE_PCRE_LIBRARY  )

+         set(PCRE_LIBRARIES ${PCRE_PCRE_LIBRARY} )

diff --git a/debian/patches/series b/debian/patches/series
index 7d34698..372021a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 opencollada.libxml.patch.0
 fix-cmake-config.diff
 fPIC.diff
+pcre2.patch
-- 
2.43.0

Reply via email to