Show operations to perform before asking to apply them
This commit is contained in:
parent
5f2dcc51ce
commit
10fcfa860a
|
@ -52,7 +52,7 @@ sub update_deps_repos {
|
|||
if (not -d $dd) {
|
||||
say "Downloading $dep...";
|
||||
my $repo = $deps->{$dep}->{repo};
|
||||
$repo =~ s/^https?/git/;
|
||||
$repo =~ s!^https?://github/!git\@github.com:!;
|
||||
system("git", "-C", ".deps-update", "clone", $repo);
|
||||
} elsif (time() - stat($dd)->mtime > 24 * 60 * 60) {
|
||||
say "Updating $dep...";
|
||||
|
@ -218,10 +218,19 @@ sub schedule_operation {
|
|||
my $idx = first { $operations[$_]->{dep} eq $dep } 0..$#operations;
|
||||
|
||||
if (defined $idx) {
|
||||
push @{$operations[$idx]->{reasons}}, $reason;
|
||||
push @{$operations[$idx]->{operations}}, $op;
|
||||
my $mop = $operations[$idx];
|
||||
if (defined $op) {
|
||||
my $oidx = first { $mop->{operations}->[$_]->[0] eq $op->[0] } 0..$#{$mop->{operations}};
|
||||
if (defined $oidx) {
|
||||
$mop->{reasons}->[$oidx] = $reason;
|
||||
$mop->{operations}->[$oidx] = $op;
|
||||
} else {
|
||||
push @{$mop->{reasons}}, $reason;
|
||||
push @{$mop->{operations}}, $op;
|
||||
}
|
||||
}
|
||||
return if $type eq "update";
|
||||
$operations[$idx]->{type} = $type;
|
||||
$mop->{type} = $type;
|
||||
$info_updates{$dep}->{new_commits} = [];
|
||||
return;
|
||||
}
|
||||
|
@ -364,6 +373,20 @@ while (1) {
|
|||
$git_info = deps_git_info();
|
||||
$sub_deps = sub_deps();
|
||||
|
||||
print color("bold blue"), "List of operations:\n", color("reset");
|
||||
for my $op (@operations) {
|
||||
print color("red"), $op->{dep}, color("reset"), " ($top_deps->{$op->{dep}}->{commit} -> $op->{version})";
|
||||
if (@{$op->{operations}}) {
|
||||
say ":";
|
||||
say " $_->[0] -> $_->[1]" for @{$op->{operations}};
|
||||
} else {
|
||||
say "";
|
||||
}
|
||||
}
|
||||
|
||||
say "";
|
||||
my $cmd = show_commands(A => "Apply", E => "Exit");
|
||||
if ($cmd eq "A") {
|
||||
my %top_changes;
|
||||
for my $op (@operations) {
|
||||
update_changelog($op->{dep}, $op->{version}, @{$op->{reasons}})
|
||||
|
@ -387,3 +410,4 @@ while (1) {
|
|||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue