Skip to content

Commit

Permalink
phase1,phase2: s/master/main for phase{1,2}
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Petr Štetiar <[email protected]> [commit facelift]
  • Loading branch information
aparcar authored and ynezz committed Apr 13, 2024
1 parent 7d371c4 commit c8d1bd1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docker/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions phase1/config.ini.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions phase1/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ c["schedulers"].append(


def IsNoMasterBuild(step):
return step.getProperty("branch") != "master"
return step.getProperty("branch") != "main"


def IsUsignEnabled(step):
Expand All @@ -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
Expand All @@ -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 ""
Expand Down
2 changes: 1 addition & 1 deletion phase2/config.ini.example
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [email protected]::upload-packages
Expand Down
4 changes: 2 additions & 2 deletions phase2/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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))

Expand Down
6 changes: 3 additions & 3 deletions scripts/makebranch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit c8d1bd1

Please sign in to comment.