1
0
Fork 0

implement skip_dirs in clonedev

This commit is contained in:
Luca Bilke 2024-02-27 00:16:43 +01:00
parent 5cf5a09bed
commit 372b4a0116
1 changed files with 11 additions and 11 deletions

View File

@ -9,9 +9,9 @@ use WWW::Curl::Easy;
use WWW::Curl::Multi;
use File::Path("make_path");
# use Data::Dumper;
# $Data::Dumper::Pair = " : ";
# $Data::Dumper::Indent = 2;
use Data::Dumper;
$Data::Dumper::Pair = " : ";
$Data::Dumper::Indent = 2;
# TODO: Async the git clones
# TODO: Show hook/clone output in a prettier fashion (like docker buildx)
@ -91,12 +91,12 @@ sub url_filter($handle) {
my @tmp;
my $lookup = $conf{lookups}[ $handles[$handle]->{lookup} ];
for my $repo ( @{ $handles[$handle]{memory} } ) {
if ( $repo->{ $lookup->{url_type} } ) {
push( @tmp, $repo->{ $lookup->{url_type} } );
if ( $repo->{ $lookup->{url_field} } ) {
push( @tmp, $repo->{ $lookup->{url_field} } );
}
else {
error(
"Failed to extract $lookup->{url_type} while processing lookup: $lookup->{name}"
"Failed to extract $lookup->{url_field} while processing lookup: $lookup->{name}"
);
}
}
@ -134,13 +134,13 @@ sub process_urls($handle) {
next;
}
next if (grep({ $_ eq $repo{fullname} } @{$conf{skip_repos}}));
my $path;
for my $directory ( @{ $conf{directories} } ) {
for my $reponame ( @{ %$directory{repos} } ) {
if ( $reponame eq "$repo{fullname}" ) {
$path = %$directory{path};
last;
}
if (grep({ $_ eq $repo{fullname} } @{ %$directory{repos} })) {
$path = %$directory{path};
last;
}
}