Sign. Part 1

This commit is contained in:
alexey
2025-03-21 00:02:18 +03:00
parent a57d0a0f15
commit c6a89e7be1
12 changed files with 107 additions and 16 deletions

View File

@@ -145,11 +145,15 @@ class DBase
Projects[id]
end
def proj_create(proj_name, proj_descr)
def proj_create(proj_name, proj_descr, nopublic)
@error = nil
data = Projects.where(projname: proj_name).first
if data.nil?
id = Projects.insert(projname: proj_name, descr: proj_descr, public: 1)
public_proj = 1
unless nopublic.nil?
public_proj = 0
end
id = Projects.insert(projname: proj_name, descr: proj_descr, public: public_proj)
@last_id = id
else
@error = "Данный проект уже существует"
@@ -256,8 +260,8 @@ class DBase
$DDB = Sequel.connect(@cfg.get_db)
end
def save_rpm(build_id, path_to_rpm, rpm_name, git_id)
id = Rpms.insert(savepath: path_to_rpm, rpmname: rpm_name, sign: 0, signpath: "", repo_id: git_id.to_i)
def save_rpm(build_id, path_to_rpm, rpm_name, git_id, sha256)
id = Rpms.insert(savepath: path_to_rpm, rpmname: rpm_name, sign: 0, signpath: "", repo_id: git_id.to_i, filehash: sha256)
@last_id = id
BuildRpms.insert(build_id: build_id.to_i, rpm_id: id)
end
@@ -344,11 +348,12 @@ class DBase
ReposProjects.where(proj_id: prj_id.to_i).delete
ProjectsReposSpec.where(proj_id: prj_id.to_i).delete
builds = BuildTask.where(proj_id: prj_id.to_i)
build.each do |item|
builds.each do |item|
rpms = BuildRpms.where(build_id: item[:id])
Rpms.where(id: rpms[:rpm_id]).delete
end
BuildTask.where(proj_id: prj_id.to_i).delete
Projects.where(id: prj_id.to_i).delete
end
def projects_with_current_as_link(prj_id)