forked from Mirror/pmbootstrap
Rewrite repo_missing for bpo + systemd split repo (MR 2410)
The "pmbootstrap repo_missing" action is used exclusively by bpo. It calls it only with these arguments: pmbootstrap repo_missing --built --arch "$ARCH" A blocker for merging systemd into pmaports master is, that the current repo_missing code cannot display packages that are both in extra-repos/systemd and in another path. I have considered just not supporting this and discussed doing that with Caleb and Clayton, but we figured it would be a major obstacle in the future to not be able to easily override packages with systemd specific versions (currently we need this for 3 packages). Integrating this into the existing repo_missing code would be hacks upon hacks. Also the scope of the current repo_missing code has many extra features that are not used and would be extra effort to carry along: * Allow specifying a pkgname * Running without --built * --overview So I decided to replace the repo_missing code with a much simpler, more modern implementation, that does exactly what is needed: * Duplicate packages in systemd and non-systemd dirs are displayed * The output always include all packages, no matter if they are already built or not (same behavior as with --built) * Removed --overview and selecting specific packages too * The code for filling "repo" (either "systemd" or None) is more resilient now, as it can use proper relative paths to the root of pmaports. Unlike the previous implementation, it will not fail if subdirs are added to the systemd dir. I have made sure that the output is exactly the same as before on current pmaports master. Related: bpo issue 144 Related: bpo issue 140
This commit is contained in:
parent
62e32e15a9
commit
8d446c2aeb
3 changed files with 59 additions and 168 deletions
|
@ -737,20 +737,21 @@ def arguments_repo_bootstrap(subparser: argparse._SubParsersAction) -> argparse.
|
|||
|
||||
|
||||
def arguments_repo_missing(subparser: argparse._SubParsersAction) -> argparse.ArgumentParser:
|
||||
ret = subparser.add_parser("repo_missing")
|
||||
package = ret.add_argument(
|
||||
"package", nargs="?", help="only look at a specific package and its dependencies"
|
||||
ret = subparser.add_parser(
|
||||
"repo_missing",
|
||||
help="list all packages + depends from pmaports for building the repository (used by bpo)",
|
||||
)
|
||||
if "argcomplete" in sys.modules:
|
||||
package.completer = package_completer
|
||||
ret.add_argument(
|
||||
"--arch", choices=Arch.supported(), default=Arch.native(), type=lambda x: Arch.from_str(x)
|
||||
)
|
||||
# Deprecated argument that is currently kept so pmbootstrap can be called
|
||||
# the same way for repo_missing by bpo with pmbv2 and pmbv3. Once we drop
|
||||
# support for pmbv2 in bpo (can do that after v24.06 is EOL), we can adjust
|
||||
# bpo to not use --built and remove this parameter from pmbootstrap.
|
||||
ret.add_argument(
|
||||
"--built", action="store_true", help="include packages which exist in the binary repos"
|
||||
)
|
||||
ret.add_argument(
|
||||
"--overview", action="store_true", help="only print the pkgnames without any details"
|
||||
"--built",
|
||||
action="store_true",
|
||||
help=argparse.SUPPRESS,
|
||||
)
|
||||
return ret
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue