Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9119c8c973 | |||
| 632053fc2f | |||
| 6fc14f7605 | |||
| 4268b06305 | |||
| a66dc7bb23 |
@@ -37,7 +37,7 @@ my $equo_masks = $ENV{EQUO_MASKS};
|
||||
my $equo_unmasks = $ENV{EQUO_UNMASKS};
|
||||
my $equo_install_args = $ENV{EQUO_INSTALL_ARGS} // "--multifetch=10";
|
||||
my $remote_overlay = $ENV{REMOTE_OVERLAY};
|
||||
my $repoman_check = $ENV{QA_CHECKS} // 0;
|
||||
my $qualityassurance_checks = $ENV{QA_CHECKS} // 0;
|
||||
my $remote_conf_portdir = $ENV{REMOTE_CONF_PORTDIR};
|
||||
my $remote_portdir = $ENV{REMOTE_PORTDIR};
|
||||
|
||||
@@ -123,17 +123,17 @@ auto-sync = yes' > /etc/portage/repos.conf/$reponame.conf
|
||||
}
|
||||
|
||||
# Input: package, depth, and atom. Package: sys-fs/foobarfs, Depth: 1 (depth of the package tree) , Atom: 1/0 (enable disable atom output)
|
||||
my %package_dep_cache;
|
||||
sub package_deps {
|
||||
my $package = shift;
|
||||
my $depth = shift // 1; # defaults to 1 level of depthness of the tree
|
||||
my $atom = shift // 0;
|
||||
|
||||
# Since we expect this sub to be called multiple times with the same arguments, cache the results
|
||||
state %cache;
|
||||
$cache_key = "${package}:${depth}:${atom}";
|
||||
|
||||
if ( !exists $cache{$cache_key} ) {
|
||||
@dependencies =
|
||||
if ( !exists $package_dep_cache{$cache_key} ) {
|
||||
my @dependencies =
|
||||
qx/equery -C -q g --depth=$depth $package/; #depth=0 it's all
|
||||
chomp @dependencies;
|
||||
|
||||
@@ -148,10 +148,10 @@ sub package_deps {
|
||||
@dependencies
|
||||
);
|
||||
|
||||
$cache{$cache_key} = \@dependencies;
|
||||
$package_dep_cache{$cache_key} = \@dependencies;
|
||||
}
|
||||
|
||||
return @{ $cache{$cache_key} };
|
||||
return @{ $package_dep_cache{$cache_key} };
|
||||
}
|
||||
|
||||
#Input: nothing
|
||||
@@ -178,18 +178,26 @@ sub calculate_missing {
|
||||
my @dependencies = package_deps( $package, $depth, 1 );
|
||||
|
||||
if ($prune_virtuals) {
|
||||
say "[$package] Pruning dependencies of virtual packages";
|
||||
my %install_dependencies = map { $_ => 1 } @dependencies;
|
||||
|
||||
# Look for any virtuals and remove its immediate dependencies to avoid
|
||||
# installing multiple conflicting packages one by one
|
||||
my @virtual_deps;
|
||||
my @virtual_deps = ();
|
||||
for my $dep (@dependencies) {
|
||||
push( @virtual_deps, package_deps( $dep, 1, 1 ) )
|
||||
if ( $dep =~ /^virtual\// );
|
||||
if ( $dep =~ /^virtual\// ) {
|
||||
my @child_deps = package_deps($dep, 1, 1);
|
||||
push( @virtual_deps, @child_deps );
|
||||
}
|
||||
}
|
||||
|
||||
# Deduplicate the list
|
||||
@virtual_deps = uniq(@virtual_deps);
|
||||
|
||||
# Prune the dependencies of the virtual packages from the dependencies list
|
||||
for my $dep (@virtual_deps) {
|
||||
$install_dependencies{$dep} = 0 if ( $dep !~ /^virtual\// );
|
||||
if ( $dep !~ /^virtual\// ) {
|
||||
$install_dependencies{$dep} = 0;
|
||||
}
|
||||
}
|
||||
@dependencies = grep { $install_dependencies{$_} } @dependencies;
|
||||
}
|
||||
@@ -494,7 +502,7 @@ if ($use_equo) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( $repoman_check == 1 ) {
|
||||
if ( $qualityassurance_checks == 1 ) {
|
||||
say "*** Repoman checks ***";
|
||||
for ( @packages, @injected_packages ) {
|
||||
say "*** QA checks for $_";
|
||||
@@ -534,6 +542,15 @@ if ($preserved_rebuild) {
|
||||
|
||||
}
|
||||
|
||||
if ( $qualityassurance_checks == 1 ) {
|
||||
say "*** Missing dependencies checks ***";
|
||||
for ( @packages ) {
|
||||
say "*** DEPEND for $_";
|
||||
system("dynlink-scanner $_");
|
||||
system("depcheck $_");
|
||||
}
|
||||
}
|
||||
|
||||
# Copy files to artifacts folder
|
||||
system(
|
||||
"mkdir -p $artifacts_folder;cp -rfv /usr/portage/packages $artifacts_folder"
|
||||
|
||||
@@ -76,11 +76,12 @@ if [ -d "$SAB_WORKSPACE"/specs ]; then
|
||||
[ -e "$SAB_WORKSPACE"/specs/custom.env ] && docker_volumes+=(-v "$SAB_WORKSPACE/specs/custom.env:/opt/sabayon-build/conf/$SAB_ARCH/portage/package.env")
|
||||
[ -e "$SAB_WORKSPACE"/specs/custom.keywords ] && docker_volumes+=(-v "$SAB_WORKSPACE/specs/custom.keywords:/opt/sabayon-build/conf/$SAB_ARCH/portage/package.keywords/99-custom.keywords")
|
||||
[ -d "$SAB_WORKSPACE"/specs/env ] && docker_volumes+=(-v "$SAB_WORKSPACE/specs/env/:/opt/sabayon-build/conf/$SAB_ARCH/portage/env/")
|
||||
[ -d "/vagrant" ] && docker_volumes+=(-v "/vagrant:/vagrant")
|
||||
|
||||
fi
|
||||
|
||||
echo "Spawning the package builder container for '$@'."
|
||||
echo ""
|
||||
#echo "docker run $DOCKER_OPTS ${docker_env[@]} ${docker_volumes[@]} $DOCKER_IMAGE $@"
|
||||
echo "docker run $DOCKER_OPTS \"${docker_env[@]}\" \"${docker_volumes[@]}\" $DOCKER_IMAGE $@"
|
||||
|
||||
docker run $DOCKER_OPTS "${docker_env[@]}" "${docker_volumes[@]}" $DOCKER_IMAGE $@
|
||||
|
||||
Reference in New Issue
Block a user