-
-
Save takuya/71a3f959b2cefb9f578e to your computer and use it in GitHub Desktop.
Cygwin の cygports を有効にしたり、無効にしたりを簡単に切り替える。
centos の enable-repo 的なことができないので、手動で切り替える。
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/ruby | |
#coding: utf-8 | |
require 'optparse' | |
iij = "http://ftp.iij.ad.jp/pub/cygwin/" | |
cygports = "ftp://ftp.cygwinports.org/pub/cygwinports" | |
target = nil | |
opt = OptionParser.new | |
opt.on("-d","--disable", "cygwin 標準(cygports無効)" ){|v| target = iij} | |
opt.on("-e","--enable", "cygports を有効にする"){|v| target = cygports} | |
opt.parse! ARGV | |
unless target then | |
ARGV = ["--help"] | |
opt.parse! ARGV | |
exit | |
end | |
#puts target | |
IO.foreach("|/usr/bin/apt-cyg -m #{target} update ") {|line|puts line} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment