From 81445a1849198065ce72b74c39db710c229f5666 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Feb 16 2012 06:33:06 +0000 Subject: Make things quiet when possible This requires rpkg API changes so bump the requirement level in the spec --- diff --git a/fedpkg.spec b/fedpkg.spec index 2095ea3..31d15f2 100644 --- a/fedpkg.spec +++ b/fedpkg.spec @@ -12,7 +12,7 @@ URL: http://fedorahosted.org/fedpkg Source0: http://fedorahosted.org/releases/f/e/fedpkg/fedpkg-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Requires: pyrpkg >= 1.11, redhat-rpm-config +Requires: pyrpkg >= 1.13, redhat-rpm-config Requires: python-pycurl, koji, python-fedora Requires: fedora-cert, python-offtrac, bodhi-client %if 0%{?rhel} == 5 || 0%{?rhel} == 4 diff --git a/src/pyrpkg/fedpkg/__init__.py b/src/pyrpkg/fedpkg/__init__.py index 6a4c0de..da17a6e 100644 --- a/src/pyrpkg/fedpkg/__init__.py +++ b/src/pyrpkg/fedpkg/__init__.py @@ -56,7 +56,8 @@ class Commands(pyrpkg.Commands): def __init__(self, path, lookaside, lookasidehash, lookaside_cgi, gitbaseurl, anongiturl, branchre, kojiconfig, - build_client, user=None, dist=None, target=None): + build_client, user=None, dist=None, target=None, + quiet=False): """Init the object and some configuration details.""" # We are subclassing to set kojiconfig to none, so that we can @@ -64,7 +65,7 @@ class Commands(pyrpkg.Commands): super(Commands, self).__init__(path, lookaside, lookasidehash, lookaside_cgi, gitbaseurl, anongiturl, branchre, kojiconfig, build_client, user, - dist, target) + dist, target, quiet) # New data self.secondary_arch = {'sparc': ['silo', 'prtconf', 'lssbus', 'afbinit', @@ -254,7 +255,10 @@ class Commands(pyrpkg.Commands): cmd = ['curl', '-k', '--cert', self.cert_file, '--fail', '-o', '/dev/null', '--show-error', '--progress-bar', '-F', 'name=%s' % self.module_name, '-F', 'md5sum=%s' % file_hash, - '-F', 'file=@%s' % file, self.lookaside_cgi] + '-F', 'file=@%s' % file] + if self.quiet: + cmd.append('-s') + cmd.append(self.lookaside_cgi) self._run_command(cmd) def _findmasterbranch(self): @@ -358,7 +362,10 @@ class Commands(pyrpkg.Commands): Runs the commands and returns nothing """ - cmd = ['git', 'rm', '-rf', '.'] + cmd = ['git'] + if self.quiet: + cmd.append('--quiet') + cmd.extend(['rm', '-rf', '.']) self._run_command(cmd, cwd=self.path) if not message: