diff options
author | Ross Burton <ross.burton@arm.com> | 2023-01-03 17:47:34 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-01-06 12:03:47 +0000 |
commit | de5aac2a0b9dd0656669d110cef47f2366c8043d (patch) | |
tree | beaecb2c78d938a8fc5579cdb6ba5247bfcaf813 /meta/classes/rm_work.bbclass | |
parent | eb2a1c7830943d752c8468fa431037386efbe13a (diff) | |
download | poky-de5aac2a0b9dd0656669d110cef47f2366c8043d.tar.gz |
rm_work: handle non-existant stamps directory
Since 'build/siggen: Rework stamps functions'[1] the stamps directory
for each recipe is only created if there are stamps to be written. Some
recipes - such as package-index - only have nostamp tasks so the stamps
directory is never created, resulting in the rm_work task trying to cd
into a directory that doesn't exist.
Resolve this by simply checking the stamps directory exists before
trying to delete files in it.
[1] bitbake c79ecec580e4c2a141ae483ec0f6448f70593dcf
(From OE-Core rev: 80e9b32a000b25420997068543d3631231eb3ccf)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/rm_work.bbclass')
-rw-r--r-- | meta/classes/rm_work.bbclass | 101 |
1 files changed, 52 insertions, 49 deletions
diff --git a/meta/classes/rm_work.bbclass b/meta/classes/rm_work.bbclass index 8b5fe1b808..52ecfafb72 100644 --- a/meta/classes/rm_work.bbclass +++ b/meta/classes/rm_work.bbclass | |||
@@ -57,55 +57,58 @@ do_rm_work () { | |||
57 | # Change normal stamps into setscene stamps as they better reflect the | 57 | # Change normal stamps into setscene stamps as they better reflect the |
58 | # fact WORKDIR is now empty | 58 | # fact WORKDIR is now empty |
59 | # Also leave noexec stamps since setscene stamps don't cover them | 59 | # Also leave noexec stamps since setscene stamps don't cover them |
60 | cd `dirname ${STAMP}` | 60 | STAMPDIR=`dirname ${STAMP}` |
61 | for i in `basename ${STAMP}`* | 61 | if test -d $STAMPDIR; then |
62 | do | 62 | cd $STAMPDIR |
63 | case $i in | 63 | for i in `basename ${STAMP}`* |
64 | *sigdata*|*sigbasedata*) | 64 | do |
65 | # Save/skip anything that looks like a signature data file. | 65 | case $i in |
66 | ;; | 66 | *sigdata*|*sigbasedata*) |
67 | *do_image_complete_setscene*|*do_image_qa_setscene*) | 67 | # Save/skip anything that looks like a signature data file. |
68 | # Ensure we don't 'stack' setscene extensions to these stamps with the sections below | 68 | ;; |
69 | ;; | 69 | *do_image_complete_setscene*|*do_image_qa_setscene*) |
70 | *do_image_complete*) | 70 | # Ensure we don't 'stack' setscene extensions to these stamps with the sections below |
71 | # Promote do_image_complete stamps to setscene versions (ahead of *do_image* below) | 71 | ;; |
72 | mv $i `echo $i | sed -e "s#do_image_complete#do_image_complete_setscene#"` | 72 | *do_image_complete*) |
73 | ;; | 73 | # Promote do_image_complete stamps to setscene versions (ahead of *do_image* below) |
74 | *do_image_qa*) | 74 | mv $i `echo $i | sed -e "s#do_image_complete#do_image_complete_setscene#"` |
75 | # Promote do_image_qa stamps to setscene versions (ahead of *do_image* below) | 75 | ;; |
76 | mv $i `echo $i | sed -e "s#do_image_qa#do_image_qa_setscene#"` | 76 | *do_image_qa*) |
77 | ;; | 77 | # Promote do_image_qa stamps to setscene versions (ahead of *do_image* below) |
78 | *do_package_write*|*do_rootfs*|*do_image*|*do_bootimg*|*do_write_qemuboot_conf*|*do_build*) | 78 | mv $i `echo $i | sed -e "s#do_image_qa#do_image_qa_setscene#"` |
79 | ;; | 79 | ;; |
80 | *do_addto_recipe_sysroot*) | 80 | *do_package_write*|*do_rootfs*|*do_image*|*do_bootimg*|*do_write_qemuboot_conf*|*do_build*) |
81 | # Preserve recipe-sysroot-native if do_addto_recipe_sysroot has been used | 81 | ;; |
82 | excludes="$excludes recipe-sysroot-native" | 82 | *do_addto_recipe_sysroot*) |
83 | ;; | 83 | # Preserve recipe-sysroot-native if do_addto_recipe_sysroot has been used |
84 | *do_package|*do_package.*|*do_package_setscene.*) | 84 | excludes="$excludes recipe-sysroot-native" |
85 | # We remove do_package entirely, including any | 85 | ;; |
86 | # sstate version since otherwise we'd need to leave 'plaindirs' around | 86 | *do_package|*do_package.*|*do_package_setscene.*) |
87 | # such as 'packages' and 'packages-split' and these can be large. No end | 87 | # We remove do_package entirely, including any |
88 | # of chain tasks depend directly on do_package anymore. | 88 | # sstate version since otherwise we'd need to leave 'plaindirs' around |
89 | "${RM_BIN}" -f -- $i; | 89 | # such as 'packages' and 'packages-split' and these can be large. No end |
90 | ;; | 90 | # of chain tasks depend directly on do_package anymore. |
91 | *_setscene*) | 91 | "${RM_BIN}" -f -- $i; |
92 | # Skip stamps which are already setscene versions | 92 | ;; |
93 | ;; | 93 | *_setscene*) |
94 | *) | 94 | # Skip stamps which are already setscene versions |
95 | # For everything else: if suitable, promote the stamp to a setscene | 95 | ;; |
96 | # version, otherwise remove it | 96 | *) |
97 | for j in ${SSTATETASKS} do_shared_workdir | 97 | # For everything else: if suitable, promote the stamp to a setscene |
98 | do | 98 | # version, otherwise remove it |
99 | case $i in | 99 | for j in ${SSTATETASKS} do_shared_workdir |
100 | *$j|*$j.*) | 100 | do |
101 | mv $i `echo $i | sed -e "s#${j}#${j}_setscene#"` | 101 | case $i in |
102 | break | 102 | *$j|*$j.*) |
103 | ;; | 103 | mv $i `echo $i | sed -e "s#${j}#${j}_setscene#"` |
104 | esac | 104 | break |
105 | done | 105 | ;; |
106 | "${RM_BIN}" -f -- $i | 106 | esac |
107 | esac | 107 | done |
108 | done | 108 | "${RM_BIN}" -f -- $i |
109 | esac | ||
110 | done | ||
111 | fi | ||
109 | 112 | ||
110 | cd ${WORKDIR} | 113 | cd ${WORKDIR} |
111 | for dir in * | 114 | for dir in * |