-
-
Save AlexTalker/9897766 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/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(Pacman, '-U', '--noconfirm', '--logfile', 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