]> gcc.gnu.org Git - gcc.git/commitdiff
maintainer-scripts: Speed up git clone in gcc_release
authorJakub Jelinek <jakub@redhat.com>
Thu, 27 Feb 2020 08:38:12 +0000 (09:38 +0100)
committerJakub Jelinek <jakub@redhat.com>
Thu, 27 Feb 2020 08:38:12 +0000 (09:38 +0100)
When doing the 8.4-rc1, I've noticed (probably also because of the dying
disk on sourceware) that git clone is extremely slow, and furthermore when
all of us have some local snapshots, it is a waste of resources to download
everything again.  Especially for the -f runs when we'll need to wait until
git tag -s asks us for a gpg password interactively.

The following patch adds an option through which one can point the script
at a local gcc .git directory from which it can --dissociate --reference ...
during cloning to speed it up.

2020-02-27  Jakub Jelinek  <jakub@redhat.com>

* gcc_release: Add support for -b local-git-repo argument.

maintainer-scripts/ChangeLog
maintainer-scripts/gcc_release

index 4fca86975e4ad92587ce88003d9d83f4416e3c2a..4efd47569d438af82e724b930cbf39723f2e5577 100644 (file)
@@ -1,3 +1,7 @@
+2020-02-27  Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc_release: Add support for -b local-git-repo argument.
+
 2020-01-13  Jonathan Wakely  <jwakely@redhat.com>
 
        * update_web_docs_libstdcxx_git: New file.
index 8be870154f7fb50c373de632b705af90116f0865..74cce1af18d3f341c291d939a914150feab69ae7 100755 (executable)
@@ -9,7 +9,7 @@
 # Contents:
 #   Script to create a GCC release.
 #
-# Copyright (c) 2001-2018 Free Software Foundation.
+# Copyright (c) 2001-2020 Free Software Foundation.
 #
 # This file is part of GCC.
 #
@@ -78,6 +78,7 @@ Options:
   -p previous-tarball  Location of a previous tarball (to generate diff files).
   -t tag               Tag to mark the release in git.
   -u username          Username for upload operations.
+  -b local-git-repo    Local git repository to speed up cloning.
 EOF
     exit 1
 }
@@ -103,8 +104,14 @@ build_sources() {
   changedir "${WORKING_DIRECTORY}"
 
   # Check out the sources.
-  ${GIT} clone -q -b "${GITBRANCH}" "${GITROOT}" "`basename ${SOURCE_DIRECTORY}`" || \
-      error "Could not check out release sources"
+  if [ -n "${GIT_REFERENCE}" ]; then
+    ${GIT} clone -q --dissociate --reference "${GIT_REFERENCE}" \
+                -b "${GITBRANCH}" "${GITROOT}" "`basename ${SOURCE_DIRECTORY}`" || \
+        error "Could not check out release sources"
+  else
+    ${GIT} clone -q -b "${GITBRANCH}" "${GITROOT}" "`basename ${SOURCE_DIRECTORY}`" || \
+        error "Could not check out release sources"
+  fi
 
   # If this is a final release, make sure that the ChangeLogs
   # and version strings are updated.
@@ -567,6 +574,9 @@ TAG=""
 # The old tarballs from which to generate diffs.
 OLD_TARS=""
 
+# Local gcc git checkout to speed up git cloning.
+GIT_REFERENCE=""
+
 # The directory that will be used to construct the release.  The
 # release itself will be placed in a subdirectory of this directory.
 DESTINATION=${HOME}
@@ -613,7 +623,7 @@ TAR="${TAR:-tar}"
 ########################################################################
 
 # Parse the options.
-while getopts "d:fr:u:t:p:s:l" ARG; do
+while getopts "d:fr:u:t:p:s:lb:" ARG; do
     case $ARG in
     d)    DESTINATION="${OPTARG}";;
     r)    RELEASE="${OPTARG}";;
@@ -631,6 +641,7 @@ while getopts "d:fr:u:t:p:s:l" ARG; do
           if [ ! -f ${OPTARG} ]; then
            error "-p argument must name a tarball"
          fi;;
+    b)    GIT_REFERENCE="${OPTARG}";;
     \?)   usage;;
     esac
 done
This page took 0.068013 seconds and 5 git commands to generate.