Add convenience flags --apt and --native.
This commit is contained in:
parent
3658f6e0ec
commit
6f4e571e2f
2 changed files with 15 additions and 3 deletions
|
@ -106,6 +106,12 @@ def main(): # noqa: C901
|
||||||
default="auto",
|
default="auto",
|
||||||
help="What to do about missing dependencies",
|
help="What to do about missing dependencies",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'--apt', help=argparse.SUPPRESS,
|
||||||
|
dest='resolve', action='store_const', const='apt')
|
||||||
|
parser.add_argument(
|
||||||
|
'--native', help=argparse.SUPPRESS,
|
||||||
|
dest='native', action='store_const', const='native')
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--explain",
|
"--explain",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
|
@ -124,6 +130,8 @@ def main(): # noqa: C901
|
||||||
subparsers.add_parser("clean")
|
subparsers.add_parser("clean")
|
||||||
subparsers.add_parser("test")
|
subparsers.add_parser("test")
|
||||||
subparsers.add_parser("info")
|
subparsers.add_parser("info")
|
||||||
|
exec_parser = subparsers.add_parser("exec")
|
||||||
|
exec_parser.add_argument('subargv', nargs=argparse.REMAINDER, help='Command to run.')
|
||||||
install_parser = subparsers.add_parser("install")
|
install_parser = subparsers.add_parser("install")
|
||||||
install_parser.add_argument(
|
install_parser.add_argument(
|
||||||
"--user", action="store_true", help="Install in local-user directories."
|
"--user", action="store_true", help="Install in local-user directories."
|
||||||
|
@ -161,10 +169,14 @@ def main(): # noqa: C901
|
||||||
elif args.resolve == "auto":
|
elif args.resolve == "auto":
|
||||||
resolver = auto_resolver(session, explain=args.explain)
|
resolver = auto_resolver(session, explain=args.explain)
|
||||||
logging.info("Using requirement resolver: %s", resolver)
|
logging.info("Using requirement resolver: %s", resolver)
|
||||||
|
fixers = determine_fixers(session, resolver, explain=args.explain)
|
||||||
try:
|
try:
|
||||||
|
if args.subcommand == "exec":
|
||||||
|
from .fix_build import run_with_build_fixers
|
||||||
|
run_with_build_fixers(session, args.subargv, fixers)
|
||||||
|
return 0
|
||||||
bss = list(detect_buildsystems(args.directory))
|
bss = list(detect_buildsystems(args.directory))
|
||||||
logging.info("Detected buildsystems: %s", ", ".join(map(str, bss)))
|
logging.info("Detected buildsystems: %s", ", ".join(map(str, bss)))
|
||||||
fixers = determine_fixers(session, resolver, explain=args.explain)
|
|
||||||
if not args.ignore_declared_dependencies:
|
if not args.ignore_declared_dependencies:
|
||||||
stages = STAGE_MAP[args.subcommand]
|
stages = STAGE_MAP[args.subcommand]
|
||||||
if stages:
|
if stages:
|
||||||
|
|
|
@ -433,7 +433,7 @@ def fix_missing_makefile_pl(error, phase, context):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def coerce_unaccpetable_predicate(error, phase, context):
|
def coerce_unacceptable_predicate(error, phase, context):
|
||||||
from debmutate.debcargo import DebcargoEditor
|
from debmutate.debcargo import DebcargoEditor
|
||||||
with DebcargoEditor(context.abspath('debian/debcargo.toml')) as editor:
|
with DebcargoEditor(context.abspath('debian/debcargo.toml')) as editor:
|
||||||
editor['allow_prerelease_deps'] = True
|
editor['allow_prerelease_deps'] = True
|
||||||
|
@ -492,7 +492,7 @@ def versioned_package_fixers(session, packaging_context, apt):
|
||||||
packaging_context, MissingConfigStatusInput, fix_missing_config_status_input
|
packaging_context, MissingConfigStatusInput, fix_missing_config_status_input
|
||||||
),
|
),
|
||||||
SimpleBuildFixer(packaging_context, MissingPerlFile, fix_missing_makefile_pl),
|
SimpleBuildFixer(packaging_context, MissingPerlFile, fix_missing_makefile_pl),
|
||||||
SimpleBuildFixer(packaging_context, DebcargoUnacceptablePredicate, coerce_unaccpetable_predicate),
|
SimpleBuildFixer(packaging_context, DebcargoUnacceptablePredicate, coerce_unacceptable_predicate),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue