[copr] dnf: dnf-plugin: use _copr_user-copr for .repo (36276df)
by Igor Gnatenko
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : dnf
>---------------------------------------------------------------
commit 36276df22bb1687d340f1fa0631a9d1e9b8f0f91
Author: Igor Gnatenko <i.gnatenko.brain(a)gmail.com>
Date: Wed Feb 12 18:14:53 2014 +0400
dnf-plugin: use _copr_user-copr for .repo
Signed-off-by: Igor Gnatenko <i.gnatenko.brain(a)gmail.com>
>---------------------------------------------------------------
dnf-plugin/copr_hook.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dnf-plugin/copr_hook.py b/dnf-plugin/copr_hook.py
index d6c8f1b..4a50a2f 100644
--- a/dnf-plugin/copr_hook.py
+++ b/dnf-plugin/copr_hook.py
@@ -51,7 +51,7 @@ class CoprCommand(dnf.cli.Command):
_('Error: ') + _('exactly three additional parameters to copr command are required'))
dnf.cli.commands._err_mini_usage(self.cli, self.cli.base.basecmd)
raise dnf.cli.CliError(_('exactly three additional parameters to copr command are required'))
- repo_filename = "/etc/yum.repos.d/{}.repo".format(project_name.replace("/", "_"))
+ repo_filename = "/etc/yum.repos.d/_copr_{}.repo".format(project_name.replace("/", "-"))
if subcommand == "enable":
#http://copr.fedoraproject.org/coprs/larsks/rcm/repo/epel-7-x86_64/
10 years, 2 months
[copr] dnf: dnf-plugin: enable logging (2a0beb6)
by Igor Gnatenko
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : dnf
>---------------------------------------------------------------
commit 2a0beb6ca5fb9b13bb803402cb33c57a8ff38dce
Author: Igor Gnatenko <i.gnatenko.brain(a)gmail.com>
Date: Wed Feb 12 18:08:08 2014 +0400
dnf-plugin: enable logging
Signed-off-by: Igor Gnatenko <i.gnatenko.brain(a)gmail.com>
>---------------------------------------------------------------
dnf-plugin/copr_hook.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/dnf-plugin/copr_hook.py b/dnf-plugin/copr_hook.py
index 4060dd4..d6c8f1b 100644
--- a/dnf-plugin/copr_hook.py
+++ b/dnf-plugin/copr_hook.py
@@ -1,4 +1,5 @@
import dnf
+import logging
import os
import sys
@@ -8,6 +9,8 @@ from urlgrabber import grabber
yes = set([_('yes'), _('y')])
no = set([_('no'), _('n'), ''])
+logger = logging.getLogger('dnf.plugin')
+
class Copr(dnf.Plugin):
"""DNF plugin supplying the 'copr' command."""
@@ -18,6 +21,7 @@ class Copr(dnf.Plugin):
super(Copr, self).__init__(base, cli)
if cli is not None:
cli.register_command(CoprCommand)
+ logger.debug("initialized Copr plugin")
class CoprCommand(dnf.cli.Command):
""" Copr plugin for DNF """
10 years, 2 months
[copr] dnf: dnf-plugin: answer is no by default (311f89a)
by Igor Gnatenko
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : dnf
>---------------------------------------------------------------
commit 311f89aea53fd0cba11783fa13bf3ce579f99d47
Author: Igor Gnatenko <i.gnatenko.brain(a)gmail.com>
Date: Wed Feb 12 18:05:37 2014 +0400
dnf-plugin: answer is no by default
Signed-off-by: Igor Gnatenko <i.gnatenko.brain(a)gmail.com>
>---------------------------------------------------------------
dnf-plugin/copr_hook.py | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dnf-plugin/copr_hook.py b/dnf-plugin/copr_hook.py
index 61ab0dc..4060dd4 100644
--- a/dnf-plugin/copr_hook.py
+++ b/dnf-plugin/copr_hook.py
@@ -5,8 +5,8 @@ import sys
from dnf.yum.i18n import _
from urlgrabber import grabber
-yes = set([_('yes'), _('y'), ''])
-no = set([_('no'), _('n')])
+yes = set([_('yes'), _('y')])
+no = set([_('no'), _('n'), ''])
class Copr(dnf.Plugin):
"""DNF plugin supplying the 'copr' command."""
@@ -75,11 +75,12 @@ 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]: """)
+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:
10 years, 2 months
[copr] master: we still do not have proper cert (36d1b52)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 36d1b5258e399531d3b8388ed2ea2c6007f52dda
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Feb 12 11:09:05 2014 +0100
we still do not have proper cert
>---------------------------------------------------------------
copr_cli/subcommands.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/copr_cli/subcommands.py b/copr_cli/subcommands.py
index 0d24fed..c3247b4 100644
--- a/copr_cli/subcommands.py
+++ b/copr_cli/subcommands.py
@@ -72,7 +72,7 @@ def get_api_url():
)
# Default copr_url:
- copr_url = "https://copr.fedoraproject.org/"
+ copr_url = "http://copr.fedoraproject.org/"
if (config.has_section("copr-cli") and
config.has_option("copr-cli", "copr_url")):
10 years, 2 months
[copr] master: fix typo and rephrase text (7dc78b6)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 7dc78b6f14806f266b96280bbbb98af890d10b26
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Feb 12 11:08:28 2014 +0100
fix typo and rephrase text
>---------------------------------------------------------------
dnf-plugin/copr_hook.py | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/dnf-plugin/copr_hook.py b/dnf-plugin/copr_hook.py
index 9865bb9..61ab0dc 100644
--- a/dnf-plugin/copr_hook.py
+++ b/dnf-plugin/copr_hook.py
@@ -68,11 +68,13 @@ class CoprCommand(dnf.cli.Command):
@classmethod
def _ask_user(cls):
question = _("""
-You are going to enable Copr repository. Please not that this repository is not
-part of Fedora and may have various quality and 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.
+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)
10 years, 2 months
[copr] master: log success (93d476d)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 93d476d50d49abb6970b2eaba5bf1607bc6fe9d2
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Feb 12 11:06:35 2014 +0100
log success
>---------------------------------------------------------------
dnf-plugin/copr_hook.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dnf-plugin/copr_hook.py b/dnf-plugin/copr_hook.py
index 226355c..9865bb9 100644
--- a/dnf-plugin/copr_hook.py
+++ b/dnf-plugin/copr_hook.py
@@ -61,7 +61,7 @@ class CoprCommand(dnf.cli.Command):
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.base.read_all_repos()
+ self.cli.logger.info(_("Repository successfully enabled."))
else:
raise dnf.exceptions.Error(_('Unknown subcommand {}.').format(subcommand))
10 years, 2 months
[copr] master: let the plugin actually load by dnf (4f4028b)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 4f4028b333c815b5e3994c2d9b975e07df8307fc
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Feb 12 10:47:30 2014 +0100
let the plugin actually load by dnf
>---------------------------------------------------------------
dnf-plugin/copr_hook.py | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/dnf-plugin/copr_hook.py b/dnf-plugin/copr_hook.py
index c3b4b7f..226355c 100644
--- a/dnf-plugin/copr_hook.py
+++ b/dnf-plugin/copr_hook.py
@@ -11,7 +11,7 @@ no = set([_('no'), _('n')])
class Copr(dnf.Plugin):
"""DNF plugin supplying the 'copr' command."""
- #name = 'copr'
+ name = 'copr'
def __init__(self, base, cli):
"""Initialize the plugin instance."""
@@ -22,17 +22,19 @@ class Copr(dnf.Plugin):
class CoprCommand(dnf.cli.Command):
""" Copr plugin for DNF """
- aliases = ("copr")
+ aliases = ("copr",)
@staticmethod
def get_summary():
"""Return a one line summary of what the command does."""
- return _("interact with Copr repositories")
+ return _("""Interact with Copr repositories. Example:
+ copr enable rhscl/perl516 epel-6-x86_64
+""")
@staticmethod
def get_usage():
"""Return a usage string for the command, including arguments."""
- return _("copr enable name/project")
+ return _("enable name/project chroot")
def run(self, extcmds):
# FIXME this should do dnf itself (BZ#1062889)
@@ -41,7 +43,10 @@ class CoprCommand(dnf.cli.Command):
try:
subcommand, project_name, chroot = extcmds
except ValueError:
- raise ValueError(_('exactly three additional parameters to copr command are required'))
+ self.cli.logger.critical(
+ _('Error: ') + _('exactly three additional parameters to copr command are required'))
+ dnf.cli.commands._err_mini_usage(self.cli, self.cli.base.basecmd)
+ raise dnf.cli.CliError(_('exactly three additional parameters to copr command are required'))
repo_filename = "/etc/yum.repos.d/{}.repo".format(project_name.replace("/", "_"))
if subcommand == "enable":
10 years, 2 months
[copr] master: add get_summary and get_usage (d0999f6)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit d0999f6e8271422c412afb94906c2a35b5e92f6b
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Feb 11 16:47:03 2014 +0100
add get_summary and get_usage
addressing:
W: 22, 0: Method 'get_summary' is abstract in class 'Command' but is not overridden (abstract-method)
W: 22, 0: Method 'get_usage' is abstract in class 'Command' but is not overridden (abstract-method)
>---------------------------------------------------------------
dnf-plugin/copr_hook.py | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/dnf-plugin/copr_hook.py b/dnf-plugin/copr_hook.py
index b4e4260..c3b4b7f 100644
--- a/dnf-plugin/copr_hook.py
+++ b/dnf-plugin/copr_hook.py
@@ -24,6 +24,16 @@ class CoprCommand(dnf.cli.Command):
aliases = ("copr")
+ @staticmethod
+ def get_summary():
+ """Return a one line summary of what the command does."""
+ return _("interact with Copr repositories")
+
+ @staticmethod
+ def get_usage():
+ """Return a usage string for the command, including arguments."""
+ return _("copr enable name/project")
+
def run(self, extcmds):
# FIXME this should do dnf itself (BZ#1062889)
if os.geteuid() != 0:
10 years, 2 months
[copr] master: fix compilation problems (894f334)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 894f3346fd00dee77daf0395868e817e1b772b7c
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Feb 11 16:21:48 2014 +0100
fix compilation problems
>---------------------------------------------------------------
dnf-plugin/copr_hook.py | 39 ++++++++++++++++++++++-----------------
1 files changed, 22 insertions(+), 17 deletions(-)
diff --git a/dnf-plugin/copr_hook.py b/dnf-plugin/copr_hook.py
index 7c86d79..b4e4260 100644
--- a/dnf-plugin/copr_hook.py
+++ b/dnf-plugin/copr_hook.py
@@ -1,10 +1,12 @@
import dnf
+import os
import sys
+from dnf.yum.i18n import _
from urlgrabber import grabber
-yes = set(['yes','y', ''])
-no = set(['no','n'])
+yes = set([_('yes'), _('y'), ''])
+no = set([_('no'), _('n')])
class Copr(dnf.Plugin):
"""DNF plugin supplying the 'copr' command."""
@@ -19,16 +21,17 @@ class Copr(dnf.Plugin):
class CoprCommand(dnf.cli.Command):
""" Copr plugin for DNF """
- aliases = "copr"
- def run(self.args):
+ aliases = ("copr")
+
+ 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.')
+ raise dnf.exceptions.Error(_('This command has to be run under the root user.'))
try:
subcommand, project_name, chroot = extcmds
except ValueError:
- raise ValueError('exactly three additional parameters to copr command are required')
+ raise ValueError(_('exactly three additional parameters to copr command are required'))
repo_filename = "/etc/yum.repos.d/{}.repo".format(project_name.replace("/", "_"))
if subcommand == "enable":
@@ -40,25 +43,27 @@ class CoprCommand(dnf.cli.Command):
ug = grabber.URLGrabber()
# FIXME when we are full on python2 urllib.parse
try:
- fn = ug.urlgrab(base_url+api_path, filename=repo_filename)
+ 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.base.read_all_repos()
else:
raise dnf.exceptions.Error(_('Unknown subcommand {}.').format(subcommand))
- def _ask_user(self):
- question = """
+ @classmethod
+ def _ask_user(cls):
+ question = _("""
You are going to enable Copr repository. Please not that this repository is not
part of Fedora and may have various quality and 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()
- while not ((answer in yes) or (answer in no)):
- answer = raw_input(question).lower()
- if answer in yes:
- return
- else:
- raise dnf.exceptions.Error('Safe and good answer. Exiting.')
+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()
+ if answer in yes:
+ return
+ else:
+ raise dnf.exceptions.Error(_('Safe and good answer. Exiting.'))
10 years, 2 months