Skip to contentSkip to conversation

fetch2/gitsm: Unpack shallow mirror tarballs

PATCH In review Paul Barker 2 participants 3 messages Feb 24, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fetch2/gitsm: Unpack shallow mirror tarballs

When a shallow mirror tarball is used to satisfy a gitsm URI it needs to be unpacked so that the .gitmodules file can be examined.

---
 lib/bb/fetch2/gitsm.py | 6 ++++++
 1 file changed, 6 insertions(+)
lib/bb/fetch2/gitsm.py +6 -0
index aa121cbe..98f5dae5 100644
@@ -169,6 +169,12 @@ class GitSM(Git):
                 raise
 
         Git.download(self, ud, d)
+
+        # If we're using a shallow mirror tarball it needs to be unpacked so
+        # that we can examine the .gitmodules file
+        if ud.shallow and os.path.exists(ud.fullshallow) and Git.need_update(self, ud, d):
+            bb.utils.mkdirhier(ud.clonedir)
+            runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=ud.clonedir)
         self.process_submodules(ud, ud.clonedir, download_submodule, d)
 
     def unpack(self, ud, destdir, d):
Signature · 1 line
2.20.1
#1 lore raw
Quoted 27 lines · Paul Barker

When a shallow mirror tarball is used to satisfy a gitsm URI it needs to be unpacked so that the .gitmodules file can be examined.

---
 lib/bb/fetch2/gitsm.py | 6 ++++++
 1 file changed, 6 insertions(+)
lib/bb/fetch2/gitsm.py +6 -1
index aa121cbe..98f5dae5 100644
@@ -169,6 +169,12 @@ class GitSM(Git):
                 raise
 
         Git.download(self, ud, d)
+
+        # If we're using a shallow mirror tarball it needs to be unpacked so
+        # that we can examine the .gitmodules file
+        if ud.shallow and os.path.exists(ud.fullshallow) and Git.need_update(self, ud, d):
+            bb.utils.mkdirhier(ud.clonedir)
+            runfetchcmd("tar -xzf %s" % ud.fullshallow, d, workdir=ud.clonedir)
         self.process_submodules(ud, ud.clonedir, download_submodule, d)
 
     def unpack(self, ud, destdir, d):
--
Quoted 2 lines

2.20.1

I realised the moment I hit send that I got the wrong mailing list...

#2 lore raw

✗ patchtest: failure for fetch2/gitsm: Unpack shallow mirror tarballs

In reply to Paul Barker

== Series Details ==

Series: fetch2/gitsm: Unpack shallow mirror tarballs
Revision: 1
URL : https://patchwork.openembedded.org/series/22916/
State : failure

== Summary ==

Thank you for submitting this patch series to OpenEmbedded Core. This is an automated response. Several tests have been executed on the proposed series by patchtest resulting in the following failures:

* Issue Series does not apply on top of target branch [test_series_merge_on_head]
Suggested fix Rebase your series on top of targeted branch
Targeted branch master (currently at 0bfb2e9840)

If you believe any of these test results are incorrect, please reply to the mailing list ([email protected]) raising your concerns. Otherwise we would appreciate you correcting the issues and submitting a new version of the patchset if applicable. Please ensure you add/increment the version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...).

---

Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe