On Thu, Jan 9, 2014 at 11:06 AM, Michael Olbrich <m.olbrich@pengutronix.de> wrote:
On Thu, Jan 09, 2014 at 10:23:58AM -0500, Jon Ringle wrote:> One issue that I ran across with this is that I have:
> PTXCONF_SETUP_PTXMIRROR_ONLY=y
> PTXCONF_SETUP_PTXMIRROR="http://opensource/pool/"
>
> Where opensource is an internal server that keeps all tar balls used to
> build. I'm paranoid that someday a upstream tar ball won't be available and
> would cause a build break if someone tried to build and they didn't have
> that tar ball in ${PTXCONF_SETUP_SRCDIR}
>
> But for my purposes, if I wanted to use the git URL in a rule file I'd want
> it to use the URL as is. But it rewrites it trying to use
> ${PTXCONF_SETUP_PTXMIRROR} instead in scripts/lib/ptxd_make_get.sh:295
>
> Is there away to work around this?

put your git repositories in the mirror:
FOO_URL := http://opensource/pool/foo.git;tag=bar

Unfortunately, I can't do that. The opensource server is under IT control and they've locked it down so that I can only write to it using scp or sftp and have no ssh shell access to it.

The mechanism whitelists any URL starting with ${PTXCONF_SETUP_PTXMIRROR}

Would the following approach work:

1. In ptxdist/rules/post/ptxd_make_world_common.make add to world/env/impl:
    pkg_url_safe="$(call ptx/escape,$($(1)_URL_SAFE))"

2. In ptxdist/scripts/lib/ptxd_make_get.sh function ptxd_make_get
change all occurances of:
    if [ -z "${PTXCONF_SETUP_PTXMIRROR_ONLY}" ]; then
with something like:
    if [ -z "${PTXCONF_SETUP_PTXMIRROR_ONLY}" -o -n "${pkg_url_safe}" ]; then

Then in the rule file you can do:
FOO_URL_SAFE := y

So that you can whitelist a specific URL if PTXCONF_SETUP_PTXMIRROR_ONLY is set