On Fri, Jan 10, 2014 at 10:37 AM, Michael Olbrich <m.olbrich@pengutronix.de> wrote:
On Thu, Jan 09, 2014 at 11:37:15AM -0500, Jon Ringle wrote:
> 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

Hmmm, this is not so nice. How about making PTXCONF_SETUP_PTXMIRROR a list?
Then you can add http://opensource/pool/ and your git server to the
'whitelist'.

The approach you are proposing has several issue for which I don't have the necessary bash chops to figure out how to tackle:

1. In the 1st while loop in ptxd_make_get(), I don't know how to get the case to accept multiple array values for ${PTXCONF_SETUP_PTXMIRROR}:
        case "${url}" in
        ${PTXCONF_SETUP_PTXMIRROR}/*/*)
            # keep original URL, for stuff like glibc
            argv[${#argv[@]}]="${url}"
            mrd=true
            ;;
        ${PTXCONF_SETUP_PTXMIRROR}/*)
            # if mirror is given us to download, add it, but only once
            if ! ${mrd}; then
                argv[${#argv[@]}]="${url}"
                mrd=true
            fi
            ;;

Replacing with ${PTXCONF_SETUP_PTXMIRROR[@]} clear won't help as the various options aren't separate by PIPE character |.

2. Where ptxmirror_url gets assigned, it would also need to be an array too
3. And then also where ${ptxmirror_url} gets added to the argv array

Quite frankly, I really like my approach much better... and it does not preclude you from implementing your solution as well.
If I created and tested a patch that allows FOO_URL_SAFE, would you consider it for inclusion to ptxdist?

Thanks,
Jon