From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id B2E2B138A1A for ; Sun, 8 Feb 2015 01:57:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E676BE0C4E; Sun, 8 Feb 2015 01:57:19 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8D2C6E0C4E for ; Sun, 8 Feb 2015 01:57:19 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0B10A34076B for ; Sun, 8 Feb 2015 01:57:18 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DFBA61149F for ; Sun, 8 Feb 2015 01:57:14 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1423360558.13380e488ad4a458d7d2410bc235c62d61c7a595.dolsen@gentoo> Subject: [gentoo-commits] proj/layman:master commit in: layman/ X-VCS-Repository: proj/layman X-VCS-Files: layman/updater.py X-VCS-Directories: layman/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 13380e488ad4a458d7d2410bc235c62d61c7a595 X-VCS-Branch: master Date: Sun, 8 Feb 2015 01:57:14 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 58b88565-284a-4eb2-9d39-d6d8670ae835 X-Archives-Hash: 837e7b13be6b72525b504e1d832d3aad commit: 13380e488ad4a458d7d2410bc235c62d61c7a595 Author: Brian Dolbec gentoo org> AuthorDate: Sun Feb 8 01:55:58 2015 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Sun Feb 8 01:55:58 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=13380e48 updater.py: Add a -R, --rebuild option to force a rebuild of the config --- layman/updater.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/layman/updater.py b/layman/updater.py index e3003f9..fe3f300 100644 --- a/layman/updater.py +++ b/layman/updater.py @@ -57,6 +57,8 @@ class Main(object): help = 'Print the NEW INSTALL help messages.') self.parser.add_argument("-c", "--config", help='the path to config file') + self.parser.add_argument("-R", "--rebuild", action='store_true', + help='rebuild the Pacakge Manager config file') self.parser.add_argument('--version', action='version', version='%(prog)s ' + VERSION) @@ -85,18 +87,18 @@ class Main(object): if self.args.setup_help: self.print_instructions() - elif not self.check_is_new(): + elif not self.check_is_new(self.args.rebuild): self.rename_check() - def check_is_new(self): + def check_is_new(self, rebuild=False): print_instructions = False if isinstance(self.config['conf_type'], STR): self.config.set_option('conf_type', self.config['conf_type'].split(',')) for i in self.config['conf_type']: conf = i.replace('.', '_').strip() - if conf and not os.access(self.config[conf], os.F_OK): + if conf and (rebuild or not os.access(self.config[conf], os.F_OK)): getattr(self, 'create_%(conf)s' % {'conf': conf})() print_instructions = True if print_instructions: