summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-10-21 08:28:24 -0700
committerZac Medico <zmedico@gentoo.org>2010-10-21 08:28:24 -0700
commit0e74fa8a52809de93d0e3514622dc1aa43e1ce55 (patch)
tree950cd277b5bbccbd256d97d4b763951e66dddb50
parent41d54403437745bc4ed4c66a54b2b741576debb7 (diff)
downloadportage-0e74fa8a52809de93d0e3514622dc1aa43e1ce55.tar.gz
portage-0e74fa8a52809de93d0e3514622dc1aa43e1ce55.tar.bz2
portage-0e74fa8a52809de93d0e3514622dc1aa43e1ce55.zip
dispatch-conf: suppress 'No such file' errors.
This will fix bug #341463.
-rw-r--r--pym/portage/dispatch_conf.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/pym/portage/dispatch_conf.py b/pym/portage/dispatch_conf.py
index e51e5cd13..5724d9169 100644
--- a/pym/portage/dispatch_conf.py
+++ b/pym/portage/dispatch_conf.py
@@ -83,11 +83,13 @@ def rcs_archive(archive, curconf, newconf, mrgconf):
except OSError:
pass
- try:
- shutil.copy2(curconf, archive)
- except(IOError, os.error) as why:
- print(_('dispatch-conf: Error copying %(curconf)s to %(archive)s: %(reason)s; fatal') % \
- {"curconf": curconf, "archive": archive, "reason": str(why)}, file=sys.stderr)
+ if os.path.isfile(curconf):
+ try:
+ shutil.copy2(curconf, archive)
+ except(IOError, os.error) as why:
+ print(_('dispatch-conf: Error copying %(curconf)s to %(archive)s: %(reason)s; fatal') % \
+ {"curconf": curconf, "archive": archive, "reason": str(why)}, file=sys.stderr)
+
if os.path.exists(archive + ',v'):
os.system(RCS_LOCK + ' ' + archive)
os.system(RCS_PUT + ' ' + archive)
@@ -142,11 +144,12 @@ def file_archive(archive, curconf, newconf, mrgconf):
os.rename(archive, archive + '.1')
- try:
- shutil.copy2(curconf, archive)
- except(IOError, os.error) as why:
- print(_('dispatch-conf: Error copying %(curconf)s to %(archive)s: %(reason)s; fatal') % \
- {"curconf": curconf, "archive": archive, "reason": str(why)}, file=sys.stderr)
+ if os.path.isfile(curconf):
+ try:
+ shutil.copy2(curconf, archive)
+ except(IOError, os.error) as why:
+ print(_('dispatch-conf: Error copying %(curconf)s to %(archive)s: %(reason)s; fatal') % \
+ {"curconf": curconf, "archive": archive, "reason": str(why)}, file=sys.stderr)
if newconf != '':
# Save off new config file in the archive dir with .dist.new suffix