* tool/make-snapshot (package): support xz.  no longer runs with
  1.8 or earlier.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-05-13 10:09:41 +00:00
Родитель a03eeb000a
Коммит 944ff17f8a
1 изменённых файлов: 32 добавлений и 6 удалений

Просмотреть файл

@ -27,6 +27,13 @@ each versions may be followed by optional @revision.
USAGE USAGE
end end
PACKAGES = {
"bzip" => %w".tar.bz2 bzip2 -c",
"gzip" => %w".tar.gz gzip -c",
"xz" => %w".tar.xz xz -c",
"zip" => %w".zip zip -qr",
}
ENV["LC_ALL"] = ENV["LANG"] = "C" ENV["LC_ALL"] = ENV["LANG"] = "C"
SVNURL = URI.parse("http://svn.ruby-lang.org/repos/ruby/") SVNURL = URI.parse("http://svn.ruby-lang.org/repos/ruby/")
RUBY_VERSION_PATTERN = /^\#define\s+RUBY_VERSION\s+"([\d.]+)"/ RUBY_VERSION_PATTERN = /^\#define\s+RUBY_VERSION\s+"([\d.]+)"/
@ -270,13 +277,32 @@ def package(rev, destdir)
v = File.basename(v) v = File.basename(v)
end end
return [["bzip tarball", ".tar.bz2", %w"tar cjf"], tarball = nil
["gzip tarball", ".tar.gz", %w"tar czf"], return PACKAGES.collect do |mesg, (ext, *cmd)|
["zip archive", ".zip", %w"zip -qr"] File.directory?(destdir) or FileUtils.mkpath(destdir)
].collect do |mesg, ext, cmd|
file = File.join(destdir, "#{$archname||v}#{ext}") file = File.join(destdir, "#{$archname||v}#{ext}")
print "creating #{mesg}... #{file}" case ext
if system(*(cmd + [file, v])) when /\.tar/
if tarball
next if tarball.empty?
else
tarball = "#{$archname||v}.tar"
print "creating tarball... #{tarball}"
if system("tar", "cf", tarball, v)
puts " done"
else
puts " failed"
tarball = ""
next
end
end
print "creating #{mesg} tarball... #{file}"
done = system(*(cmd + [tarball]), out: file)
else
print "creating #{mesg} archive... #{file}"
done = system(*(cmd + [file, v]))
end
if done
puts " done" puts " done"
file file
else else