1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-08 06:48:28 +00:00

Fix regex, which fixes portmaster/portupgrade integration

Reported by:	kwm
This commit is contained in:
Bryan Drewery 2014-06-12 20:15:10 +00:00
parent b9a640d15d
commit 600d8ff67a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=357633
3 changed files with 31 additions and 1 deletions

View File

@ -2,7 +2,7 @@
PORTNAME= pkg
DISTVERSION= 1.3.0.b3
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= ports-mgmt
MASTER_SITES= \
http://files.etoilebsd.net/pkg/ \

View File

@ -0,0 +1,30 @@
commit 8ccfa88c4bb211ebe421eb4beaa826fa03a1548b
Author: Bryan Drewery <bryan@shatow.net>
Date: Thu Jun 12 15:10:53 2014 -0500
pkgdb_get_pattern_query: Fix regex handling when '-' used by not using SPLIT_VERSION
Error:
# pkg info -x 'pkg(-devel)?$'
pkg: sqlite error while executing iterator in file pkgdb.c:1548: Invalid regex
Expected:
# pkg info -x 'pkg(-devel)?$'
pkg-devel-1.3.0.b2
Partial revert from fa815ff62
diff --git libpkg/pkgdb.c libpkg/pkgdb.c
index 008bb84..9e38631 100644
--- libpkg/pkgdb.c
+++ libpkg/pkgdb.c
@@ -1651,8 +1651,7 @@ pkgdb_get_pattern_query(const char *pattern, match_t match)
if (checkuid == NULL) {
if (checkorigin == NULL)
comp = " WHERE name REGEXP ?1 "
- "OR (name REGEXP SPLIT_VERSION('name', ?1) AND "
- " version REGEXP SPLIT_VERSION('version', ?1))";
+ "OR name || '-' || version REGEXP ?1";
else
comp = " WHERE origin REGEXP ?1";
} else {