Repository :
http://git.fedorahosted.org/cgit/copr.git
On branch : dist-git
---------------------------------------------------------------
commit 60b9020b2bfbfb59525a89f9be1b8aebec6f1633
Author: Adam Samalik <asamalik(a)redhat.com>
Date: Wed Jun 24 12:19:53 2015 +0200
chroot_to_branch helper
---------------------------------------------------------------
frontend/coprs_frontend/coprs/helpers.py | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/helpers.py
b/frontend/coprs_frontend/coprs/helpers.py
index 60093bc..c962f71 100644
--- a/frontend/coprs_frontend/coprs/helpers.py
+++ b/frontend/coprs_frontend/coprs/helpers.py
@@ -139,6 +139,18 @@ class Paginator(object):
return flask.url_for(request.endpoint, **args)
+def chroot_to_branch(chroot):
+ """
+ Get a git branch name from chroot. Follow the fedora naming standard.
+ """
+ os, version, arch = chroot.split("-")
+ if os == "fedora":
+ os = "f"
+ elif os == "epel" and int(version) <= 6:
+ os = "el"
+ return "{}{}".format(os, version)
+
+
def parse_package_name(pkg):
"""
Parse package name from possibly incomplete nvra string.