Created
August 27, 2013 13:38
-
-
Save miketheman/6353617 to your computer and use it in GitHub Desktop.
fragment for dealing with S3 and plus sign in URLs.
Part of a bigger tool that will be open-sourced at some point.
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
# S3 translates a '+' in filenames to %2B in the URL, breaking apt | |
# Here we will traverse any file in the pool/ dir and create a hardlink for | |
# any file that has a plus in its name. apt/wget will do the right thing. | |
Dir.chdir('<%= @repo_root %>') do | |
plusfiles = Dir.glob '**/*/*+*.deb' | |
begin | |
plusfiles.each do |file| | |
File.link(file, file.gsub('+', ' ')) | |
end | |
rescue SystemCallError # swallow this if file already exists | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment