mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
Update build-many-glibcs.py for GCC move to git.
This patch updates build-many-glibcs.py for the move of GCC to git, teaching it to do the initial checkout from git, to replace an SVN checkout with a git one if --replace-sources is used, and to get the commit identifier from a git checkout after updating it.
This commit is contained in:
@@ -803,12 +803,10 @@ class Context(object):
|
|||||||
return self.git_checkout(component, git_url, git_branch, update)
|
return self.git_checkout(component, git_url, git_branch, update)
|
||||||
elif component == 'gcc':
|
elif component == 'gcc':
|
||||||
if version == 'mainline':
|
if version == 'mainline':
|
||||||
branch = 'trunk'
|
branch = 'master'
|
||||||
else:
|
else:
|
||||||
trans = str.maketrans({'.': '_'})
|
branch = 'releases/gcc-%s' % version
|
||||||
branch = 'branches/gcc-%s-branch' % version.translate(trans)
|
return self.gcc_checkout(branch, update)
|
||||||
svn_url = 'svn://gcc.gnu.org/svn/gcc/%s' % branch
|
|
||||||
return self.gcc_checkout(svn_url, update)
|
|
||||||
elif component == 'glibc':
|
elif component == 'glibc':
|
||||||
git_url = 'git://sourceware.org/git/glibc.git'
|
git_url = 'git://sourceware.org/git/glibc.git'
|
||||||
if version == 'mainline':
|
if version == 'mainline':
|
||||||
@@ -884,14 +882,23 @@ class Context(object):
|
|||||||
to_touch = os.path.join(dirpath, f)
|
to_touch = os.path.join(dirpath, f)
|
||||||
subprocess.run(['touch', to_touch], check=True)
|
subprocess.run(['touch', to_touch], check=True)
|
||||||
|
|
||||||
def gcc_checkout(self, svn_url, update):
|
def gcc_checkout(self, branch, update):
|
||||||
"""Check out GCC from SVN. Return the revision number."""
|
"""Check out GCC from git. Return the commit identifier."""
|
||||||
|
if os.access(os.path.join(self.component_srcdir('gcc'), '.svn'),
|
||||||
|
os.F_OK):
|
||||||
|
if not self.replace_sources:
|
||||||
|
print('error: GCC has moved from SVN to git, use '
|
||||||
|
'--replace-sources to check out again')
|
||||||
|
exit(1)
|
||||||
|
shutil.rmtree(self.component_srcdir('gcc'))
|
||||||
|
update = False
|
||||||
if not update:
|
if not update:
|
||||||
subprocess.run(['svn', 'co', '-q', svn_url,
|
self.git_checkout('gcc', 'git://gcc.gnu.org/git/gcc.git',
|
||||||
self.component_srcdir('gcc')], check=True)
|
branch, update)
|
||||||
subprocess.run(['contrib/gcc_update', '--silent'],
|
subprocess.run(['contrib/gcc_update', '--silent'],
|
||||||
cwd=self.component_srcdir('gcc'), check=True)
|
cwd=self.component_srcdir('gcc'), check=True)
|
||||||
r = subprocess.run(['svnversion', self.component_srcdir('gcc')],
|
r = subprocess.run(['git', 'rev-parse', 'HEAD'],
|
||||||
|
cwd=self.component_srcdir('gcc'),
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
check=True, universal_newlines=True).stdout
|
check=True, universal_newlines=True).stdout
|
||||||
return r.rstrip()
|
return r.rstrip()
|
||||||
|
Reference in New Issue
Block a user