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 F2700138CC5 for ; Tue, 24 Mar 2015 22:56:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E8BBCE087B; Tue, 24 Mar 2015 22:56:07 +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 983CFE087B for ; Tue, 24 Mar 2015 22:56:07 +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 524E834090B for ; Tue, 24 Mar 2015 22:56:06 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B15231476A for ; Tue, 24 Mar 2015 22:56:02 +0000 (UTC) From: "Devan Franchini" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Devan Franchini" Message-ID: <1427237698.c48ab55121d41869307045a59f691b1faae95e28.twitch153@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: twitch153 X-VCS-Committer-Name: Devan Franchini X-VCS-Revision: c48ab55121d41869307045a59f691b1faae95e28 X-VCS-Branch: master Date: Tue, 24 Mar 2015 22:56:02 +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: 272ff370-8a2e-4dcf-af91-b598a7189856 X-Archives-Hash: 2c55b4dff8489a2ec0af18b5bc9d40d8 commit: c48ab55121d41869307045a59f691b1faae95e28 Author: Devan Franchini gentoo org> AuthorDate: Tue Mar 24 22:54:54 2015 +0000 Commit: Devan Franchini gentoo org> CommitDate: Tue Mar 24 22:54:58 2015 +0000 URL: https://gitweb.gentoo.org/proj/layman.git/commit/?id=c48ab551 updater.py: Adds check to ensure repos_conf is not a directory layman/updater.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/layman/updater.py b/layman/updater.py index ccf6c8d..02e85c7 100644 --- a/layman/updater.py +++ b/layman/updater.py @@ -182,15 +182,26 @@ class Main(object): def create_repos_conf(self): self.output.info(" Creating layman's repos.conf file") + + if os.path.isdir(self.config['repos_conf']): + msg = ' create_repos_conf() error: %s is a directory and will\n'\ + ' not be written to.' % self.config['repos_conf'] + self.output.error(msg) + return None + conf_dir = os.path.dirname(self.config['repos_conf']) if not os.path.isdir(conf_dir): try: os.mkdir(conf_dir) except OSError as e: - self.output.error(' create_repos_conf() error creating %s: ' % conf_dir) + self.output.error(' create_repos_conf() error creating %s: '\ + % conf_dir) self.output.error(' "%s"' % e) return None + else: + msg = str(conf_dir) + ' is a directory.' + self.output.error(' create_repos_conf() error: %s\n' % msg) layman_inst = LaymanAPI(config=self.config) overlays = {}