don't rely on the sqlite3 cli accepting double-quoted strings as literals

if they don't match a valid identifier, as of 3.41.0 (2023-02-21) standard
builds of the cli no longer accept this and warn instead. currently builds
from the "autoconf" distribution file do still accept this, but sqlports
should not rely on something that upstream are trying to teach people not
to use.  https://sqlite.org/quirks.html#dblquote

from espie
This commit is contained in:
sthen
2025-11-03 14:46:04 +00:00
parent a13b2e370e
commit a76114ab0d
4 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
CATEGORIES = databases
V = 7.52
V = 7.53
DISTNAME = sqlports-$V
DISTFILES =
COMMENT-main = sqlite database of ports
+2 -2
View File
@@ -1,4 +1,4 @@
# $OpenBSD: Var.pm,v 1.75 2023/11/11 11:53:07 espie Exp $
# $OpenBSD: Var.pm,v 1.76 2025/11/03 14:46:04 sthen Exp $
#
# Copyright (c) 2006-2010 Marc Espie <espie@openbsd.org>
#
@@ -689,7 +689,7 @@ sub expr($self)
qq{CASE $q
WHEN 0 THEN $v
WHEN 1 THEN '"'||$v||'"'
WHEN 2 THEN "'"||$v||"'"
WHEN 2 THEN ''''||$v||''''
END};
}
@@ -1,5 +1,5 @@
#! /bin/sh
# $OpenBSD: print-ports-index,v 1.12 2019/07/14 11:27:19 espie Exp $
# $OpenBSD: print-ports-index,v 1.13 2025/11/03 14:46:04 sthen Exp $
#
# Copyright (c) 2018 Marc Espie <espie@openbsd.org>
#
@@ -29,7 +29,7 @@ cat <<'EOSQL' |sqlite3 $file
with
d1 (d, p, t) as
(select
distinct((case pkgspec when '' then '' else pkgspec||":" end)||_paths.fullpkgpath) as fd,
distinct((case pkgspec when '' then '' else pkgspec||':' end)||_paths.fullpkgpath) as fd,
_depends.fullpkgpath, type
from _depends join _paths on _Paths.Id=_depends.dependspath order by fd),
-- and now the part that's going to be used 3 times in the main request
@@ -37,7 +37,7 @@ with
(select group_concat(d, ' ') as dlist, p, t
from d1 group by p, t)
select fullpkgname, ports.fullpkgpath,
(case prefix when '/usr/local' THEN "" else prefix end),
(case prefix when '/usr/local' THEN '' else prefix end),
comment,descr, maintainer,categories,
libd.dlist, buildd.dlist, rund.dlist,
@@ -52,8 +52,8 @@ select fullpkgname, ports.fullpkgpath,
else only_for_archs
end,
'?',
(case lower(PERMIT_PACKAGE) when "yes" then "y" else "n" end),
(case lower(PERMIT_DISTFILES) when "yes" then "y" else "n" end)
(case lower(PERMIT_PACKAGE) when 'yes' then 'y' else 'n' end),
(case lower(PERMIT_DISTFILES) when 'yes' then 'y' else 'n' end)
from ports
left join d2 as libd on libd.p=ports.pathid and libd.t=0
left join d2 as buildd on buildd.p=ports.pathid and buildd.t=2
@@ -1,5 +1,5 @@
#! /bin/sh
# $OpenBSD: show-reverse-deps,v 1.10 2020/06/11 19:55:15 espie Exp $
# $OpenBSD: show-reverse-deps,v 1.11 2025/11/03 14:46:04 sthen Exp $
#
# Copyright (c) 2018 Marc Espie <espie@openbsd.org>
#
@@ -72,9 +72,9 @@ fi
if $fuzzy
then
query="p2.fullpkgpath like \"%$1%\""
query="p2.fullpkgpath like '%$1%'"
else
query="p2.fullpkgpath=\"$1\""
query="p2.fullpkgpath='$1'"
fi
if $verbose
then