diff options
-rw-r--r-- | meta/classes/staging.bbclass | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass index e03ed2a5ef..b771b92fae 100644 --- a/meta/classes/staging.bbclass +++ b/meta/classes/staging.bbclass | |||
@@ -13,10 +13,17 @@ packagedstaging_fastpath () { | |||
13 | sysroot_stage_dir() { | 13 | sysroot_stage_dir() { |
14 | src="$1" | 14 | src="$1" |
15 | dest="$2" | 15 | dest="$2" |
16 | # This will remove empty directories so we can ignore them | 16 | # if the src doesn't exist don't do anything |
17 | if [ ! -d "$src" ]; then | ||
18 | return | ||
19 | fi | ||
20 | |||
21 | # We only want to stage the contents of $src if it's non-empty so first rmdir $src | ||
22 | # then if it still exists (rmdir on non-empty dir fails) we can copy its contents | ||
17 | rmdir "$src" 2> /dev/null || true | 23 | rmdir "$src" 2> /dev/null || true |
24 | # However we always want to stage a $src itself, even if it's empty | ||
25 | mkdir -p "$dest" | ||
18 | if [ -d "$src" ]; then | 26 | if [ -d "$src" ]; then |
19 | mkdir -p "$dest" | ||
20 | cp -fpPR "$src"/* "$dest" | 27 | cp -fpPR "$src"/* "$dest" |
21 | fi | 28 | fi |
22 | } | 29 | } |
@@ -52,6 +59,7 @@ sysroot_stage_dirs() { | |||
52 | sysroot_stage_dir $from${base_sbindir} $to${STAGING_DIR_HOST}${base_sbindir} | 59 | sysroot_stage_dir $from${base_sbindir} $to${STAGING_DIR_HOST}${base_sbindir} |
53 | sysroot_stage_dir $from${libexecdir} $to${STAGING_DIR_HOST}${libexecdir} | 60 | sysroot_stage_dir $from${libexecdir} $to${STAGING_DIR_HOST}${libexecdir} |
54 | sysroot_stage_dir $from${sysconfdir} $to${STAGING_DIR_HOST}${sysconfdir} | 61 | sysroot_stage_dir $from${sysconfdir} $to${STAGING_DIR_HOST}${sysconfdir} |
62 | sysroot_stage_dir $from${localstatedir} $to${STAGING_DIR_HOST}${localstatedir} | ||
55 | fi | 63 | fi |
56 | if [ -d $from${libdir} ] | 64 | if [ -d $from${libdir} ] |
57 | then | 65 | then |