From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2153) id 511F6398C80D; Thu, 17 Sep 2020 16:49:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 511F6398C80D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1600361387; bh=Y4QLdwAyE8TIuFeMy4xILaruiOx91TuiaVvlGCVCjdI=; h=From:To:Subject:Date:From; b=HLrIW20RGSuZ77rHvR+z0HcyECcSliKZW4sEfeu1ZwWIrdTEsDPjr9U8l6R/Ym3Hv 6kOt+MoxaRcvOwW8dcHnxXUJHdY3v5qH/msYkif3e+zg5hkK4oWgDA2WI/gIvMexbe r5TyizMbPhhAdfD052DWryapFDsrHxkJ/aX0Ye7s= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Jakub Jelinek To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/redhat/heads/gcc-8-branch)] maintainer-scripts: Speed up git clone in gcc_release X-Act-Checkin: gcc X-Git-Author: Jakub Jelinek X-Git-Refname: refs/vendors/redhat/heads/gcc-8-branch X-Git-Oldrev: d0dea6bdcc3d3999a3b4e67f4bf4dc98bc3e5e58 X-Git-Newrev: 46b9cfc48d5225918be180edc082cb52bd521b36 Message-Id: <20200917164947.511F6398C80D@sourceware.org> Date: Thu, 17 Sep 2020 16:49:47 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 16:49:47 -0000 https://gcc.gnu.org/g:46b9cfc48d5225918be180edc082cb52bd521b36 commit 46b9cfc48d5225918be180edc082cb52bd521b36 Author: Jakub Jelinek Date: Thu Feb 27 09:38:12 2020 +0100 maintainer-scripts: Speed up git clone in gcc_release 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 * gcc_release: Add support for -b local-git-repo argument. Diff: --- maintainer-scripts/ChangeLog | 4 ++++ maintainer-scripts/gcc_release | 19 +++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/maintainer-scripts/ChangeLog b/maintainer-scripts/ChangeLog index 234aa502515..229b644a9d7 100644 --- a/maintainer-scripts/ChangeLog +++ b/maintainer-scripts/ChangeLog @@ -1,3 +1,7 @@ +2020-03-04 Jakub Jelinek + + * gcc_release: Add support for -b local-git-repo argument. + 2020-03-04 Release Manager * GCC 8.4.0 released. diff --git a/maintainer-scripts/gcc_release b/maintainer-scripts/gcc_release index 8be870154f7..74cce1af18d 100755 --- a/maintainer-scripts/gcc_release +++ b/maintainer-scripts/gcc_release @@ -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