0

I have a new meta layer which contains a number of recipes that fetch and build proprietary packages. At my end, the source for all these packages are hosted on a git server.

The recipes fetch the sources using the git fetcher, i.e., as follows:

SRC_URI = "git://<internal-server-url>/<project>

The <internal-server-url> is something that my customer cannot see (the server is internal and can't be reached from external world).

Instead, customer has their own git server. For customer the server

SRC_URI = "git://<customer-server-url>/<project>

Is it possible to have the SRC_URI in the recipes in such a manner that customers do not have to edit and change the URI in the SRC_URI variable?

P.S: Using yocto (Jethro)

sob
  • 982
  • 11
  • 31
  • You could set the server URL in a variable in `local.conf` and reference that in the `SRC_URI` variable. Then at least they only have to change it in one spot. Or you could have it default to their server and then you are the only one who has to change it. `SRC_URI = "git://${MY_VAR}/"` – EarlCrapstone Jun 21 '17 at 22:26

1 Answers1

1

Just use a variable in your layer to refer to the URL of the server.

So layer.conf does something like?

MY_PRODUCT_GIT_SERVER ?= "git://please.set.me/"

Or if you're feeling really kind to throw an error if the variable isn't set correctly:

MY_PRODUCT_GIT_SERVER ?= ""
python() {
    if not d.getVar("MY_PRODUCT_GIT_SERVER", True):
        bb.error("Please set MY_PRODUCT_GIT_SERVER")
}

The recipes then do:

SRC_URI = "${MY_PRODUCT_GIT_SERVER}/project"

Then you can do this in your local.conf:

MY_PRODUCT_GIT_SERVER="git://internal.server"

And the customers do the same, but with the right URL.

Ross Burton
  • 3,516
  • 13
  • 12