Message ID | c4e94db7e266f90dde06cd7d0e73dd3b035e121f.1729933869.git.liezhi.yang@windriver.com |
---|---|
State | Accepted, archived |
Commit | 2ba8d3214759142afc11f0a88d80eb30a8bcde3a |
Headers | show |
Series | [1/5] gitsm: Add call_process_submodules() to remove duplicated code | expand |
On Sat, 2024-10-26 at 02:39 -0700, Robert Yang via lists.openembedded.org wrote: > From: Robert Yang <liezhi.yang@windriver.com> > > The tmpdir such as downloads/tmplp3cnemv won't be removed without > this fix. > > Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Thanks, I've been meaning to track down the cause of those! Steve: We might want to consider this to help the autobuilder. Cheers, Richard
On Mon, Oct 28, 2024 at 7:06 AM Richard Purdie <richard.purdie@linuxfoundation.org> wrote: > > On Sat, 2024-10-26 at 02:39 -0700, Robert Yang via > lists.openembedded.org wrote: > > From: Robert Yang <liezhi.yang@windriver.com> > > > > The tmpdir such as downloads/tmplp3cnemv won't be removed without > > this fix. > > > > Signed-off-by: Robert Yang <liezhi.yang@windriver.com> > > Thanks, I've been meaning to track down the cause of those! > > Steve: We might want to consider this to help the autobuilder. This won't apply unless I also take gitsm: Add call_process_submodules() to remove duplicated code I've added both to all three stable branches and will test when the autobuilder is usable again. Steve
diff --git a/lib/bb/fetch2/gitsm.py b/lib/bb/fetch2/gitsm.py index 17aac6357..fab4b1164 100644 --- a/lib/bb/fetch2/gitsm.py +++ b/lib/bb/fetch2/gitsm.py @@ -152,9 +152,11 @@ class GitSM(Git): # unpacked temporarily so that we can examine the .gitmodules file if ud.shallow and os.path.exists(ud.fullshallow) and extra_check: tmpdir = tempfile.mkdtemp(dir=d.getVar("DL_DIR")) - runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=tmpdir) - self.process_submodules(ud, tmpdir, subfunc, d) - shutil.rmtree(tmpdir) + try: + runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=tmpdir) + self.process_submodules(ud, tmpdir, subfunc, d) + finally: + shutil.rmtree(tmpdir) else: self.process_submodules(ud, ud.clonedir, subfunc, d)