[Merge] ~unity7maintainers/ubuntu/+source/nux:ubuntu/devel into ubuntu/+source/nux:ubuntu/devel

Skia mp+499456 at code.launchpad.net
Fri Jan 30 14:42:27 UTC 2026


Review: Needs Fixing

Left a couple of inline-comments. That generally looks wayyy better :-)

Diff comments:

> diff --git a/debian/changelog b/debian/changelog
> index 0e1b9d7..725c18a 100644
> --- a/debian/changelog
> +++ b/debian/changelog
> @@ -1,3 +1,9 @@
> +nux (4.0.8+18.10.20180623-0ubuntu12) UNRELEASED; urgency=medium

Please change the `UNRELEASED` to `resolute`, so that I can sponsor right away from your git branch.

> +
> +  * debian/patches: Add patch for migrating from libpcre3 to libpcre2 (LP: #2103918)
> +
> + -- Tomasz Jeruzalski <tomekdev17 at gmail.com>  Wed, 28 Jan 2026 19:03:12 +0000
> +
>  nux (4.0.8+18.10.20180623-0ubuntu11) questing; urgency=medium
>  
>    * d/control: use the non deprecated libgdk-pixbuf-2.0-dev (lp: #2118581)
> diff --git a/debian/patches/migrate-to-libpcre2.patch b/debian/patches/migrate-to-libpcre2.patch
> new file mode 100644
> index 0000000..8b8551a
> --- /dev/null
> +++ b/debian/patches/migrate-to-libpcre2.patch
> @@ -0,0 +1,130 @@

Since the patch is coming from Gentoo, it would be nice to add an `Origin` tag pointing at that link. That would help future maintainers of the patch reached out to the original authors for help, or grab newer versions of the patch more easily.

> +Description: Migrate nux to libpcre2
> + Migrate to libpcre2 because libpcre3 is unmaintained.
> +Author: Tomasz Jeruzalski<tomekdev17 at gmail.com>
> +Forwarded: no
> +Last-Update: 2026-01-28 <YYYY-MM-DD, last update of the meta-information, optional>

You can remove the template part (`<YYYY-MM-DD, last update of the meta-information, optional>`)

> +---
> +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/

This line is not needed.

> +--- a/Nux/Validator.cpp
> ++++ b/Nux/Validator.cpp
> +@@ -27,12 +27,19 @@
> + {
> + 
> +   Validator::Validator()
> ++#if !defined(NUX_OS_WINDOWS)
> ++    : _regexp(nullptr)
> ++#endif
> +   {
> +   }
> + 
> +   Validator::~Validator()
> +   {
> + 
> ++#if !defined(NUX_OS_WINDOWS)
> ++    if (_regexp)
> ++      pcre2_code_free(_regexp);
> ++#endif
> +   }
> + 
> +   bool Validator::InitRegExp()
> +@@ -41,18 +48,23 @@
> +     regex_ = _regexp_str.c_str();
> +     return true;
> + #else
> +-    const char *error;
> +-    int   erroffset;
> +-    _regexp = pcre_compile(
> +-      _regexp_str.c_str(),    /* the pattern */
> +-      PCRE_MULTILINE,
> +-      &error,         /* for error message */
> +-      &erroffset,     /* for error offset */
> +-      0);             /* use default character tables */
> ++    int        errorcode;
> ++    PCRE2_SIZE erroroffset;
> ++    _regexp = pcre2_compile(
> ++      reinterpret_cast<PCRE2_SPTR>(_regexp_str.c_str()),  /* pattern */
> ++      PCRE2_ZERO_TERMINATED,                              /* pattern length */
> ++      PCRE2_MULTILINE,                                    /* option bits */
> ++      &errorcode,                                         /* error code */
> ++      &erroroffset,                                       /* error offset */
> ++      nullptr);                                           /* compile context */
> + 
> +     if (!_regexp)
> +     {
> +-      nuxDebugMsg("[IntegerValidator::IntegerValidator] Invalid regular expression: %s", _regexp_str.c_str());
> ++      PCRE2_UCHAR buffer[256];
> ++      pcre2_get_error_message(errorcode, buffer, sizeof(buffer));
> ++      nuxDebugMsg("[Validator::InitRegExp] Invalid regular expression '%s' "
> ++                  "at offset %d: %s",
> ++                  _regexp_str.c_str(), (int)erroroffset, buffer);
> +       return false;
> +     }    
> +     return true;
> +@@ -72,20 +84,24 @@
> +     }
> +     return Validator::Acceptable;
> + #else
> +-    if (_regexp == 0)
> ++    if (!_regexp || !str)
> +       return Validator::Invalid;
> + 
> +-    int out_vector [10];
> +-    unsigned int offset = 0;
> +-    int len = (int) strlen(str);
> +-
> +-    // See the "PCRE DISCUSSION OF STACK USAGE" and why it maybe necessary to limit the stack usage.
> +-    pcre_extra extra;
> +-    extra.flags = PCRE_EXTRA_MATCH_LIMIT_RECURSION;
> +-    extra.match_limit_recursion = 2000; 
> ++    pcre2_match_data *match_data =
> ++        pcre2_match_data_create_from_pattern(_regexp, nullptr);
> ++
> ++    int rc = pcre2_match(
> ++        _regexp,                                   /* compiled pattern */
> ++        reinterpret_cast<PCRE2_SPTR>(str),         /* subject string */
> ++        strlen(str),                               /* length of subject */
> ++        0,                                         /* start offset */
> ++        0,                                         /* match options */
> ++        match_data,                                /* match data block */
> ++        nullptr);                                  /* match context */
> ++
> ++    pcre2_match_data_free(match_data);
> + 
> +-    int rc = pcre_exec(_regexp, &extra, str, len, offset, 0, out_vector, 10);
> +-    if (rc <= -1)
> ++    if (rc < 0)
> +     {
> +       return Validator::Invalid;
> +     }
> +--- a/Nux/Validator.h
> ++++ b/Nux/Validator.h
> +@@ -26,7 +26,8 @@
> + #if defined(NUX_OS_WINDOWS)
> +   #include <regex>
> + #else
> +-  #include <pcre.h>
> ++  #define PCRE2_CODE_UNIT_WIDTH 8
> ++  #include <pcre2.h>
> + #endif
> + 
> + namespace nux
> +@@ -57,7 +58,7 @@
> + #if defined(NUX_OS_WINDOWS)
> +     std::regex regex_;
> + #else
> +-    pcre *_regexp;
> ++    pcre2_code *_regexp;
> + #endif
> +   };
> + }
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -196,7 +196,7 @@
> +                   sigc++-2.0
> +                   pango
> +                   pangocairo
> +-                  libpcre
> ++                  libpcre2-8
> +                   )
> + AC_SUBST(NUX_CFLAGS)
> + AC_SUBST(NUX_LIBS)


-- 
https://code.launchpad.net/~unity7maintainers/ubuntu/+source/nux/+git/nux/+merge/499456
Your team Unity7 Maintainers Team is subscribed to branch ~unity7maintainers/ubuntu/+source/nux:ubuntu/devel.




More information about the Ubuntu-reviews mailing list