From: Anton Mikanovich <amikan@ilbers.de>
To: isar-users@googlegroups.com
Cc: Anton Mikanovich <amikan@ilbers.de>
Subject: [PATCH v1 1/2] dpkg: Adjust symlinks for mirrors
Date: Tue, 23 Mar 2021 14:50:01 +0300 [thread overview]
Message-ID: <20210323115002.171050-2-amikan@ilbers.de> (raw)
In-Reply-To: <20210323115002.171050-1-amikan@ilbers.de>
When bitbake fetch git repository from mirror it creates symlink from
original repository name. This symlink use absolute path, which is not
exist inside chroot when building the package. So we need to adjust this
path just like we do for git alternates path.
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
meta/classes/dpkg-base.bbclass | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 5c7bddc..23dc191 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -26,6 +26,13 @@ python do_adjust_git() {
if ud.type != 'git':
continue
+ if os.path.islink(ud.localpath):
+ realpath = os.path.realpath(ud.localpath)
+ if realpath.startswith(d.getVar("DL_DIR")):
+ link = realpath.replace(d.getVar("DL_DIR"), '/downloads', 1)
+ os.unlink(ud.localpath)
+ os.symlink(link, ud.localpath)
+
subdir = ud.parm.get("subpath", "")
if subdir != "":
def_destsuffix = "%s/" % os.path.basename(subdir.rstrip('/'))
--
2.25.1
next prev parent reply other threads:[~2021-03-23 11:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-23 11:50 [PATCH v1 0/2] Implement salsa.debian.org packages mirroring Anton Mikanovich
2021-03-23 11:50 ` Anton Mikanovich [this message]
2021-08-12 7:42 ` [PATCH v1 1/2] dpkg: Adjust symlinks for mirrors Jan Kiszka
2021-03-23 11:50 ` [PATCH v1 2/2] conf: Add ilbers mirror support for salsa repos Anton Mikanovich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210323115002.171050-2-amikan@ilbers.de \
--to=amikan@ilbers.de \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox