squid-deb-proxy 0.8.14 (new formula) #48854
Conversation
This adds a new formlua for [squid-deb-proxy], a caching HTTP proxy for Debian / Ubuntu APT repositories based on Squid. It's useful to have on OS X if e.g. you spin up Debian-based VMs frequently with Vagrant. [squid-deb-proxy]: https://launchpad.net/squid-deb-proxy
Ah, damn, that generated tarball isn't stable. |
The current source URL, an auto-generated tarball from Launchpad's UI for Bazaar, apparently isn't generated identically every time, which was causing checksum failures. This switches it out for the orig tarball from Ubuntu's APT repository.
Use Debian: url "https://mirrors.ocf.berkeley.edu/debian/pool/main/s/squid-deb-proxy/squid-deb-proxy_0.8.14.tar.gz" |
class SquidDebProxy < Formula | ||
desc "APT repo caching proxy based on Squid." | ||
homepage "https://launchpad.net/squid-deb-proxy" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need this spacing.
- fix rubocop warnings about parentheses with heredocs - clean up extra spacing and comments - use Debian's mirrors instead of Ubuntu's - use "#{sbin}" instead of "#{HOMEBREW_PREFIX}/opt/squid/sbin"
OK, I've addressed most of the review comments. I'm not sure about the Also, out of curiosity, why the switch to the Debian mirror, especially since squid-deb-proxy appears to be an Ubuntu project (at least, it's hosted on Launchpad)? |
|
||
# additional installation from debian/squid-deb-proxy.install | ||
mkdir_p "#{prefix}/usr/share/squid-deb-proxy" | ||
cp "init-common.sh", "#{prefix}/usr/share/squid-deb-proxy/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit odd. What is it doing?
For some reason the upstream project, which is intended to be a Debian package, installs this file using the Debian packaging metadata instead of the install
target of the Makefile. I therefore have to install it explicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you ask the developers if they'd consider adding it to the Make target?
Also, those two lines can be one:
(prefix/"usr/share/squid-deb-proxy").install "init-common.sh"
Changing from "#{HOMEBREW_PREFIX}/opt/squid/sbin/squid" to "#{sbin}/squid" makes the launcher look for `squid` in "/usr/local/Cellar/squid-deb-proxy-0.8.14/sbin/squid" where it very much isn't. This reverts that change.
I presumed this comment:
Was applying to the current URL, which was Launchpad at the time. If that's not the case, use LP by all means. |
cp "init-common.sh", "#{prefix}/usr/share/squid-deb-proxy/" | ||
|
||
# produce execution wrapper script | ||
Pathname.new("#{sbin}/squid-deb-proxy").write( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need to call Pathname
here...
(sbin/"squid-deb-proxy").write <<-EOS.undent
#!/bin/bash
example
example 2
and three
EOS
Should work just fine.
- switch to idiomatic style of Pathname usage - move `test` block to end of class - use correct API for reference to squid's `sbin` dir
@DomT4 I think I've addressed your comments. Can you re-review? Should I squash down to one commit? |
One commit is always nice! Has the patch been submitted upstream yet? |
Ping re Dom’s comment? |
Closing this due to inactivity/lack of response. If you'd still like to pursue this, feel free to respond to the previous comments/questions and re-open on the new |
This adds a new formlua for squid-deb-proxy, a caching HTTP proxy for Debian / Ubuntu APT repositories based on Squid. It's useful to have on OS X if e.g. you spin up Debian-based VMs frequently with Vagrant.