Skip to content

Instantly share code, notes, and snippets.

@AlexTalker
Created March 31, 2014 18:01
Show Gist options
  • Save AlexTalker/9898296 to your computer and use it in GitHub Desktop.
Save AlexTalker/9898296 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
class Package
@file = String.new
Makepkg = '/usr/bin/makepkg'
Pacman = '/usr/bin/pacman'
LogBuild = 'manager-build.log'
LogInstall = 'manager-install.log'
def initialize(file='PKGBUILD')
raise ArgumentErorr, "Package: argument must respond to to_s" unless file.respond_to? :to_s
@file = file.to_s
end
def build
system(Makepkg, '-s', '-p',@file, '--noconfirm', '-L', LogBuild)
$0 == 0
end
def install
system(Makepkg, '-i', '--noconfirm', '--logfile', '--skipchecksums', LogInstall, )
end
end
def cd(i)
begin
Dir.chdir(i)
rescue
puts "An error happened in cd().Path don't found: #{i}"
false
end
end
ARGV.each { |package|
if cd(package)
system('pwd')
cd('..')
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment