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

Add delete list for revendor.py #360

Merged
merged 1 commit into from
Dec 14, 2018
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
22 changes: 19 additions & 3 deletions hack/revendor.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,21 +223,27 @@ def check_antipackage():
},
{
"package": "cloud.google.com/go",
"version": "v0.2.0"
"version": "v0.23.0"
},
{
"package": "github.com/spf13/afero",
"version": "v1.1.2"
},
{
"package": "github.com/appscode/osm",
"version": "0.9.0"
"version": "0.9.1"
},
{
"package": "github.com/kubepack/onessl",
"version": "0.9.0"
}
]
DELETE_LIST=[
"github.com/openshift/api",
"github.com/openshift/client-go",
"github.com/openshift/origin",
"github.com/appscode/ocutil"
]


def die(status):
Expand Down Expand Up @@ -277,6 +283,10 @@ def git_requires_commit(cwd=libbuild.REPO_ROOT):
return Counter(changed_files) != Counter(['glide.lock'])


def sortDep(val):
return val['package']


def glide_mod(glide_config, changes):
for dep in glide_config['import']:
if dep['package'] in changes:
Expand All @@ -295,6 +305,12 @@ def glide_mod(glide_config, changes):
if dep['package'] == x['package']:
glide_config['import'][idx] = x
break
for package in DELETE_LIST:
for idx, dep in enumerate(glide_config['import']):
if dep['package'] == package:
del glide_config['import'][idx]
break
glide_config['import'].sort(key=sortDep)


def glide_write(f, glide_config):
Expand Down Expand Up @@ -334,7 +350,7 @@ def revendor_repo(self, repo_name):
call('glide slow', cwd=repo)
if git_requires_commit(cwd=repo):
call('git add --all', cwd=repo)
call('git commit -s -a -m "Revendor api"', cwd=repo, eoe=False)
call('git commit -s -a -m "Revendor dependencies"', cwd=repo, eoe=False)
call('git push origin {0}'.format(revendor_branch), cwd=repo)
else:
call('git reset HEAD --hard', cwd=repo)
Expand Down