Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : dist-git
>---------------------------------------------------------------
commit d0c4906258277c3fb9cf8fb4d65e03636907a965
Author: Adam Samalik <asamalik(a)redhat.com>
Date: Thu Jun 25 10:28:45 2015 +0200
set dist-git:// url
>---------------------------------------------------------------
.../coprs/templates/coprs/detail/build.html | 6 +++++-
.../coprs/views/backend_ns/backend_general.py | 10 ++++++++--
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/templates/coprs/detail/build.html b/frontend/coprs_frontend/coprs/templates/coprs/detail/build.html
index 9c2f8f3..f9cc5d1 100644
--- a/frontend/coprs_frontend/coprs/templates/coprs/detail/build.html
+++ b/frontend/coprs_frontend/coprs/templates/coprs/detail/build.html
@@ -100,7 +100,11 @@
<dt> Source: </dt>
<dd>
{% if build.pkgs is not none %}
- <dd> <a href="{{ build.pkgs }}">{{ build.pkgs }}</a></dd>
+ {% if build.pkgs[:11] == "dist-git://" %}
+ <dd> {{ build.pkgs }} </dd>
+ {% else %}
+ <dd> <a href="{{ build.pkgs }}">{{ build.pkgs }}</a></dd>
+ {% endif %}
{% endif %}
</dd>
</div>
diff --git a/frontend/coprs_frontend/coprs/views/backend_ns/backend_general.py b/frontend/coprs_frontend/coprs/views/backend_ns/backend_general.py
index 5e1086e..d9ded77 100644
--- a/frontend/coprs_frontend/coprs/views/backend_ns/backend_general.py
+++ b/frontend/coprs_frontend/coprs/views/backend_ns/backend_general.py
@@ -48,23 +48,29 @@ def dist_git_upload_completed():
Mark BuildChroot in a Build as uploaded, which means:
- set it to pending state
- set BuildChroot.git_hash
- - if it's the last BuildChroot in a Build, delete local srpm
+ - if it's the last BuildChroot in a Build:
+ - delete local srpm
+ - set the url to dist-git://user/project/package
BuildChroot is identified with task_id which is build id + git branch name
- For example: 56-f22 -> build 55, chroots fedora-22-*
"""
result = {"updated": False}
- if "task_id" in flask.request.json and "git_hash" in flask.request.json:
+ if "task_id" in flask.request.json and "git_hash" in flask.request.json and \
+ "repo_name" in flask.request.json:
task_id = flask.request.json["task_id"]
git_hash = flask.request.json["git_hash"]
+ repo_name = flask.request.json["repo_name"]
build_chroots = BuildsLogic.get_chroots_from_dist_git_task_id(task_id)
for ch in build_chroots:
ch.status = helpers.StatusEnum("pending")
ch.git_hash = git_hash
build = build_chroots[0].build
+ # is it the last chroot?
if not build.has_uploading_chroot:
BuildsLogic.delete_local_srpm(build)
+ build.pkgs = "dist-git://{}".format(repo_name)
db.session.commit()