-
- # --external is enabled by default, but allow --no-external
- if ($opt->{external} //= 1) {
- my $cb = $lxs->can('prepare_external');
- my $ne = $self->_externals_each($cb, $lxs);
- $opt->{remote} //= $ne == $lxs->remotes;
- if ($opt->{'local'}) {
- delete($lxs->{remotes}) if !$opt->{remote};
- } else {
- delete($lxs->{locals});
+ if (@only) {
+ for my $loc (@only) {
+ $lxs->prepare_external($self->ext_canonicalize($loc));
+ }
+ } else {
+ for my $loc (@{$opt->{include} // []}) {
+ $lxs->prepare_external($self->ext_canonicalize($loc));
+ }
+ # --external is enabled by default, but allow --no-external
+ if ($opt->{external} //= 1) {
+ my %x = map {;
+ ($self->ext_canonicalize($_), 1)
+ } @{$self->{exclude} // []};
+ my $ne = $self->externals_each(\&prep_ext, $lxs, \%x);
+ $opt->{remote} //= !($lxs->locals - $opt->{'local'});
+ if ($opt->{'local'}) {
+ delete($lxs->{remotes}) if !$opt->{remote};
+ } else {
+ delete($lxs->{locals});
+ }