diff options
author | Dave Cobbley <david.j.cobbley@linux.intel.com> | 2018-08-14 10:05:37 -0700 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-22 21:26:31 -0400 |
commit | eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch) | |
tree | de291a73dc37168da6370e2cf16c347d1eba9df8 /import-layers/yocto-poky/scripts/sysroot-relativelinks.py | |
parent | 9c3cf826d853102535ead04cebc2d6023eff3032 (diff) | |
download | blackbird-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.gz blackbird-openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.zip |
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers
content to the top level.
Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f
Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'import-layers/yocto-poky/scripts/sysroot-relativelinks.py')
-rwxr-xr-x | import-layers/yocto-poky/scripts/sysroot-relativelinks.py | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/import-layers/yocto-poky/scripts/sysroot-relativelinks.py b/import-layers/yocto-poky/scripts/sysroot-relativelinks.py deleted file mode 100755 index ffe254728..000000000 --- a/import-layers/yocto-poky/scripts/sysroot-relativelinks.py +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env python3 -import sys -import os - -# Take a sysroot directory and turn all the abolute symlinks and turn them into -# relative ones such that the sysroot is usable within another system. - -if len(sys.argv) != 2: - print("Usage is " + sys.argv[0] + "<directory>") - sys.exit(1) - -topdir = sys.argv[1] -topdir = os.path.abspath(topdir) - -def handlelink(filep, subdir): - link = os.readlink(filep) - if link[0] != "/": - return - if link.startswith(topdir): - return - #print("Replacing %s with %s for %s" % (link, topdir+link, filep)) - print("Replacing %s with %s for %s" % (link, os.path.relpath(topdir+link, subdir), filep)) - os.unlink(filep) - os.symlink(os.path.relpath(topdir+link, subdir), filep) - -for subdir, dirs, files in os.walk(topdir): - for f in dirs + files: - filep = os.path.join(subdir, f) - if os.path.islink(filep): - #print("Considering %s" % filep) - handlelink(filep, subdir) |