module Untar

untar

Public Instance Methods

untar_command(file) click to toggle source

Returns a command to uncompress an archive FILE.

# File lib/el4r/el4r-sub.rb, line 164
def untar_command(file)
  f = file
  case f
  when /\.tar\.gz$/, /\.tgz$/
    "(tar xzvf #{f} || tar xvf #{f})"
  when /\.tar\.bz2$/
    "(tar xjvf #{f} || tar xvf #{f})"
  when /\.tar$/, /\.gz$/
    "tar xf #{f}"
  when /\.zip$/
    "unzip #{f}"
  when /\.lzh$/
    "lha x #{f}"
  when /\.afz$/
    "afio -ivZ #{f}"
  when /\.rar$/i
    "unrar %s"
  when /\.sit$/i
    "ln -s %s tmp.sit; unstuff tmp.sit"
  else
    nil
  end
end