diff --git a/NEWS b/NEWS index 046babac..aabf0979 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ xbps-0.22 (???): + * xbps-query(8): make -o (ownedby) follow symlinks. Fix issue #4 from github. + This works in local and repository mode. + * xbps-create(8): if effective user/group is the same than files being packaged in a package, set user/group to root:root. This way we don't have to depend in an external tool to assume proper permissions (fakeroot). diff --git a/bin/xbps-query/ownedby.c b/bin/xbps-query/ownedby.c index 644645b6..12c525ad 100644 --- a/bin/xbps-query/ownedby.c +++ b/bin/xbps-query/ownedby.c @@ -109,10 +109,17 @@ int ownedby(struct xbps_handle *xhp, int npatterns, char **patterns) { struct ffdata ffd; + char *rfile; + int i; ffd.npatterns = npatterns; ffd.patterns = patterns; + for (i = 0; i < npatterns; i++) { + rfile = realpath(patterns[i], NULL); + if (rfile) + patterns[i] = rfile; + } return xbps_pkgdb_foreach_cb(xhp, ownedby_pkgdb_cb, &ffd); } @@ -179,9 +186,16 @@ int repo_ownedby(struct xbps_handle *xhp, int npatterns, char **patterns) { struct ffdata ffd; + char *rfile; + int i; ffd.npatterns = npatterns; ffd.patterns = patterns; + for (i = 0; i < npatterns; i++) { + rfile = realpath(patterns[i], NULL); + if (rfile) + patterns[i] = rfile; + } return xbps_rpool_foreach(xhp, repo_ownedby_cb, &ffd); }