Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
484cbd04
Commit
484cbd04
authored
Feb 08, 2018
by
GregF
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade update_glslang_sources.py to work with gitlab branch
--site gitlab must be added to command for gitlab capability. Default is github.
parent
4ee5193b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
update_glslang_sources.py
update_glslang_sources.py
+13
-9
No files found.
update_glslang_sources.py
View file @
484cbd04
...
...
@@ -28,8 +28,12 @@ import sys
KNOWN_GOOD_FILE
=
'known_good.json'
SITE_TO_KNOWN_GOOD_FILE
=
{
'github'
:
'known_good.json'
,
'gitlab'
:
'known_good_khr.json'
}
# Maps a site name to its hostname.
SITE_TO_HOST
=
{
'github'
:
'github.com'
}
SITE_TO_HOST
=
{
'github'
:
'https://github.com/'
,
'gitlab'
:
'git@gitlab.khronos.org:'
}
VERBOSE
=
True
...
...
@@ -82,14 +86,11 @@ class GoodCommit(object):
self
.
subdir
=
json
[
'subdir'
]
if
(
'subdir'
in
json
)
else
'.'
self
.
commit
=
json
[
'commit'
]
def
GetUrl
(
self
,
style
=
'https'
):
def
GetUrl
(
self
):
"""Returns the URL for the repository."""
host
=
SITE_TO_HOST
[
self
.
site
]
sep
=
'/'
if
(
style
is
'https'
)
else
':'
return
'{style}://{host}{sep}{subrepo}'
.
format
(
style
=
style
,
return
'{host}{subrepo}'
.
format
(
host
=
host
,
sep
=
sep
,
subrepo
=
self
.
subrepo
)
def
AddRemote
(
self
):
...
...
@@ -120,9 +121,10 @@ class GoodCommit(object):
command_output
([
'git'
,
'checkout'
,
self
.
commit
],
self
.
subdir
)
def
GetGoodCommits
():
def
GetGoodCommits
(
site
):
"""Returns the latest list of GoodCommit objects."""
with
open
(
KNOWN_GOOD_FILE
)
as
known_good
:
known_good_file
=
SITE_TO_KNOWN_GOOD_FILE
[
site
]
with
open
(
known_good_file
)
as
known_good
:
return
[
GoodCommit
(
c
)
for
c
in
json
.
loads
(
known_good
.
read
())[
'commits'
]]
...
...
@@ -130,10 +132,12 @@ def main():
parser
=
argparse
.
ArgumentParser
(
description
=
'Get Glslang source dependencies at a known-good commit'
)
parser
.
add_argument
(
'--dir'
,
dest
=
'dir'
,
default
=
'.'
,
help
=
"Set target directory for Glslang source root. Default is
\'
.
\'
."
)
parser
.
add_argument
(
'--site'
,
dest
=
'site'
,
default
=
'github'
,
help
=
"Set git server site. Default is github."
)
args
=
parser
.
parse_args
()
commits
=
GetGoodCommits
()
commits
=
GetGoodCommits
(
args
.
site
)
distutils
.
dir_util
.
mkpath
(
args
.
dir
)
print
(
'Change directory to {d}'
.
format
(
d
=
args
.
dir
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment