Added mock build. Part 1

This commit is contained in:
alexey
2025-03-10 23:56:58 +03:00
parent 91fa281237
commit 48b648f46b
8 changed files with 275 additions and 9 deletions

View File

@@ -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