aportupgrade command for upgrading APKBUILDs (!1752)

The gist of this action is upgrading the specified aport to the latest
version. There are implementations for both stable packages (which check
via the release-monitoring.org API for new versions) and git packages
(which check the GitLab/GitHub API for new commits on the main branch).

There's also the possibility to pass --all, --all-stable & --all-git to
the action which either loops through all packages, or just stable or
git packages and upgrades them.

The --dry argument is also respected.

Note, that the implementation does update the variables pkgver, pkgrel
and _commit but it doesn't update the checksums because that would slow
down the process a lot, and is potentially undesirable.
This commit is contained in:
Luca Weiss 2019-02-09 17:58:54 +01:00 committed by Oliver Smith
parent dd72fd44db
commit 33e3553cdd
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
4 changed files with 306 additions and 1 deletions

View file

@ -178,6 +178,20 @@ def arguments_pkgrel_bump(subparser):
return ret
def arguments_aportupgrade(subparser):
ret = subparser.add_parser("aportupgrade")
ret.add_argument("--dry", action="store_true", help="instead of modifying APKBUILDs,"
" print the changes that would be made")
# Mutually exclusive: "--all" or package names
mode = ret.add_mutually_exclusive_group(required=True)
mode.add_argument("--all", action="store_true", help="iterate through all packages")
mode.add_argument("--all-stable", action="store_true", help="iterate through all non-git packages")
mode.add_argument("--all-git", action="store_true", help="iterate through all git packages")
mode.add_argument("packages", nargs="*", default=[])
return ret
def arguments_newapkbuild(subparser):
"""
Wrapper for Alpine's "newapkbuild" command.
@ -386,6 +400,7 @@ def arguments():
arguments_initfs(sub)
arguments_qemu(sub)
arguments_pkgrel_bump(sub)
arguments_aportupgrade(sub)
arguments_newapkbuild(sub)
arguments_lint(sub)