Backed out changeset 349a316ed0f7 (bug 1316735) for build packaging failures

CLOSED TREE
This commit is contained in:
Phil Ringnalda
2016-12-13 10:48:40 -08:00
parent b57e64d886
commit dea249bc26
5 changed files with 36 additions and 41 deletions

View File

@@ -323,25 +323,23 @@ class AbsoluteSymlinkFile(File):
if ose.errno != errno.ENOENT:
raise
src = os.path.relpath(self.path, os.path.dirname(dest))
# If the dest is a symlink pointing to us, we have nothing to do.
# If it's the wrong symlink, the filesystem must support symlinks,
# so we replace with a proper symlink.
if st and stat.S_ISLNK(st.st_mode):
link = os.readlink(dest)
if link == src:
if link == self.path:
return False
os.remove(dest)
os.symlink(src, dest)
os.symlink(self.path, dest)
return True
# If the destination doesn't exist, we try to create a symlink. If that
# fails, we fall back to copy code.
if not st:
try:
os.symlink(src, dest)
os.symlink(self.path, dest)
return True
except OSError:
return File.copy(self, dest, skip_if_older=skip_if_older)
@@ -364,7 +362,7 @@ class AbsoluteSymlinkFile(File):
temp_dest = os.path.join(os.path.dirname(dest), str(uuid.uuid4()))
try:
os.symlink(src, temp_dest)
os.symlink(self.path, temp_dest)
# TODO Figure out exactly how symlink creation fails and only trap
# that.
except EnvironmentError: