From c8d1bd1f4bec5919ad0f65ba069b14fcaadffcbc Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Tue, 23 May 2023 23:02:48 +0200 Subject: [PATCH] phase1,phase2: s/master/main for phase{1,2} MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit More and more projects are switching their repositories to use the 'main' branch instead of the 'master' branch. This also includes many Linux upstream trees as well. Some trees are even removing their 'master' branches already. I think this is becoming more and more mainstream and expected of projects, so we should do the same. References: https://openwrt.org/voting/2023-02-27 Signed-off-by: Paul Spooren Signed-off-by: Petr Å tetiar [commit facelift] --- docker/config.ini | 2 +- phase1/config.ini.example | 4 ++-- phase1/master.cfg | 6 +++--- phase2/config.ini.example | 2 +- phase2/master.cfg | 4 ++-- scripts/makebranch.sh | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docker/config.ini b/docker/config.ini index 25543f2..6278d3d 100644 --- a/docker/config.ini +++ b/docker/config.ini @@ -27,7 +27,7 @@ persistent = false [repo] url = https://git.openwrt.org/openwrt/openwrt.git -branch = master +branch = main [rsync] binary_url = upload@rsync-server::data/bin diff --git a/phase1/config.ini.example b/phase1/config.ini.example index d7262bd..267184f 100644 --- a/phase1/config.ini.example +++ b/phase1/config.ini.example @@ -49,8 +49,8 @@ config_seed = # Seed configuration [branch openwrt-22.03] name = openwrt-22.03 -[branch master] -name = master +[branch main] +name = main [worker 1] phase = 1 diff --git a/phase1/master.cfg b/phase1/master.cfg index e29bb9d..4e7cbc1 100644 --- a/phase1/master.cfg +++ b/phase1/master.cfg @@ -550,7 +550,7 @@ c["schedulers"].append( def IsNoMasterBuild(step): - return step.getProperty("branch") != "master" + return step.getProperty("branch") != "main" def IsUsignEnabled(step): @@ -577,7 +577,7 @@ def GetBaseVersion(branch): if re.match(r"^[^-]+-[0-9]+\.[0-9]+$", branch): return branch.split("-")[1] else: - return "master" + return "main" @properties.renderer @@ -588,7 +588,7 @@ def GetVersionPrefix(props): r"^v[0-9]+\.[0-9]+\.[0-9]+(?:-rc[0-9]+)?$", props["tag"] ): return "%s/" % props["tag"][1:] - elif basever != "master": + elif basever != "main": return "%s-SNAPSHOT/" % basever else: return "" diff --git a/phase2/config.ini.example b/phase2/config.ini.example index b7e75d3..ec0e6db 100644 --- a/phase2/config.ini.example +++ b/phase2/config.ini.example @@ -20,7 +20,7 @@ git_ssh_key = -----BEGIN RSA PRIVATE KEY----- [repo] url = https://git.openwrt.org/openwrt/openwrt.git -branch = master +branch = main [rsync] binary_url = user@example.org::upload-packages diff --git a/phase2/master.cfg b/phase2/master.cfg index 23a67f7..c399c66 100644 --- a/phase2/master.cfg +++ b/phase2/master.cfg @@ -129,7 +129,7 @@ if ini.has_option("rsync", "sdk_pattern"): rsync_defopts = ["-4", "-v", "--timeout=120"] repo_url = ini.get("repo", "url") -repo_branch = "master" +repo_branch = "main" if ini.has_option("repo", "branch"): repo_branch = ini.get("repo", "branch") @@ -177,7 +177,7 @@ def parse_feed_entry(line): if parts[0].startswith("src-git"): feeds.append(parts) url = parts[2].strip().split(';') - branch = url[1] if len(url) > 1 else 'master' + branch = url[1] if len(url) > 1 else 'main' feedbranches[url[0]] = branch c['change_source'].append(GitPoller(url[0], branch=branch, workdir='%s/%s.git' %(os.getcwd(), parts[1]), pollinterval=300)) diff --git a/scripts/makebranch.sh b/scripts/makebranch.sh index e92c04c..355014c 100755 --- a/scripts/makebranch.sh +++ b/scripts/makebranch.sh @@ -77,8 +77,8 @@ githash="$(git log --format=%h -1)" prev_branch="$(git symbolic-ref -q HEAD)" -if [ "$prev_branch" != "refs/heads/master" ]; then - echo "Expecting current branch name to be \"master\"," \ +if [ "$prev_branch" != "refs/heads/main" ]; then + echo "Expecting current branch name to be \"main\"," \ "but it is \"${prev_branch#refs/heads/}\" - aborting." exit 1 @@ -101,7 +101,7 @@ while read type name url; do if [ -z "$ref" ]; then echo "WARNING: Feed \"$name\" provides no" \ - "\"lede-$version\" branch - using master!" >&2 + "\"lede-$version\" branch - using main!" >&2 else url="$url;lede-$version" fi -- 2.30.2