mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
lib/oe: sync with OE.dev
Most notable change is the move to creating symlinks to patches in the metadata tree rather than copying them. Signed-off-by: Joshua Lock <josh@linux.intel.com>
This commit is contained in:
committed by
Richard Purdie
parent
7b74364120
commit
1fbcd2ca17
@@ -42,3 +42,25 @@ def format_display(path, metadata):
|
||||
return path
|
||||
else:
|
||||
return rel
|
||||
|
||||
def remove(path):
|
||||
"""Equivalent to rm -f or rm -rf"""
|
||||
import os, errno, shutil
|
||||
try:
|
||||
os.unlink(path)
|
||||
except OSError, exc:
|
||||
if exc.errno == errno.EISDIR:
|
||||
shutil.rmtree(path)
|
||||
elif exc.errno != errno.ENOENT:
|
||||
raise
|
||||
|
||||
def symlink(source, destination, force=False):
|
||||
"""Create a symbolic link"""
|
||||
import os, errno
|
||||
try:
|
||||
if force:
|
||||
remove(destination)
|
||||
os.symlink(source, destination)
|
||||
except OSError, e:
|
||||
if e.errno != errno.EEXIST or os.readlink(destination) != source:
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user