summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/package.bbclass33
1 files changed, 27 insertions, 6 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index a9c510d27c..0e1d8dbfc4 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -916,16 +916,37 @@ python populate_packages () {
916 if file in seen: 916 if file in seen:
917 continue 917 continue
918 seen.append(file) 918 seen.append(file)
919
920 def mkdir(src, dest, p):
921 src = os.path.join(src, p)
922 dest = os.path.join(dest, p)
923 bb.mkdirhier(dest)
924 fstat = os.stat(src)
925 os.chmod(dest, fstat.st_mode)
926 os.chown(dest, fstat.st_uid, fstat.st_gid)
927 if p not in seen:
928 seen.append(p)
929
930 def mkdir_recurse(src, dest, paths):
931 while paths.startswith("./"):
932 paths = paths[2:]
933 p = "."
934 for c in paths.split("/"):
935 p = os.path.join(p, c)
936 if not os.path.exists(os.path.join(dest, p)):
937 mkdir(src, dest, p)
938
919 if os.path.isdir(file) and not os.path.islink(file): 939 if os.path.isdir(file) and not os.path.islink(file):
920 bb.mkdirhier(os.path.join(root,file)) 940 mkdir_recurse(dvar, root, file)
921 os.chmod(os.path.join(root,file), os.stat(file).st_mode)
922 continue 941 continue
923 942
943 mkdir_recurse(dvar, root, os.path.dirname(file))
924 fpath = os.path.join(root,file) 944 fpath = os.path.join(root,file)
925 dpath = os.path.dirname(fpath)
926 bb.mkdirhier(dpath)
927 if not os.path.islink(file): 945 if not os.path.islink(file):
928 os.link(file, fpath) 946 os.link(file, fpath)
947 fstat = os.stat(file)
948 os.chmod(fpath, fstat.st_mode)
949 os.chown(fpath, fstat.st_uid, fstat.st_gid)
929 continue 950 continue
930 ret = bb.copyfile(file, fpath) 951 ret = bb.copyfile(file, fpath)
931 if ret is False or ret == 0: 952 if ret is False or ret == 0:
@@ -939,13 +960,13 @@ python populate_packages () {
939 dir = root[len(dvar):] 960 dir = root[len(dvar):]
940 if not dir: 961 if not dir:
941 dir = os.sep 962 dir = os.sep
942 for f in files: 963 for f in (files + dirs):
943 path = os.path.join(dir, f) 964 path = os.path.join(dir, f)
944 if ('.' + path) not in seen: 965 if ('.' + path) not in seen:
945 unshipped.append(path) 966 unshipped.append(path)
946 967
947 if unshipped != []: 968 if unshipped != []:
948 bb.warn("For recipe %s, the following files were installed but not shipped in any package:" % pn) 969 bb.warn("For recipe %s, the following files/directories were installed but not shipped in any package:" % pn)
949 for f in unshipped: 970 for f in unshipped:
950 bb.warn(" " + f) 971 bb.warn(" " + f)
951 972