Created
December 21, 2015 21:16
-
-
Save mwilliammyers/b979857471f9b9317605 to your computer and use it in GitHub Desktop.
Search OS X and most of the Linux package managers for a provided package name.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
def search_pkg(pkg) | |
# open_browser "https://www.macports.org/ports.php?by=name&substr=#{pkg}" | |
# open_browser "http://pdb.finkproject.org/pdb/browse.php?summary=#{pkg}" | |
# http://caskroom.io/search | |
# https://www.google.com/search?q=java&domains=www.openbsd.org&sitesearch=www.openbsd.org&btnG=Search&gfe_rd=ssl&ei=vqhiVr27EuGD8QedxJCwBg | |
open_browser "http://braumeister.org/search/#{pkg}" | |
open_browser "http://packages.ubuntu.com/search?keywords=#{pkg}&searchon=names&suite=all§ion=all" | |
open_browser "https://packages.debian.org/search?keywords=#{pkg}&searchon=names&suite=all§ion=all" | |
open_browser "https://www.archlinux.org/packages/?sort=&arch=x86_64&q=#{pkg}&maintainer=&flagged=" | |
open_browser "https://software.opensuse.org/search?q=#{pkg}" | |
open_browser "https://packages.gentoo.org/packages/search?q=#{pkg}" | |
open_browser "https://admin.fedoraproject.org/pkgdb/packages/%2A#{pkg}%2A/" | |
end | |
def open_browser(*args) | |
# browser = ENV["HOMEBREW_BROWSER"] || ENV["BROWSER"] || OS::PATH_OPEN | |
browser = "open" | |
# This buys us proper argument quoting and evaluation | |
# of environment variables in the cmd parameter. | |
system "/bin/sh", "-c", "#{browser} \"$@\"", "--", *args | |
end | |
ARGV.each { |p| search_pkg(p) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment