have show-reverse-deps be more extensive.

Specifically, get it to take a pkgpath, and extend it to all variations
on that path
(e.g., try
show-reverse-deps devel/py-jedi after the change,
yields all the stuff depending on python2 AND python3 flavors)
This commit is contained in:
espie 2018-12-19 15:29:47 +00:00
parent 477badbf39
commit 4702394208
2 changed files with 12 additions and 7 deletions

View File

@ -1,7 +1,7 @@
# $OpenBSD: Makefile,v 1.99 2018/12/04 10:35:09 espie Exp $
# $OpenBSD: Makefile,v 1.100 2018/12/19 15:29:47 espie Exp $
CATEGORIES = databases
V = 7.8
V = 7.9
DISTNAME = sqlports-$V
DISTFILES =
COMMENT = sqlite database of ports

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $OpenBSD: show-reverse-deps,v 1.4 2018/11/29 17:26:18 espie Exp $
# $OpenBSD: show-reverse-deps,v 1.5 2018/12/19 15:29:47 espie Exp $
#
# Copyright (c) 2018 Marc Espie <espie@openbsd.org>
#
@ -36,11 +36,16 @@ cat <<EOSQL |sqlite3 $file
with recursive d (fullpkgpath, dependspath) as
(select root.fullpkgpath, root.dependspath
from _canonical_depends root
join _paths on root.dependspath=_paths.canonical
and _paths.fullpkgpath="$1"
join _paths
on root.dependspath=_paths.canonical
join _paths p2
on p2.fullpkgpath="$1" and p2.id=_paths.pkgpath
union
select child.fullpkgpath, child.dependspath
from d parent, _canonical_depends child where parent.fullpkgpath=child.dependspath)
select distinct(_paths.fullpkgpath) from d join _paths on _paths.id=d.fullpkgpath
from d parent, _canonical_depends child
where parent.fullpkgpath=child.dependspath)
select distinct(_paths.fullpkgpath) from d
join _paths
on _paths.id=d.fullpkgpath
order by _paths.fullpkgpath;
EOSQL