"pkg upgrade" doesn't

Dag-Erling Smørgrav des at des.no
Tue Jul 1 10:03:29 UTC 2014


Dag-Erling Smørgrav <des at des.no> writes:
> BTW, it would be nice to have a) a query pattern that prints the
> repository a package was installed from [...]

So apparently, this is implemented but not available.  If I add an entry
for 'R' to accepted_query_flags[] in src/query.c, I can use %R, but it
doesn't work:

% ./src/pkg-static query %R pkg-devel
(null)
% pkg info pkg-devel | grep repos
	repository     : des-local

that's because %R is implemented as pkg_printf("%N") which returns
PKG_REPONAME ("reponame"), which doesn't seem to exist at this point.

>From reading pkg_jobs.c, I get the impression that PKG_REPONAME is only
valid for the in-memory version of pkg constructed from the repo
manifest during "pkg upgrade", is that correct?

In that case, fixing %R should be a simple matter of fetching the
"repository" annotation if PKG_REPONAME is not available.  See pull
request #855.

DES
-- 
Dag-Erling Smørgrav - des at des.no


More information about the freebsd-pkg mailing list