Created attachment 149030 [details] A patch for www/polipo. (1) Cannot use a cache directory (2) Don't remove a cache directory unconditionally at uninstallation (3) Fix messages such as "pkg-static: unlinkat(usr/local/etc/polipo/): No such file or directory" at uninstallation (1) Cannot use a cache directory (Update: pkg-plist files/pkg-install.in) The owner, group and permission of a cache directory is configured by the pkg-install script: | elif [ "$2" = "POST-INSTALL" ]; then | if [ ! -d "%%DESTDIR%%$POLIPOCACHE" ]; then | mkdir -p "%%DESTDIR%%$POLIPOCACHE" || exit 1 | chown "$POLIPOUSER:$POLIPOGROUP" "%%DESTDIR%%$POLIPOCACHE" || exit 1 | chmod ug=rwx,o= "%%DESTDIR%%$POLIPOCACHE" || exit 1 | fi But the directory has already been created in Makefile. So the above commands are never executed. As a result, though the proxying works well, polipo cannot use the cache directory (because a lack of write permission). And polipo outputs a lot of error messages to /var/log/polipo like this: | Couldn't create directory /var/cache/polipo/svnweb.freebsd.org/: Permission denied To solve the problem, add appropriate arguments (owner, group, permission) to the @dir keyword in pkg-plist. (2) Don't remove a cache directory unconditionally at uninstallation (Update: files/pkg-deinstall.in) When the port is uninstalled, the cache directory is always deleted (rm -r) by pkg-deinstall even if it has cache contents. Now the directory is handled by pkg (with @dir) properly. I remove the delete routine from pkg-deinstall. (3) Fix messages such as "pkg-static: unlinkat(usr/local/etc/polipo/): No such file or directory" at uninstallation (Update: files/pkg-deinstall.in) When the port is uninstalled, some directories are deleted manually (rmdir) by pkg-deinstall. These directories are handled by pkg automatically. I remove these commands from pkg-deinstall.
Maintainer CC'd
Created attachment 149031 [details] poudriere testport log without the patch (9.1-RELEASE amd64)
Created attachment 149032 [details] poudriere testport log with the patch (9.1-RELEASE amd64)
Thanks for the bug report, it sounds reasonable. In the past we had a lot of port infrastructure changes, I was not able to catch all. So I approve the supplied patch (attachment 149030 [details]) as maintainer.
I am promoting the PR because the maintainer approved it (and it looks ok with quick glance)
A commit references this bug: Author: marino Date: Wed Nov 19 20:14:02 UTC 2014 New revision: 372811 URL: https://svnweb.freebsd.org/changeset/ports/372811 Log: www/polipo: Fix use of cache directory PR: 194813 Submitted by: WATANABE Kazuhiro Approved by: maintainer (Frank Behrens) Changes: head/www/polipo/Makefile head/www/polipo/files/pkg-deinstall.in head/www/polipo/files/pkg-install.in head/www/polipo/pkg-plist
Thanks!