Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup vendoring of test deps #16294

Merged
merged 1 commit into from Sep 16, 2015
Merged

Conversation

jessfraz
Copy link
Contributor

fixes the problems for #16229

ping @tianon @icecrime

Signed-off-by: Jessica Frazelle <acidburn@docker.com>
pkgs=( $(go list -e -tags "$buildTags" -f '{{join .Deps "\n"}}' "${packages[@]}" | grep -E "^${PROJECT}" | grep -vE "^${PROJECT}/vendor" | sort -u) )
pkgs+=( ${packages[@]} )
testImports=( $(go list -e -tags "$buildTags" -f '{{join .TestImports "\n"}}' "${pkgs[@]}" | sort -u) )
printf '%s\n' "${testImports[@]}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this print here on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes so that those thinngs are in the array

On Tue, Sep 15, 2015 at 4:22 PM, David Calavera notifications@github.com
wrote:

In hack/.vendor-helpers.sh
#16294 (comment):

local imports=( $(
    for platform in "${dockerPlatforms[@]}"; do
        export GOOS="${platform%/*}";
        export GOARCH="${platform##*/}";
        for buildTags in "${buildTagCombos[@]}"; do
  •           go list -e -tags "$buildTags" -f '{{join .Deps "\n"}}' "${packages[@]}"
    
  •           go list -e -tags "$buildTags" -f '{{join .TestImports "\n"}}' "${packages[@]}"
    
  •           pkgs=( $(go list -e -tags "$buildTags" -f '{{join .Deps "\n"}}' "${packages[@]}" | grep -E "^${PROJECT}" | grep -vE "^${PROJECT}/vendor" | sort -u) )
    
  •           pkgs+=( ${packages[@]} )
    
  •           testImports=( $(go list -e -tags "$buildTags" -f '{{join .TestImports "\n"}}' "${pkgs[@]}" | sort -u) )
    
  •           printf '%s\n' "${testImports[@]}"
    

is this print here on purpose?


Reply to this email directly or view it on GitHub
https://github.com/docker/docker/pull/16294/files#r39578200.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this only print the first item of the array as-is? Doesn't it need to be [*] to print all of them with just %s?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm it worked for me locally :/

On Wed, Sep 16, 2015 at 3:48 PM, Tianon Gravi notifications@github.com
wrote:

In hack/.vendor-helpers.sh
#16294 (comment):

local imports=( $(
    for platform in "${dockerPlatforms[@]}"; do
        export GOOS="${platform%/*}";
        export GOARCH="${platform##*/}";
        for buildTags in "${buildTagCombos[@]}"; do
  •           go list -e -tags "$buildTags" -f '{{join .Deps "\n"}}' "${packages[@]}"
    
  •           go list -e -tags "$buildTags" -f '{{join .TestImports "\n"}}' "${packages[@]}"
    
  •           pkgs=( $(go list -e -tags "$buildTags" -f '{{join .Deps "\n"}}' "${packages[@]}" | grep -E "^${PROJECT}" | grep -vE "^${PROJECT}/vendor" | sort -u) )
    
  •           pkgs+=( ${packages[@]} )
    
  •           testImports=( $(go list -e -tags "$buildTags" -f '{{join .TestImports "\n"}}' "${pkgs[@]}" | sort -u) )
    
  •           printf '%s\n' "${testImports[@]}"
    

Won't this only print the first item of the array as-is? Doesn't it need
to be [*] to print all of them with just %s?


Reply to this email directly or view it on GitHub
https://github.com/docker/docker/pull/16294/files#r39694927.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh interesting, printf appears to just "handle" this for us:

$ printf '%s\n' a b c
a
b
c

👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You had me worried!

On Wednesday, September 16, 2015, Tianon Gravi notifications@github.com
wrote:

In hack/.vendor-helpers.sh
#16294 (comment):

local imports=( $(
    for platform in "${dockerPlatforms[@]}"; do
        export GOOS="${platform%/*}";
        export GOARCH="${platform##*/}";
        for buildTags in "${buildTagCombos[@]}"; do
  •           go list -e -tags "$buildTags" -f '{{join .Deps "\n"}}' "${packages[@]}"
    
  •           go list -e -tags "$buildTags" -f '{{join .TestImports "\n"}}' "${packages[@]}"
    
  •           pkgs=( $(go list -e -tags "$buildTags" -f '{{join .Deps "\n"}}' "${packages[@]}" | grep -E "^${PROJECT}" | grep -vE "^${PROJECT}/vendor" | sort -u) )
    
  •           pkgs+=( ${packages[@]} )
    
  •           testImports=( $(go list -e -tags "$buildTags" -f '{{join .TestImports "\n"}}' "${pkgs[@]}" | sort -u) )
    
  •           printf '%s\n' "${testImports[@]}"
    

Oh interesting, printf appears to just "handle" this for us:

$ printf '%s\n' a b cabc

[image: 👍]


Reply to this email directly or view it on GitHub
https://github.com/docker/docker/pull/16294/files#r39696176.

@calavera
Copy link
Contributor

LGTM

1 similar comment
@icecrime
Copy link
Contributor

LGTM

icecrime pushed a commit that referenced this pull request Sep 16, 2015
cleanup vendoring of test deps
@icecrime icecrime merged commit 0ac28f5 into moby:master Sep 16, 2015
@jessfraz jessfraz deleted the cleanup-vendor branch September 16, 2015 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants