Task adjust_git modifies git alternates by replacing DL_DIR to /downloads.
New path is used inside buildchroot, so that working git repo
becomes broken outside buildchroot.
This causes problems with rebuilding such packages as cowsay if something
has changed in bitbake environment since previous build:
ERROR:
mc:qemuarm64-buster:cowsay-git-r0 do_patch: Command Error: 'sh -c 'git
--work-tree=/path/build/tmp/work/debian-buster-arm64/cowsay/git-r0/git
reset --hard HEAD'' exited with 0
The solution is to add new path to git alternates so that original path
will work outside buildchroot, and new one will work in buildchroot.
Signed-off-by: Uladzimir Bely <
ub...@ilbers.de>
---
meta/classes/dpkg-base.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index ec8fbc1..4b9b782 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -46,7 +46,7 @@ python do_adjust_git() {
if os.path.exists(alternates):
cmd = ["sed", "-i", alternates, "-e",
- "s|{}|/downloads|".format(d.getVar("DL_DIR"))]
+ "s|\({}\(.*\)\)|\\1\\n/downloads\\2|".format(d.getVar("DL_DIR"))]
bb.note(' '.join(cmd))
if subprocess.call(cmd) != 0:
bb.fatal("git alternates adjustment failed")
--
2.20.1