From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RJf1p-0003Zw-Q9 for garchives@archives.gentoo.org; Fri, 28 Oct 2011 05:30:58 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 61DC421C02A; Fri, 28 Oct 2011 05:30:46 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 3622C21C02A for ; Fri, 28 Oct 2011 05:30:46 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AE08E1B400A for ; Fri, 28 Oct 2011 05:30:45 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 2257E80042 for ; Fri, 28 Oct 2011 05:30:45 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/repository/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/repository/config.py X-VCS-Directories: pym/portage/repository/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: b6c981f1165e45e3b2ccb0e97c2e0489872b750e Date: Fri, 28 Oct 2011 05:30:45 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 5d62dae28fcec365cf8b7fdfbdab80fe commit: b6c981f1165e45e3b2ccb0e97c2e0489872b750e Author: Zac Medico gentoo org> AuthorDate: Fri Oct 28 05:30:34 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Fri Oct 28 05:30:34 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Db6c981f1 RepoConfig.update(): getattr/setattr loop --- pym/portage/repository/config.py | 22 +++++++--------------- 1 files changed, 7 insertions(+), 15 deletions(-) diff --git a/pym/portage/repository/config.py b/pym/portage/repository/co= nfig.py index 19c1aeb..2cc8a0b 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -161,23 +161,15 @@ class RepoConfig(object): =20 def update(self, new_repo): """Update repository with options in another RepoConfig""" - if new_repo.aliases is not None: - self.aliases =3D new_repo.aliases - if new_repo.eclass_overrides is not None: - self.eclass_overrides =3D new_repo.eclass_overrides - if new_repo.masters is not None: - self.masters =3D new_repo.masters + + for k in ('aliases', 'eclass_overrides', 'location', 'masters', + 'name', 'priority', 'sync', 'user_location'): + v =3D getattr(new_repo, k, None) + if v is not None: + setattr(self, k, v) + if new_repo.name is not None: - self.name =3D new_repo.name self.missing_repo_name =3D new_repo.missing_repo_name - if new_repo.user_location is not None: - self.user_location =3D new_repo.user_location - if new_repo.location is not None: - self.location =3D new_repo.location - if new_repo.priority is not None: - self.priority =3D new_repo.priority - if new_repo.sync is not None: - self.sync =3D new_repo.sync =20 @staticmethod def _read_valid_repo_name(repo_path):