Repository :
http://git.fedorahosted.org/cgit/copr.git
On branch : master
---------------------------------------------------------------
commit 7cf5b31df2d6ae79bede909f43214f7ec329cf8b
Author: Adam Samalik <asamalik(a)redhat.com>
Date: Tue Jul 8 13:51:46 2014 +0200
[frontend] built pkgs info - include subpackages
---------------------------------------------------------------
.../coprs_frontend/coprs/logic/builds_logic.py | 2 +-
frontend/coprs_frontend/coprs/models.py | 6 +++---
frontend/coprs_frontend/coprs/templates/api.html | 12 ++++++++----
.../coprs/templates/coprs/detail/build.html | 16 +++++-----------
.../coprs/views/api_ns/api_general.py | 8 ++++++--
5 files changed, 23 insertions(+), 21 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/logic/builds_logic.py
b/frontend/coprs_frontend/coprs/logic/builds_logic.py
index 60b5bfb..c4c2cab 100644
--- a/frontend/coprs_frontend/coprs/logic/builds_logic.py
+++ b/frontend/coprs_frontend/coprs/logic/builds_logic.py
@@ -125,7 +125,7 @@ class BuildsLogic(object):
db.session.add(build_chroot)
- for attr in ["results", "started_on", "ended_on",
"pkg_version", "pkg_name"]:
+ for attr in ["results", "started_on", "ended_on",
"pkg_version", "built_packages"]:
value = upd_dict.get(attr, None)
if value:
# only update started_on once
diff --git a/frontend/coprs_frontend/coprs/models.py
b/frontend/coprs_frontend/coprs/models.py
index 053b70b..25fc043 100644
--- a/frontend/coprs_frontend/coprs/models.py
+++ b/frontend/coprs_frontend/coprs/models.py
@@ -233,9 +233,9 @@ class Build(db.Model, helpers.Serializer):
id = db.Column(db.Integer, primary_key=True)
# list of space separated urls of packages to build
pkgs = db.Column(db.Text)
- # the real name of the package got by rpm
- pkg_name = db.Column(db.Text)
- # version of the package got by rpm
+ # built packages
+ built_packages = db.Column(db.Text)
+ # version of the srpm package got by rpm
pkg_version = db.Column(db.Text)
# was this build canceled by user?
canceled = db.Column(db.Boolean, default=False)
diff --git a/frontend/coprs_frontend/coprs/templates/api.html
b/frontend/coprs_frontend/coprs/templates/api.html
index aefb175..c9c27fa 100644
--- a/frontend/coprs_frontend/coprs/templates/api.html
+++ b/frontend/coprs_frontend/coprs/templates/api.html
@@ -281,8 +281,8 @@ copr_url =
https://copr.fedoraproject.org
<li><b>project</b> – Name of the project.</li>
<li><b>owner</b> – Name of the owner.</li>
<li><b>results</b>– URL with the results.</li>
- <li><b>pkg_name</b>– Name of the built
package.</li>
- <li><b>pkg_version</b>– Version of the built
package.</li>
+ <li><b>built_pkgs</b>– List of built
packages.</li>
+ <li><b>src_version</b>– Version of the source
package.</li>
<li><b>chroots</b>– Chroots in which the package has
been build and their build states.</li>
<li><b>submitted_on</b>– Datetime when the build was
submitted. (in epoch format) </li>
<li><b>started_on</b>– Datetime when the build
process started. (in epoch format)</li>
@@ -298,8 +298,12 @@ copr_url =
https://copr.fedoraproject.org
"project": "myproject",
"owner": "msuchy",
"results":
"http://copr-be.cloud.fedoraproject.org/results/msuchy/myproject/",
- "pkg_name": "hello",
- "pkg_version": "2.8",
+ "built_pkgs": [
+ "hello 2.8",
+ "hello-gui 2.8",
+ "super-lib 5.4"
+ ],
+ "src_version": "2.8",
"chroots": {
"fedora-20-i386": "succeeded",
"fedora-20-x86_64": "succeeded"
diff --git a/frontend/coprs_frontend/coprs/templates/coprs/detail/build.html
b/frontend/coprs_frontend/coprs/templates/coprs/detail/build.html
index ad012de..df826a7 100644
--- a/frontend/coprs_frontend/coprs/templates/coprs/detail/build.html
+++ b/frontend/coprs_frontend/coprs/templates/coprs/detail/build.html
@@ -36,17 +36,11 @@
{% endif %}
</div>
<div>
- <dt class="oneline"> Name:</dt>
- {% if build.pkg_name %}
- <dd>{{ build.pkg_name }}</dd>
- {% else %}
- <dd> - </dd>
- {% endif %}
-
-
- <dt class="oneline"> Version:</dt>
- {% if build.pkg_version %}
- <dd>{{ build.pkg_version }}</dd>
+ <dt> Built packages:</dt>
+ {% if build.built_packages %}
+ {% for pkg in build.built_packages.split("\n"): %}
+ <dd>{{ pkg }}</dd>
+ {% endfor %}
{% else %}
<dd> - </dd>
{% endif %}
diff --git a/frontend/coprs_frontend/coprs/views/api_ns/api_general.py
b/frontend/coprs_frontend/coprs/views/api_ns/api_general.py
index fb20602..a665332 100644
--- a/frontend/coprs_frontend/coprs/views/api_ns/api_general.py
+++ b/frontend/coprs_frontend/coprs/views/api_ns/api_general.py
@@ -330,13 +330,17 @@ def build_detail(build_id):
for chroot in build.build_chroots:
chroots[chroot.name] = chroot.state
+ built_packages = None
+ if build.built_packages:
+ built_packages = build.built_packages.split("\n")
+
output = {"output": "ok",
"status": build.state,
"project": build.copr.name,
"owner": build.copr.owner.name,
"results": build.results,
- "pkg_name": build.pkg_name,
- "pkg_version": build.pkg_version,
+ "built_pkgs": built_packages,
+ "src_version": build.pkg_version,
"chroots": chroots,
"submitted_on": build.submitted_on,
"started_on": build.started_on,