From: Jan Kiszka <jan.kiszka@siemens.com>
To: Anton Mikanovich <amikan@ilbers.de>, isar-users@googlegroups.com
Subject: Re: [PATCH v1 1/2] dpkg: Adjust symlinks for mirrors
Date: Thu, 12 Aug 2021 09:42:47 +0200 [thread overview]
Message-ID: <61c0f32b-3369-4e2d-335e-e300ed5f5879@siemens.com> (raw)
In-Reply-To: <20210323115002.171050-2-amikan@ilbers.de>
On 23.03.21 12:50, Anton Mikanovich wrote:
> 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('/'))
>
This is racy and can generate random build breakages if a git repo
should be used by multiple recipes. I'll fix this up by locking all
adjust_git tasks, which I need for making it compatible it compatible
with git-patching anyway.
Jan
--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2021-08-12 7:42 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 ` [PATCH v1 1/2] dpkg: Adjust symlinks for mirrors Anton Mikanovich
2021-08-12 7:42 ` Jan Kiszka [this message]
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=61c0f32b-3369-4e2d-335e-e300ed5f5879@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=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