From: Michael Tremer Date: Sat, 26 Feb 2011 10:14:08 +0000 (+0100) Subject: Catch error with dead symlinks on packaging. X-Git-Tag: 0.9.3~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a0737c7b7465bd1f23a583d10d497ad12f75c26;p=pakfire.git Catch error with dead symlinks on packaging. --- diff --git a/pakfire/packages/packager.py b/pakfire/packages/packager.py index d9f7ec8d3..d6479a87c 100644 --- a/pakfire/packages/packager.py +++ b/pakfire/packages/packager.py @@ -319,6 +319,10 @@ class Packager(object): if os.path.isfile(file_real): os.link(file_real, file_tmp) + elif os.path.islink(file_real): + # Dead symlinks cannot be copied by shutil. + os.symlink(os.readlink(file_real), file_tmp) + else: shutil.copy2(file_real, file_tmp)