[jhbuild] modtypes: Print source and destination if we fail rename() call in makeinstall



commit 79777ff52c1707cdf18ee6408f0a8324c8d5321d
Author: Colin Walters <walters verbum org>
Date:   Sat Dec 31 12:26:48 2011 -0500

    modtypes: Print source and destination if we fail rename() call in makeinstall
    
    For ease of debugging broken modules, print the full source and
    destination path if we get an error from rename() - for example, when
    trying to rename a file over a directory.

 jhbuild/modtypes/__init__.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/jhbuild/modtypes/__init__.py b/jhbuild/modtypes/__init__.py
index dd75b98..a546b73 100644
--- a/jhbuild/modtypes/__init__.py
+++ b/jhbuild/modtypes/__init__.py
@@ -228,7 +228,15 @@ them into the prefix."""
                 os.rmdir(src_path)
             else:
                 num_copied += 1
-                os.rename(src_path, dest_path)
+                try:
+                    os.rename(src_path, dest_path)
+                except OSError, e:
+                    logging.error(_('Failed to rename %(src)r to %(dest)r: %(msg)s') %
+                                  {'src': src_path,
+                                   'dest': dest_path,
+                                   'msg': e.message})
+                    raise
+                    
         return num_copied
 
     def process_install(self, buildscript, revision):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]