Looking at "pkg shell .dump | grep \ deps\ " results, it seems that origin 
without @flavor is not unique.
However, ports that use FLAVORS are modified to make the PKGNAME unique.

So, the following patch is applied and it seems to be working properly.
The commands used in the tests are as follows.

pkg query -e "%#r > 2" "%n:%#r" | sort -t : -k 2nr -k 1

If someone has already repaired it, forget it :)

Regards.

--- src/query.c.orig    2022-08-03 07:37:06 UTC
+++ src/query.c
@@ -557,7 +557,7 @@ format_sql_condition(const char *str, xstring *sqlcond
                                                        fprintf(sqlcond->fp, 
"(SELECT %s FROM deps AS d WHERE d.package_id=p.id)", sqlop);
                                                        break;
                                                case 'r':
-                                                       fprintf(sqlcond->fp, 
"(SELECT %s FROM deps AS d WHERE d.origin=p.origin)", sqlop);
+                                                       fprintf(sqlcond->fp, 
"(SELECT %s FROM deps AS d WHERE d.name=p.name)", sqlop);
                                                        break;
                                                case 'C':
                                                        fprintf(sqlcond->fp, 
"(SELECT %s FROM pkg_categories AS d WHERE d.package_id=p.id)", sqlop);


Reply via email to