| git.druid.rocks | index | druid520 | mp | src/ | dryrun.pl |
src/dryrun.pl
#!/usr/bin/env perl
use v5.16;
# scope note: DRYRUN short-circuits install_pkg_body AFTER dependency
# resolution/conflict-declaration checks (pkg_conflicts, HOLD, MASK,
# keywords) but BEFORE staging, patch application, phase-script
# execution, and -- critically -- find_file_conflict, the actual
# file-path-overlap detector, which only ever runs deep in the real
# install path. so "would install: X" only means X's declared deps/
# conflicts resolve cleanly; it does NOT guarantee a real `mp install X`
# right afterward won't still fail on an actual file conflict with
# something already installed, or on a phase script/hook/patch actually
# failing to run. treat this as "would this resolve," not "would this
# fully succeed."
use strict;
use warnings FATAL => 'all';
use FindBin;
use lib "$FindBin::Bin";
use mplib::config qw($CFG);
use mplib::util qw(fail);
use mplib::db qw(read_db);
use mplib::resolve qw(init install_pkg expand_meta);
my $flags = mplib::config::parse_flags(\@ARGV);
$flags->{DRYRUN} = 1;
mplib::config::load($flags);
fail("dryrun needs at least one package name") unless @ARGV;
init();
my $db = read_db();
install_pkg($_, $db, {}, 1) for map { expand_meta($_, $db) } @ARGV;