public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] maintainer-scripts: Adding GIT_CUSTOMREPO parameters to gcc_release script.
@ 2022-04-12 19:32 Navid Rahimi
  2022-04-19 15:37 ` Joseph Myers
  0 siblings, 1 reply; 2+ messages in thread
From: Navid Rahimi @ 2022-04-12 19:32 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 497 bytes --]

Hi GCC community,

I need to have ability to point to custom repository in gcc_release script. This small patch 1) does add a parameter "-g" to add custom repository to gcc_release , 2) does add a line to download prerequisites before building GCC (download_prerequisites) which is not present in gcc_release right now.

I tested the script on x86_64 Linux. 

    Adding GIT_CUSTOMREPO parameters to gcc_release script.
            * maintainer-scripts/gcc_release


Best wishes,
Navid.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Adding-GIT_CUSTOMREPO-parameters-to-gcc_release-scri.patch --]
[-- Type: text/x-patch; name="0001-Adding-GIT_CUSTOMREPO-parameters-to-gcc_release-scri.patch", Size: 2909 bytes --]

From 730fef2cfd589b58e5f16ae765518754af3766b8 Mon Sep 17 00:00:00 2001
From: Navid Rahimi <navidrahimi@microsoft.com>
Date: Wed, 30 Mar 2022 10:34:24 -0700
Subject: [PATCH] Adding GIT_CUSTOMREPO parameters to gcc_release script. 
 * maintainer-scripts/gcc_release

---
 maintainer-scripts/gcc_release | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/maintainer-scripts/gcc_release b/maintainer-scripts/gcc_release
index 2456908d716..20ded30723d 100755
--- a/maintainer-scripts/gcc_release
+++ b/maintainer-scripts/gcc_release
@@ -79,6 +79,7 @@ Options:
   -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.
+  -g custom-repo-link  Link to custom git repository.
 EOF
     exit 1
 }
@@ -113,9 +114,9 @@ build_sources() {
         error "Could not check out release sources"
   fi
 
-  # If this is a final release, make sure that the ChangeLogs
+  # If this is a final release and it is not custom repository, make sure that the ChangeLogs
   # and version strings are updated.
-  if [ ${FINAL} -ne 0 ]; then
+  if [ ${FINAL} -ne 0 ] && [ -z $GIT_CUSTOMREPO ]; then
     inform "Updating ChangeLogs and version files"
 
     grep -q "gcc-${RELEASE_MAJOR}/index.html gcc-${RELEASE_MAJOR}/changes.html" \
@@ -266,6 +267,7 @@ EOF
 	'' | 0* | *[!0-9]*) num_cpus=1;;
       esac
     fi
+    contrib/download_prerequisites
     contrib/gcc_build -d ${SOURCE_DIRECTORY} -o ${OBJECT_DIRECTORY} \
       -c "--enable-generated-files-in-srcdir --disable-multilib" \
       -m "-j$num_cpus" build || \
@@ -538,7 +540,8 @@ GIT_SERVER="gcc.gnu.org"
 GIT_REPOSITORY="/git/gcc.git"
 # The username to use when connecting to the server.
 GIT_USERNAME="${USER}"
-
+# Link to custom repo.
+GIT_CUSTOMREPO=""
 # The machine to which files will be uploaded.
 GCC_HOSTNAME="gcc.gnu.org"
 # The name of the account on the machine to which files are uploaded.
@@ -623,13 +626,14 @@ TAR="${TAR:-tar}"
 ########################################################################
 
 # Parse the options.
-while getopts "d:fr:u:t:p:s:lb:" ARG; do
+while getopts "d:fr:u:t:p:g:s:lb" ARG; do
     case $ARG in
     d)    DESTINATION="${OPTARG}";;
     r)    RELEASE="${OPTARG}";;
     t)    TAG="${OPTARG}";;
     u)    GIT_USERNAME="${OPTARG}";;
     f)    FINAL=1;;
+    g)    GIT_CUSTOMREPO="${OPTARG}";;
     s)    SNAPSHOT=1
           BRANCH=${OPTARG%:*}
           GITBRANCH=${OPTARG#*:}
@@ -728,7 +732,9 @@ WORKING_DIRECTORY="${DESTINATION}/gcc-${RELEASE}"
 SOURCE_DIRECTORY="${WORKING_DIRECTORY}/gcc-${RELEASE}"
 
 # Set up GITROOT.
-if [ $LOCAL -eq 0 ]; then
+if [ -n $GIT_CUSTOMREPO ]; then
+    GITROOT=${GIT_CUSTOMREPO}
+elif [ $LOCAL -eq 0 ]; then
     GITROOT="git+ssh://${GIT_USERNAME}@${GIT_SERVER}${GIT_REPOSITORY}"
 else
     GITROOT="/git/gcc.git"
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] maintainer-scripts: Adding GIT_CUSTOMREPO parameters to gcc_release script.
  2022-04-12 19:32 [PATCH] maintainer-scripts: Adding GIT_CUSTOMREPO parameters to gcc_release script Navid Rahimi
@ 2022-04-19 15:37 ` Joseph Myers
  0 siblings, 0 replies; 2+ messages in thread
From: Joseph Myers @ 2022-04-19 15:37 UTC (permalink / raw)
  To: Navid Rahimi; +Cc: gcc-patches

On Tue, 12 Apr 2022, Navid Rahimi via Gcc-patches wrote:

> Hi GCC community,
> 
> I need to have ability to point to custom repository in gcc_release 
> script. This small patch 1) does add a parameter "-g" to add custom 

The purpose of this script is for building official GCC releases, release 
candidates and snapshots for the GCC project; not anything else (although 
it may sometimes be useful to have functionality that's only relevant for 
testing changes to the script rather than as part of actual release, 
release candidate or snapshot builds).  Why would a custom repository be 
relevant for such releases, release candidates or snapshots built for the 
GCC project?

In general, *everything* in the maintainer-scripts/ directory only needs 
to work for the specific limited purposes for which it's run by the 
gccadmin account on gcc.gnu.org; unlike contrib/, it's not expected or 
intended to be more generally useful.

> repository to gcc_release , 2) does add a line to download prerequisites 
> before building GCC (download_prerequisites) which is not present in 
> gcc_release right now.

Official GCC releases, release candidates and snapshots are not meant to 
include those prerequisities in the source directory, so calling that 
script (which puts them there) seems incorrect to me; the script is for 
users to call after downloading such a release, release candidate or 
snapshot, if they don't have the prerequisites built or installed in some 
other way.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-19 15:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-12 19:32 [PATCH] maintainer-scripts: Adding GIT_CUSTOMREPO parameters to gcc_release script Navid Rahimi
2022-04-19 15:37 ` Joseph Myers

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).