Bug 194813 - [patch] www/polipo: Cannot use a cache directory (and some fix)
Summary: [patch] www/polipo: Cannot use a cache directory (and some fix)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: John Marino
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-04 13:58 UTC by WATANABE Kazuhiro
Modified: 2014-11-19 20:19 UTC (History)
2 users (show)

See Also:


Attachments
A patch for www/polipo. (1.71 KB, patch)
2014-11-04 13:58 UTC, WATANABE Kazuhiro
no flags Details | Diff
poudriere testport log without the patch (9.1-RELEASE amd64) (18.44 KB, text/x-log)
2014-11-04 14:02 UTC, WATANABE Kazuhiro
no flags Details
poudriere testport log with the patch (9.1-RELEASE amd64) (17.73 KB, text/x-log)
2014-11-04 14:03 UTC, WATANABE Kazuhiro
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description WATANABE Kazuhiro 2014-11-04 13:58:33 UTC
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.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-11-04 13:58:33 UTC
Maintainer CC'd
Comment 2 WATANABE Kazuhiro 2014-11-04 14:02:14 UTC
Created attachment 149031 [details]
poudriere testport log without the patch (9.1-RELEASE amd64)
Comment 3 WATANABE Kazuhiro 2014-11-04 14:03:58 UTC
Created attachment 149032 [details]
poudriere testport log with the patch (9.1-RELEASE amd64)
Comment 4 Frank Behrens 2014-11-11 06:02:29 UTC
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.
Comment 5 John Marino freebsd_committer freebsd_triage 2014-11-14 07:02:54 UTC
I am promoting the PR because the maintainer approved it (and it looks ok with quick glance)
Comment 6 commit-hook freebsd_committer freebsd_triage 2014-11-19 20:14:50 UTC
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
Comment 7 John Marino freebsd_committer freebsd_triage 2014-11-19 20:19:01 UTC
Thanks!