pmb.helpers.git: parse channels.cfg (MR 1912)

Prepare to base postmarketOS on Alpine stable by parsing the new
channels.cfg file in pmaports.git, that describes which channel
needs which branches and mirror dirs from postmarketOS and Alpine.

Use the information in pmb.helpers.git.get_branches_official() first,
more is coming in follow-up commits.

Read the file from origin/master, so we get the latest fetched version
even if the last checked out master branch is not up-to-date (think of
currently checked out release branch instead of master, master will
never be updated to point to latest origin/master). Allow to override
the file with a new --config-channels parameter.

Related: https://postmarketos.org/channels.cfg
This commit is contained in:
Oliver Smith 2020-02-27 23:04:38 +01:00
parent ed16a9d080
commit c616874443
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
5 changed files with 102 additions and 5 deletions

View file

@ -342,6 +342,9 @@ def arguments():
default=pmb.config.defaults["config"],
help="path to pmbootstrap.cfg file (default in"
" ~/.config/)")
parser.add_argument("--config-channels",
help="path to channels.cfg (which is by default"
" read from pmaports.git, origin/master branch)")
parser.add_argument("-d", "--port-distccd", dest="port_distccd")
parser.add_argument("-mp", "--mirror-pmOS", dest="mirrors_postmarketos",
help="postmarketOS mirror, disable with: -mp='',"