Signed-off-by: Cao Xueliang caoxl78320@163.com --- src/lib/job.cr | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/src/lib/job.cr b/src/lib/job.cr index 218e2e1..1c6eb1a 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -249,10 +249,37 @@ class Job set_upload_dirs() end
+ def get_pkg_common_dir + common_dir = "" + + if @hash["cci-makepkg"]? + pkg_style = "cci-makepkg" + elsif @hash["cci-depends"]? + pkg_style = "cci-depends" + elsif @hash["build-pkg"]? + pkg_style = "build-pkg" + else + pkg_style = nil + end + + if pkg_style + tmp = @hash["#{pkg_style}"] + tmp_os = tmp["os"]? ? tmp["os"].to_s : "#{os}" + tmp_os_arch = tmp["os_arch"]? ? tmp["os_arch"].to_s : "#{os_arch}" + tmp_os_version = tmp["os_version"]? ? tmp["os_version"].to_s : "#{os_version}" + + tmp_os_mount = tmp["os_mount"]? ? tmp["os_mount"].to_s : "#{os_mount}" + mount_type = tmp_os_mount == "cifs" ? "nfs" : tmp_os_mount.dup + + common_dir = "#{mount_type}/#{tmp_os}/#{tmp_os_arch}/#{tmp_os_version}" + end + + return common_dir + end + def get_package_dir if @hash["cci-makepkg"]? || @hash["cci-depends"]? || @hash["build-pkg"]? - mount_type = os_mount == "cifs" ? "nfs" : os_mount.dup - common_dir = "#{mount_type}/#{os}/#{os_arch}/#{os_version}" + common_dir = get_pkg_common_dir end
if @hash["cci-makepkg"]?