Skip to content

Commit

Permalink
Remove broken symlinks when updating deps (#2842)
Browse files Browse the repository at this point in the history
* remove broken symlinks when updating deps

fix: #2778
Change-Id: Id249c00fa8a506fbbd1d21956b8bfd62c12a9958

* Remove invalid symlinks by running update-deps.sh

* run update-codegen.sh as well
run update-codegen.sh as well
run update-codegen.sh as well
run update-codegen.sh as well
run update-codegen.sh as well
run update-codegen.sh as well
run update-codegen.sh as well
run update-codegen.sh as well
run update-codegen.sh as well

* manually delete vendor/github.com/prometheus/procfs/fixtures/26231/exe

...it is a symlink to /usr/bin/vim ...

* improve on deleting invalid symlinks

* fix typo and minor improvement to make it work on mac/linux

* take reviewer's approach for symlink cleanup

* remove verbose logging msg

* resolve reviewer's comments
  • Loading branch information
erain authored and knative-prow-robot committed Jan 14, 2019
1 parent 63ccfcd commit 9a74c67
Show file tree
Hide file tree
Showing 40 changed files with 23 additions and 39 deletions.
23 changes: 23 additions & 0 deletions hack/update-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@ set -o pipefail

source $(dirname $0)/../vendor/github.com/knative/test-infra/scripts/library.sh

# Remove symlinks in /vendor that are broken or lead outside the repo.
function remove_broken_symlinks() {
for link in $(find ./vendor -type l); do
# Remove broken symlinks
if [[ ! -e ${link} ]]; then
unlink ${link}
continue
fi
# Get canonical path to target, remove if outside the repo
local target="$(ls -l ${link})"
target="${target##* -> }"
[[ ${target} == /* ]] || target="./${target}"
target="$(cd `dirname ${link}` && cd ${target%/*} && echo $PWD/${target##*/})"
if [[ ${target} != *github.com/knative/* ]]; then
unlink ${link}
continue
fi
done
}

cd ${REPO_ROOT_DIR}

# Ensure we have everything we need under vendor/
Expand All @@ -35,3 +55,6 @@ update_licenses third_party/VENDOR-LICENSE "./cmd/*"
# cherrypick of #66078. Remove this once that reaches a client version
# we have pulled in.
git apply ${REPO_ROOT_DIR}/hack/66078.patch

# Remove all invalid symlinks under ./vendor
remove_broken_symlinks

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion vendor/github.com/docker/docker/project/CONTRIBUTORS.md

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion vendor/github.com/knative/build/config/300-imagecache.yaml

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion vendor/github.com/prometheus/procfs/fixtures/26231/exe

This file was deleted.

1 change: 0 additions & 1 deletion vendor/github.com/prometheus/procfs/fixtures/26231/fd/0

This file was deleted.

1 change: 0 additions & 1 deletion vendor/github.com/prometheus/procfs/fixtures/26231/fd/1

This file was deleted.

1 change: 0 additions & 1 deletion vendor/github.com/prometheus/procfs/fixtures/26231/fd/10

This file was deleted.

1 change: 0 additions & 1 deletion vendor/github.com/prometheus/procfs/fixtures/26231/fd/2

This file was deleted.

1 change: 0 additions & 1 deletion vendor/github.com/prometheus/procfs/fixtures/26231/fd/3

This file was deleted.

1 change: 0 additions & 1 deletion vendor/github.com/prometheus/procfs/fixtures/26231/ns/mnt

This file was deleted.

1 change: 0 additions & 1 deletion vendor/github.com/prometheus/procfs/fixtures/26231/ns/net

This file was deleted.

1 change: 0 additions & 1 deletion vendor/github.com/prometheus/procfs/fixtures/26232/fd/0

This file was deleted.

1 change: 0 additions & 1 deletion vendor/github.com/prometheus/procfs/fixtures/26232/fd/1

This file was deleted.

1 change: 0 additions & 1 deletion vendor/github.com/prometheus/procfs/fixtures/26232/fd/2

This file was deleted.

1 change: 0 additions & 1 deletion vendor/github.com/prometheus/procfs/fixtures/26232/fd/3

This file was deleted.

1 change: 0 additions & 1 deletion vendor/github.com/prometheus/procfs/fixtures/26232/fd/4

This file was deleted.

1 change: 0 additions & 1 deletion vendor/k8s.io/kubernetes/.bazelrc

This file was deleted.

1 change: 0 additions & 1 deletion vendor/k8s.io/kubernetes/.kazelcfg.json

This file was deleted.

1 change: 0 additions & 1 deletion vendor/k8s.io/kubernetes/BUILD.bazel

This file was deleted.

1 change: 0 additions & 1 deletion vendor/k8s.io/kubernetes/Makefile

This file was deleted.

1 change: 0 additions & 1 deletion vendor/k8s.io/kubernetes/Makefile.generated_files

This file was deleted.

1 change: 0 additions & 1 deletion vendor/k8s.io/kubernetes/WORKSPACE

This file was deleted.

1 change: 0 additions & 1 deletion vendor/k8s.io/kubernetes/cluster/gce/cos

This file was deleted.

1 change: 0 additions & 1 deletion vendor/k8s.io/kubernetes/cluster/gce/custom

This file was deleted.

1 change: 0 additions & 1 deletion vendor/k8s.io/kubernetes/cluster/gce/ubuntu

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 9a74c67

Please sign in to comment.