Added mock build. Part 1
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
require_relative "runner"
|
||||
|
||||
class RepoManager
|
||||
attr :path, :error, :last_status, :last_pid
|
||||
|
||||
@@ -10,10 +12,14 @@ class RepoManager
|
||||
end
|
||||
|
||||
def create_repo
|
||||
%x(/usr/bin/createrepo_c --database --workers 1 "#{@path}")
|
||||
result = $?
|
||||
@last_status = result.exitstatus
|
||||
@last_pid = result.pid
|
||||
result
|
||||
repo_path = File.join(@path, "repodata")
|
||||
cmd_args = %Q(/usr/bin/createrepo_c --database --workers 1 "#{@path}")
|
||||
if File.exist?(repo_path)
|
||||
cmd_args = %Q(/usr/bin/createrepo_c --database --workers 1 --update "#{@path}")
|
||||
end
|
||||
cmd = Runner.new(cmd_args)
|
||||
cmd.run
|
||||
@last_status = cmd.exit_status
|
||||
@last_pid = cmd.pid
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user