portage/dispatch_conf.py: Fix bug 512690
This bug happened when a /etc/portage/package.* file was changed into a directory.
File "/usr/lib64/portage/pym/portage/dispatch_conf.py", line 210, in file_archive_post_process
os.rename(archive + '.dist.new', archive + '.dist')
NotADirectoryError: [Errno 20] Not a directory: '/etc/config-archive/etc/portage/package.unmask/unmask.dist'
diff --git a/pym/portage/dispatch_conf.py b/pym/portage/dispatch_conf.py
index f975ccd..113d965 100644
--- a/pym/portage/dispatch_conf.py
+++ b/pym/portage/dispatch_conf.py
@@ -207,4 +207,5 @@
def file_archive_post_process(archive):
"""Rename the archive file with the .dist.new suffix to a .dist suffix"""
- os.rename(archive + '.dist.new', archive + '.dist')
+ if os.path.exists(archive + '.dist.new'):
+ os.rename(archive + '.dist.new', archive + '.dist')