Skip to content

Commit

Permalink
Add delete list for revendor.py
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha committed Dec 14, 2018
1 parent 3c3ef9d commit 6eb5676
Showing 1 changed file with 19 additions and 3 deletions.
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

0 comments on commit 6eb5676

Please sign in to comment.