Skip to content

Commit

Permalink
Be more tolerant of variances in package filenames uploaded to Opscode.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay Feldblum committed Aug 25, 2012
1 parent 953a811 commit d61d9ef
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/librarian/chef/source/site.rb
Expand Up @@ -273,9 +273,11 @@ def unpack_package!(path, source)
end

# Cookbook files, as pulled from Opscode Community Site API, are
# embedded in a subdirectory of the tarball, and the subdirectory's
# name is equal to the name of the cookbook.
subtemp = temp.join(name)
# embedded in a subdirectory of the tarball.
subtemps = temp.children
subtemps.empty? and raise "The package archive was empty!"
subtemps.size > 1 and raise "The package archive has too many children!"
subtemp = subtemps.first
debug { "Moving #{relative_path_to(subtemp)} to #{relative_path_to(path)}" }
FileUtils.mv(subtemp, path)
ensure
Expand Down

0 comments on commit d61d9ef

Please sign in to comment.