[copr] master: dnf-plugin: remove plugin (99d48ea)
by Igor Gnatenko
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 99d48eaabf0671621f4f7775ba76a25c168d1b3a
Author: Igor Gnatenko <i.gnatenko.brain(a)gmail.com>
Date: Sun Mar 16 20:31:22 2014 +0400
dnf-plugin: remove plugin
Now we have copr plugin in dnf-plugins-core. We don't need support this
plugin here. Miroslav forget to delete files.
Reference: https://lists.fedorahosted.org/pipermail/copr-devel/2014-March/000936.html
Signed-off-by: Igor Gnatenko <i.gnatenko.brain(a)gmail.com>
>---------------------------------------------------------------
dnf-plugin/copr_hook.py | 146 -----------------------------------------------
1 files changed, 0 insertions(+), 146 deletions(-)
diff --git a/dnf-plugin/copr_hook.py b/dnf-plugin/copr_hook.py
deleted file mode 100644
index 89327b6..0000000
--- a/dnf-plugin/copr_hook.py
+++ /dev/null
@@ -1,146 +0,0 @@
-# supplies the 'copr' command.
-#
-# Copyright (C) 2014 Red Hat, Inc.
-#
-# This copyrighted material is made available to anyone wishing to use,
-# modify, copy, or redistribute it subject to the terms and conditions of
-# the GNU General Public License v.2, or (at your option) any later version.
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY expressed or implied, including the implied warranties of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-# Public License for more details. You should have received a copy of the
-# GNU General Public License along with this program; if not, write to the
-# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the
-# source code or documentation are not subject to the GNU General Public
-# License and may only be used or replicated with the express permission of
-# Red Hat, Inc.
-#
-
-import dnf
-import os
-import sys
-import platform
-
-from dnf.yum.i18n import _
-from urlgrabber import grabber
-import urllib
-import json
-
-yes = set([_('yes'), _('y')])
-no = set([_('no'), _('n'), ''])
-
-class Copr(dnf.Plugin):
- """DNF plugin supplying the 'copr' command."""
-
- name = 'copr'
-
- def __init__(self, base, cli):
- """Initialize the plugin instance."""
- super(Copr, self).__init__(base, cli)
- if cli is not None:
- cli.register_command(CoprCommand)
- cli.logger.debug("initialized Copr plugin")
-
-class CoprCommand(dnf.cli.Command):
- """ Copr plugin for DNF """
-
- aliases = ("copr",)
-
- @staticmethod
- def get_summary():
- """Return a one line summary of what the command does."""
- return _("""Interact with Copr repositories. Example:
- copr enable rhscl/perl516 epel-6-x86_64
- copr enable ignatenkobrain/ocltoys
- copr disable rhscl/perl516
- copr list ignatenkobrain
-""")
-
- @staticmethod
- def get_usage():
- """Return a usage string for the command, including arguments."""
- return _("""
-enable name/project [chroot]
-disable name/project
-list name""")
-
- def run(self, extcmds):
- # FIXME this should do dnf itself (BZ#1062889)
- if os.geteuid() != 0:
- raise dnf.exceptions.Error(_('This command has to be run under the root user.'))
- try:
- subcommand = extcmds[0]
- project_name = extcmds[1]
- except ValueError:
- self.cli.logger.critical(
- _('Error: ') + _('exactly two additional parameters to copr command are required'))
- dnf.cli.commands._err_mini_usage(self.cli, self.cli.base.basecmd)
- raise dnf.cli.CliError(_('exactly two additional parameters to copr command are required'))
- try:
- chroot = extcmds[2]
- except IndexError:
- # FIXME Copr should generate non-specific arch repo
- dist = platform.linux_distribution()
- if "Fedora" in dist:
- chroot = ("fedora-%s-x86_64" % dist[2].lower() if "Rawhide" in dist else dist[1])
- else:
- chroot = ("epel-%s-x86_64" % dist[1].split(".", 1)[0])
- repo_filename = "/etc/yum.repos.d/_copr_{}.repo".format(project_name.replace("/", "-"))
- base_url = "http://copr.fedoraproject.org"
- if subcommand == "enable":
- #http://copr.fedoraproject.org/coprs/larsks/rcm/repo/epel-7-x86_64/
- api_path = "/coprs/{0}/repo/{1}/".format(project_name, chroot)
-
- self._ask_user()
- ug = grabber.URLGrabber()
- # FIXME when we are full on python2 urllib.parse
- try:
- ug.urlgrab(base_url+api_path, filename=repo_filename)
- except grabber.URLGrabError, e:
- raise dnf.exceptions.Error(str(e)), None, sys.exc_info()[2]
- self.cli.logger.info(_("Repository successfully enabled."))
- elif subcommand == "disable":
- # FIXME is it Copr repo ?
- try:
- os.remove(repo_filename)
- except OSError, e:
- raise dnf.exceptions.Error(str(e)), None, sys.exc_info()[2]
- self.cli.logger.info(_("Repository successfully disabled."))
- elif subcommand == "list":
- #http://copr.fedoraproject.org/api/coprs/ignatenkobrain/
- api_path = "/api/coprs/{}/".format(project_name)
-
- opener = urllib.FancyURLopener({})
- res = opener.open(base_url+api_path)
- try:
- json_parse = json.loads(res.read())
- except ValueError:
- raise dnf.exceptions.Error(_("Can't parse repositories for username '{}'.").format(project_name)), None, sys.exc_info()[2]
- i = 0
- while i < len(json_parse["repos"]):
- print "{0}/{1}".format(project_name, json_parse["repos"][i]["name"])
- i += 1
- else:
- raise dnf.exceptions.Error(_('Unknown subcommand {}.').format(subcommand))
-
- @classmethod
- def _ask_user(cls):
- question = _("""
-You are going to enable Copr repository. Please note that this repository is not
-part of Fedora distribution and may have various quality. Fedora distribution
-have no power over this repository and can not enforce some quality or security
-level.
-Please do not file bug reports about this packages in Fedora Bugzilla.
-In case of problems you should contact owner of this repository.
-
-Do you want to continue? [y/N]: """)
- answer = raw_input(question).lower()
- answer = _(answer)
- while not ((answer in yes) or (answer in no)):
- answer = raw_input(question).lower()
- answer = _(answer)
- if answer in yes:
- return
- else:
- raise dnf.exceptions.Error(_('Safe and good answer. Exiting.'))
10 years, 1 month
[copr] master: fix API url in few places (8f81188)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 8f8118851939137cfd1ebcb29540800e644017f9
Author: Michal Srb <msrb(a)redhat.com>
Date: Fri Mar 14 10:58:01 2014 +0100
fix API url in few places
>---------------------------------------------------------------
coprs_frontend/coprs/templates/api.html | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/coprs_frontend/coprs/templates/api.html b/coprs_frontend/coprs/templates/api.html
index 76866e7..c677109 100644
--- a/coprs_frontend/coprs/templates/api.html
+++ b/coprs_frontend/coprs/templates/api.html
@@ -155,7 +155,7 @@ copr_url = http://copr.fedoraproject.org
<p><span style="font-style:italic">Login required</span></p>
<h4>URL:</h4>
- <pre style="font-size:120%">/api/copr/<username>/new/</pre>
+ <pre style="font-size:120%">/api/coprs/<username>/new/</pre>
<h4>URL parameters:</h4>
<ul>
@@ -179,7 +179,7 @@ copr_url = http://copr.fedoraproject.org
<p><span style="font-style:italic">Login required</span></p>
<h4>URL:</h4>
- <pre style="font-size:120%">/api/copr/<username>/<projectname>/new_build/</pre>
+ <pre style="font-size:120%">/api/coprs/<username>/<projectname>/new_build/</pre>
<h4>URL parameters:</h4>
<ul>
@@ -207,7 +207,7 @@ copr_url = http://copr.fedoraproject.org
<p><span style="font-style:italic">Login required</span></p>
<h4>URL:</h4>
- <pre style="font-size:120%">/api/copr/build_status/<build_id>/</pre>
+ <pre style="font-size:120%">/api/coprs/build_status/<build_id>/</pre>
<h4>URL parameters:</h4>
<ul>
@@ -238,7 +238,7 @@ copr_url = http://copr.fedoraproject.org
<h3>Query build detail</h3>
<h4>URL:</h4>
- <pre style="font-size:120%">/api/copr/build_detail/<build_id>/</pre>
+ <pre style="font-size:120%">/api/coprs/build_detail/<build_id>/</pre>
<h4>URL parameters:</h4>
<ul>
@@ -277,7 +277,7 @@ copr_url = http://copr.fedoraproject.org
<p><span style="font-style:italic">Login required</span></p>
<h4>URL:</h4>
- <pre style="font-size:120%">/api/copr/cancel_build/<build_id>/</pre>
+ <pre style="font-size:120%">/api/coprs/cancel_build/<build_id>/</pre>
<h4>URL parameters:</h4>
<ul>
10 years, 1 month
[copr] master: comma separated -> space separated (b16359e)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit b16359ead8532debec18f5bcef7281921100a752
Author: Michal Srb <msrb(a)redhat.com>
Date: Fri Mar 14 10:58:03 2014 +0100
comma separated -> space separated
>---------------------------------------------------------------
coprs_frontend/coprs/templates/api.html | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/coprs_frontend/coprs/templates/api.html b/coprs_frontend/coprs/templates/api.html
index f813be4..9b511f3 100644
--- a/coprs_frontend/coprs/templates/api.html
+++ b/coprs_frontend/coprs/templates/api.html
@@ -168,9 +168,9 @@ copr_url = http://copr.fedoraproject.org
<li><b>name</b> – The name of the project to be created</li>
<li><b>chroots</b> – Chroots to be used in the project, specified as <span style="font-style:italic">chrootname=y</span>
(e.g.: <span style="font-style:italic">fedora-rawhide-x86_64=y&fedora-20-x86_64=y</span>)</li>
- <li><b>repos</b> – A comma separated list of repositories
+ <li><b>repos</b> – A space separated list of repositories
that this new project should have access to</li>
- <li><b>initial_pkgs</b> – A comma separated list of initial
+ <li><b>initial_pkgs</b> – A space separated list of initial
packages to build in this new project</li>
</ul>
10 years, 1 month
[copr] master: commas here and there (fd171c2)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit fd171c23edcd5cbe59a3a54e18078be8c3b3bffe
Author: Michal Srb <msrb(a)redhat.com>
Date: Fri Mar 14 10:58:00 2014 +0100
commas here and there
>---------------------------------------------------------------
coprs_frontend/coprs/templates/api.html | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/coprs_frontend/coprs/templates/api.html b/coprs_frontend/coprs/templates/api.html
index c711768..76866e7 100644
--- a/coprs_frontend/coprs/templates/api.html
+++ b/coprs_frontend/coprs/templates/api.html
@@ -83,7 +83,7 @@ copr_url = http://copr.fedoraproject.org
"repos": [
{
"yum_repos": {
- "fedora-19-i686": "https://copr-be.cloud.fedoraproject.org/results/jdaniels/log4j/fedora-19-..."
+ "fedora-19-i686": "https://copr-be.cloud.fedoraproject.org/results/jdaniels/log4j/fedora-19-...",
"fedora-19-x86_64": "https://copr-be.cloud.fedoraproject.org/results/jdaniels/log4j/fedora-19-..."
},
"additional_repos": "",
@@ -137,7 +137,7 @@ copr_url = http://copr.fedoraproject.org
"repos": [
{
"yum_repos": {
- "fedora-19-i686": "https://copr-be.cloud.fedoraproject.org/results/jdaniels/log4j/fedora-19-..."
+ "fedora-19-i686": "https://copr-be.cloud.fedoraproject.org/results/jdaniels/log4j/fedora-19-...",
"fedora-19-x86_64": "https://copr-be.cloud.fedoraproject.org/results/jdaniels/log4j/fedora-19-..."
},
"additional_repos": "",
@@ -364,8 +364,8 @@ copr_url = http://copr.fedoraproject.org
<h4>Example result</h4>
<pre>
{
- "output": "ok"
- "buildroot_pkgs": "scl-utils-build",
+ "output": "ok",
+ "buildroot_pkgs": "scl-utils-build"
}
</pre>
@@ -390,8 +390,8 @@ copr_url = http://copr.fedoraproject.org
<h4>Example result</h4>
<pre>
{
- "output": "ok"
- "buildroot_pkgs": "scl-utils-build",
+ "output": "ok",
+ "buildroot_pkgs": "scl-utils-build"
}
</pre>
10 years, 1 month
[copr] master: correct the way of specifying chroots for new projects (b2e935b)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit b2e935bd424b09b6907fd640c8dd602b0ab64bb0
Author: Michal Srb <msrb(a)redhat.com>
Date: Fri Mar 14 10:58:02 2014 +0100
correct the way of specifying chroots for new projects
>---------------------------------------------------------------
coprs_frontend/coprs/templates/api.html | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/coprs_frontend/coprs/templates/api.html b/coprs_frontend/coprs/templates/api.html
index c677109..f813be4 100644
--- a/coprs_frontend/coprs/templates/api.html
+++ b/coprs_frontend/coprs/templates/api.html
@@ -166,8 +166,8 @@ copr_url = http://copr.fedoraproject.org
<h4>Parameters sent by POST:</h4>
<ul>
<li><b>name</b> – The name of the project to be created</li>
- <li><b>chroots</b> – A comma separated list of chroots to
- use in the project</li>
+ <li><b>chroots</b> – Chroots to be used in the project, specified as <span style="font-style:italic">chrootname=y</span>
+ (e.g.: <span style="font-style:italic">fedora-rawhide-x86_64=y&fedora-20-x86_64=y</span>)</li>
<li><b>repos</b> – A comma separated list of repositories
that this new project should have access to</li>
<li><b>initial_pkgs</b> – A comma separated list of initial
10 years, 1 month
[copr] master: api: cancel build (94066f8)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 94066f820d45e9d4f1666d33eba19064b30d26b3
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Mar 7 17:14:59 2014 +0100
api: cancel build
and add "copr-cli cancel" command
Also add api call to fetch details of build (I did not use it at then end, but when I code it, I will leave it there)
>---------------------------------------------------------------
copr_cli/main.py | 15 +++++
copr_cli/subcommands.py | 17 ++++++
coprs_frontend/coprs/logic/builds_logic.py | 4 +-
coprs_frontend/coprs/templates/api.html | 62 ++++++++++++++++++++++
coprs_frontend/coprs/views/api_ns/api_general.py | 48 ++++++++++++++++-
5 files changed, 143 insertions(+), 3 deletions(-)
diff --git a/copr_cli/main.py b/copr_cli/main.py
index 96775f5..f20cf18 100644
--- a/copr_cli/main.py
+++ b/copr_cli/main.py
@@ -47,6 +47,14 @@ def action_list(args):
def action_status(args):
subcommands.status(args.build_id)
+def action_cancel(args):
+ """ Method called when the 'cancel' action has been selected by the
+ user.
+
+ :param args: argparse arguments provided by the user
+
+ """
+ subcommands.cancel(args.build_id)
def setup_parser():
"""
@@ -114,6 +122,13 @@ def setup_parser():
help="Build ID")
parser_build.set_defaults(func=action_status)
+ # create the parser for the "cancel" command
+ parser_build = subparsers.add_parser("cancel",
+ help="Cancel build specified by its ID")
+ parser_build.add_argument("build_id",
+ help="Build ID")
+ parser_build.set_defaults(func=action_cancel)
+
return parser
diff --git a/copr_cli/subcommands.py b/copr_cli/subcommands.py
index 7d8d574..5b99e80 100644
--- a/copr_cli/subcommands.py
+++ b/copr_cli/subcommands.py
@@ -183,6 +183,23 @@ def status(build_id):
(ret, value) = _fetch_status(build_id)
print(value)
+def cancel(build_id):
+ """ Cancel specified build_id """
+ user = get_user()
+ copr_api_url = get_api_url()
+ #/coprs/rhscl/nodejs010/cancel_build/4060/
+ URL = "{0}/coprs/cancel_build/{1}/".format(
+ copr_api_url,
+ build_id)
+ req = requests.get(URL, auth=(user["login"], user["token"]))
+ output = _get_data(req, user)
+ if output is None:
+ return (False, "Error occurred.")
+ elif "status" in output:
+ return (True, output["status"])
+ else:
+ return (False, output["error"])
+
def build(copr, pkgs, memory, timeout, wait=True, result=None):
""" Build a new package into a given copr.
diff --git a/coprs_frontend/coprs/logic/builds_logic.py b/coprs_frontend/coprs/logic/builds_logic.py
index 44d0ead..a6e234c 100644
--- a/coprs_frontend/coprs/logic/builds_logic.py
+++ b/coprs_frontend/coprs/logic/builds_logic.py
@@ -139,14 +139,14 @@ class BuildsLogic(object):
@classmethod
def cancel_build(cls, user, build):
- if not (user.can_build_in(build.copr):
+ if not (user.can_build_in(build.copr)):
raise exceptions.InsufficientRightsException(
"You are not allowed to cancel this build.")
build.canceled = True
@classmethod
def delete_build(cls, user, build):
- if not (user.can_build_in(build.copr):
+ if not (user.can_build_in(build.copr)):
raise exceptions.InsufficientRightsException(
"You are not allowed to delete this build.")
diff --git a/coprs_frontend/coprs/templates/api.html b/coprs_frontend/coprs/templates/api.html
index 1df4fb3..c711768 100644
--- a/coprs_frontend/coprs/templates/api.html
+++ b/coprs_frontend/coprs/templates/api.html
@@ -235,6 +235,68 @@ copr_url = http://copr.fedoraproject.org
}
</pre>
+ <h3>Query build detail</h3>
+
+ <h4>URL:</h4>
+ <pre style="font-size:120%">/api/copr/build_detail/<build_id>/</pre>
+
+ <h4>URL parameters:</h4>
+ <ul>
+ <li><b>build_id</b> – Build ID returned by the <span style="font-style:italic">new_build</span> call</li>
+ </ul>
+
+ <h4>Result</h4>
+ <ul>
+ <li><b>status</b> – Status of the build, one of
+ <ul>
+ <li>pending</li>
+ <li>running</li>
+ <li>failed</li>
+ <li>succeeded</li>
+ <li>canceled</li>
+ </ul>
+ </li>
+ <li><b>owner</b> – Name of the owner.
+ </li>
+ <li><b>project</b> – Name of the project.
+ </li>
+ </ul>
+
+ <h4>Example result</h4>
+ <pre>
+ {
+ "status": "pending",
+ "owner": "msuchy",
+ "project": "myproject",
+ "output": "ok"
+ }
+ </pre>
+
+ <h3>Cancel build</h3>
+
+ <p><span style="font-style:italic">Login required</span></p>
+
+ <h4>URL:</h4>
+ <pre style="font-size:120%">/api/copr/cancel_build/<build_id>/</pre>
+
+ <h4>URL parameters:</h4>
+ <ul>
+ <li><b>build_id</b> – Build ID returned by the <span style="font-style:italic">new_build</span> call</li>
+ </ul>
+
+ <h4>Result</h4>
+ <ul>
+ <li><b>status</b> – Status of the task.
+ </ul>
+
+ <h4>Example result</h4>
+ <pre>
+ {
+ "status": "Build canceled",
+ "output": "ok"
+ }
+ </pre>
+
<h3>Copr Modification</h3>
<p><span style="font-style:italic">Login required</span></p>
diff --git a/coprs_frontend/coprs/views/api_ns/api_general.py b/coprs_frontend/coprs/views/api_ns/api_general.py
index cc41fdd..f792977 100644
--- a/coprs_frontend/coprs/views/api_ns/api_general.py
+++ b/coprs_frontend/coprs/views/api_ns/api_general.py
@@ -251,6 +251,52 @@ def build_status(build_id):
jsonout.status_code = httpcode
return jsonout
+(a)api_ns.route("/coprs/build_detail/<build_id>/", methods=["GET"])
+def build_detail(build_id):
+ if build_id.isdigit():
+ build = builds_logic.BuildsLogic.get(build_id).first()
+ else:
+ build = None
+
+ if build:
+ httpcode = 200
+ output = {"output": "ok",
+ "owner": build.copr.owner.name,
+ "project": build.copr.name,
+ "status": build.state}
+ else:
+ output = {"output": "notok", "error": "Invalid build"}
+ httpcode = 404
+
+ jsonout = flask.jsonify(output)
+ jsonout.status_code = httpcode
+ return jsonout
+
+(a)api_ns.route("/coprs/cancel_build/<build_id>/", methods=["POST"])
+@api_login_required
+def cancel_build(build_id):
+ if build_id.isdigit():
+ build = builds_logic.BuildsLogic.get(build_id).first()
+ else:
+ build = None
+
+ if build:
+ try:
+ builds_logic.BuildsLogic.cancel_build(flask.g.user, build)
+ except InsufficientRightsException as e:
+ output = {'output': 'notok', 'error': str(e)}
+ httpcode = 500
+ else:
+ db.session.commit()
+ httpcode = 200
+ output = {'output': 'ok', status: "Build canceled"}
+ else:
+ output = {"output": "notok", "error": "Invalid build"}
+ httpcode = 404
+ jsonout = flask.jsonify(output)
+ jsonout.status_code = httpcode
+ return jsonout
+
@api_ns.route('/coprs/<username>/<coprname>/modify/', methods=["POST"])
@api_login_required
def copr_modify(username, coprname):
@@ -361,7 +407,7 @@ def api_coprs_search_by_project(project=None):
output = {"output": "ok", "users": []}
for repo in repos:
output["repos"].append({"username": repo.owner,
- "coprname"; repo.name,
+ "coprname": repo.name,
"description": repo.description})
else:
output = {"output": "notok", "error": "Invalid request"}
10 years, 1 month
[copr] master: fix test after 7c48726 (d6652d1)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit d6652d18b0ccdc30c7fe4584b1dc49fc3c3a507b
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Mar 11 18:06:03 2014 +0100
fix test after 7c48726
>---------------------------------------------------------------
.../test_views/test_coprs_ns/test_coprs_builds.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_builds.py b/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_builds.py
index beb70bb..c88799c 100644
--- a/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_builds.py
+++ b/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_builds.py
@@ -134,7 +134,7 @@ class TestCoprDeleteBuild(CoprsTestCase):
data={},
follow_redirects=True)
- assert "delete your own builds" in r.data
+ assert "allowed to delete this build" in r.data
b = (self.models.Build.query.filter(
self.models.Build.id == self.b1.id)
.first())
10 years, 1 month
[copr] master: About Copr info on homepage (89b2f25)
by asamalik@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 89b2f2502c5e05fcc1ce8c93538ab493e7857004
Author: Adam Samalik <asamalik(a)redhat.com>
Date: Tue Mar 11 15:46:05 2014 +0100
About Copr info on homepage
>---------------------------------------------------------------
coprs_frontend/coprs/static/copr.css | 18 ++++++++++++++++++
coprs_frontend/coprs/templates/coprs/show.html | 15 +++++++++++++++
2 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/coprs_frontend/coprs/static/copr.css b/coprs_frontend/coprs/static/copr.css
index c5bee68..cb6621c 100644
--- a/coprs_frontend/coprs/static/copr.css
+++ b/coprs_frontend/coprs/static/copr.css
@@ -99,6 +99,24 @@ div.user-info .other-text {
font-size: 0.6em;
}
+div.about-copr {
+ width: 100%;
+ background-color: #ececec;
+ padding-top: 1em;
+ padding-bottom: 1em;
+
+ border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+}
+
+div.about-copr p {
+ padding-left: 1em;
+ padding-right: 1em;
+ margin-top: 0.3em;
+ margin-bottom: 0.3em;
+}
+
div.coprs-list-thin, div.coprs-list-thick {
float: left;
}
diff --git a/coprs_frontend/coprs/templates/coprs/show.html b/coprs_frontend/coprs/templates/coprs/show.html
index 0971b0a..a3d041e 100644
--- a/coprs_frontend/coprs/templates/coprs/show.html
+++ b/coprs_frontend/coprs/templates/coprs/show.html
@@ -15,6 +15,21 @@
<p class="other-text">projects</p>
</div>
{% endif %}
+ {% if not g.user and not fulltext%}
+ <div class="about-copr">
+ <p>Copr is an easy-to-use automatic build system providing a package repository as its output.</p>
+ <p>Start with making your own repository in these three steps:</p>
+ <ol>
+ <li>choose an architecture and system you want to build for</li>
+ <li>provide Copr with src.rpm packages available online</li>
+ <li>let Coper do all the work and wait for your new repo</li>
+ </ol>
+ <p>For more information please visit <a href="https://fedorahosted.org/copr/">Copr wiki</a></p>
+ </div>
+ {% endif %}
+ <div class="pagination">
+ {{ render_pagination(request, paginator) }}
+ </div>
<div class="coprs-list-{% if g.user %}thin{% else %}thick{% endif %}">
{% if g.user %}
<div class="add-copr">+
10 years, 1 month