Search code examples
yoctobitbake

yocto-bitbake mirror keep branch


for my yocto project I'm mirroring to my repo to a private one, it's working fine for basic SRC_URI, but for url that have a branch defined it will erase it and bring the default one (master), making it fail since the branch referenced in the original uri was a tag. DEBUG: Fetcher failure: Unable to find revision xxx_git_commit_hash_xxx in branch master even from upstream

In my .bb file:

SRC_URI = "git://github.com/google/protobuf.git;branch=3.11.x \

and in my local.conf (in the build folder) for the mirroring i have:

SOURCE_TOMYMIRROR="myUser@MyServerIdServer:/The/Path/to/directory"
PREMIRRORS_prepend ?= "\
git://.*/.* git://${SOURCE_TOMYMIRROR}/HOST/PATH;protocol=ssh\n \
"

(Yes i want to keep HOST and PATH as path to get the repo) I can see in the logs that my repo is correctly fetch, but the "new" url is without branch and I can't find a way to keep the .bb one

I tried to understand and look at the documentation, but i don't see a way to keep a specific parameter (like the HOST and PATH variable) So i tried to look at the init.py which define the rules, but i couldn't figure out if it's possible.


Solution

  • I think the right notation would be specifying the branch as well into the premirror URL.

    SOURCE_MIRROR_URL = "git://${SOURCE_TOMYMIRROR};protocol=ssh;branch=3.11.x"
    PREMIRRORS_prepend = " git://.*/.*     ${SOURCE_MIRROR_URL} \
    "