From: Joseph Myers <joseph@codesourcery.com>
To: <libc-alpha@sourceware.org>
Subject: Update build-many-glibcs.py for GCC move to git [committed]
Date: Mon, 13 Jan 2020 16:33:47 +0000 [thread overview]
Message-ID: <alpine.DEB.2.21.2001131633210.11452@digraph.polyomino.org.uk> (raw)
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.
Committed.
diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 1bd7f24d7d..90b76caa93 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -803,12 +803,10 @@ class Context(object):
return self.git_checkout(component, git_url, git_branch, update)
elif component == 'gcc':
if version == 'mainline':
- branch = 'trunk'
+ branch = 'master'
else:
- trans = str.maketrans({'.': '_'})
- branch = 'branches/gcc-%s-branch' % version.translate(trans)
- svn_url = 'svn://gcc.gnu.org/svn/gcc/%s' % branch
- return self.gcc_checkout(svn_url, update)
+ branch = 'releases/gcc-%s' % version
+ return self.gcc_checkout(branch, update)
elif component == 'glibc':
git_url = 'git://sourceware.org/git/glibc.git'
if version == 'mainline':
@@ -884,14 +882,23 @@ class Context(object):
to_touch = os.path.join(dirpath, f)
subprocess.run(['touch', to_touch], check=True)
- def gcc_checkout(self, svn_url, update):
- """Check out GCC from SVN. Return the revision number."""
+ def gcc_checkout(self, branch, update):
+ """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:
- subprocess.run(['svn', 'co', '-q', svn_url,
- self.component_srcdir('gcc')], check=True)
+ self.git_checkout('gcc', 'git://gcc.gnu.org/git/gcc.git',
+ branch, update)
subprocess.run(['contrib/gcc_update', '--silent'],
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,
check=True, universal_newlines=True).stdout
return r.rstrip()
--
Joseph S. Myers
joseph@codesourcery.com
reply other threads:[~2020-01-13 16:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.21.2001131633210.11452@digraph.polyomino.org.uk \
--to=joseph@codesourcery.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).