forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds patch to check for the existence of repos.conf file, bug #574188
Package-Manager: portage-2.2.27
- Loading branch information
Devan Franchini
committed
Apr 30, 2016
1 parent
f4cb075
commit 3b44fea
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
From: Devan Franchini <[email protected]> | ||
Date: Sat, 30 Apr 2016 18:54:39 -0400 | ||
Subject: [PATCH] Adds dir check for repos.conf rebuilding | ||
|
||
--- a/layman/updater.py 2015-02-07 22:38:49.000000000 -0500 | ||
+++ b/layman/updater.py 2016-04-30 18:54:39.103894343 -0400 | ||
@@ -182,6 +182,24 @@ | ||
|
||
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(' "%s"' % e) | ||
+ return None | ||
+ | ||
layman_inst = LaymanAPI(config=self.config) | ||
overlays = {} | ||
for ovl in layman_inst.get_installed(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters