Skip to contentSkip to conversation

archiver: exit to avoid race conditions

PATCH Jose Quaresma 1 participant 1 message Jun 9, 2022 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi,

Instead of failing make it more resilient for when used with multiconfig sharing the same TMPDIR.
I will send a v3

Jose

Jose Quaresma via lists.openembedded.org <quaresma.jose= [email protected]> escreveu no dia sexta, 27/05/2022 à(s) 11:29:

Quoted 45 lines

The archiver doesn't support using multiconfig sharing the same TMPDIR so rise an error when we have something that shouldn't exist.

When in the multiconfig and using the same TMPDIR: the two machines can make
the same copy at the same time to the same destination, which will not work.

---

v2: replace "bb.error" with "bb.fatal"

 meta/classes/archiver.bbclass | 2 ++
 1 file changed, 2 insertions(+)
meta/classes/archiver.bbclass +2 -0
index c19c770d11..87c0f90252 100644
@@ -486,6 +486,8 @@ python do_unpack_and_patch() {
     if d.getVarFlag('ARCHIVER_MODE', 'diff') == '1':
         src = d.getVar('S').rstrip('/')
         src_orig = '%s.orig' % src
+        if os.path.isdir(src_orig):
+            bb.fatal("A previous copy of the original source already
 exist '%s'" % src_orig)
         oe.path.copytree(src, src_orig)
 

if bb.data.inherits_class('dos2unix', d):
--
2.36.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#166207):
https://lists.openembedded.org/g/openembedded-core/message/166207
Mute This Topic: https://lists.openembedded.org/mt/91373641/5052612
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
Best regards,

José Quaresma