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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions hack/.vendor-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,24 +88,18 @@ clean() {

echo -n 'collecting import graph, '
local IFS=$'\n'
packages+=( $(
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[@]}"
done
done | grep -E "^${PROJECT}" | grep -vE "^${PROJECT}/vendor" | sort -u
) )
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[@]}"
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.

go list -e -tags "$buildTags" -f '{{join .Deps "\n"}}' "${packages[@]} ${testImports[@]}"
done
done | grep -vE '^${PROJECT}' | sort -u
done | grep -vE "^${PROJECT}" | sort -u
) )
imports=( $(go list -e -f '{{if not .Standard}}{{.ImportPath}}{{end}}' "${imports[@]}") )
unset IFS
Expand Down