mock build
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
$LOAD_PATH.unshift File.expand_path(".", "locallibs/ruby-rpm-ffi/lib")
|
||||
|
||||
require "rpm"
|
||||
|
||||
require_relative "runner"
|
||||
|
||||
class RepoManager
|
||||
@@ -22,4 +26,15 @@ class RepoManager
|
||||
@last_status = cmd.exit_status
|
||||
@last_pid = cmd.pid
|
||||
end
|
||||
|
||||
def get_rpm_info(path_to_rpm)
|
||||
res = { :error => nil }
|
||||
if File.exist?(path_to_rpm)
|
||||
pkg = RPM::Package.open(path_to_rpm)
|
||||
res[:pkginfo] = pkg
|
||||
else
|
||||
res[:error] = "#{path_to_rpm} не существует"
|
||||
end
|
||||
res
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user