Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4747e43752 | |||
| 2d1c16e76e | |||
| 4dbbc6b34a | |||
| 36999309c2 | |||
| 1ef3938a96 | |||
| 9119c8c973 | |||
| 632053fc2f | |||
| 6fc14f7605 | |||
| 4268b06305 |
@@ -15,7 +15,7 @@ $ENV{FEATURES} = $ENV{FEATURES}
|
|||||||
|
|
||||||
my $equo_install_atoms = $ENV{EQUO_INSTALL_ATOMS} // 1;
|
my $equo_install_atoms = $ENV{EQUO_INSTALL_ATOMS} // 1;
|
||||||
my $equo_install_version = $ENV{EQUO_INSTALL_VERSION} // 0;
|
my $equo_install_version = $ENV{EQUO_INSTALL_VERSION} // 0;
|
||||||
my $equo_split_install = $ENV{EQUO_SPLIT_INSTALL} // 1;
|
my $equo_split_install = $ENV{EQUO_SPLIT_INSTALL} // 0;
|
||||||
my $equo_mirrorsort = $ENV{EQUO_MIRRORSORT} // 1;
|
my $equo_mirrorsort = $ENV{EQUO_MIRRORSORT} // 1;
|
||||||
my $entropy_repository = $ENV{ENTROPY_REPOSITORY}
|
my $entropy_repository = $ENV{ENTROPY_REPOSITORY}
|
||||||
// "main"; # Can be weekly, main, testing
|
// "main"; # Can be weekly, main, testing
|
||||||
@@ -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)
|
# 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 {
|
sub package_deps {
|
||||||
my $package = shift;
|
my $package = shift;
|
||||||
my $depth = shift // 1; # defaults to 1 level of depthness of the tree
|
my $depth = shift // 1; # defaults to 1 level of depthness of the tree
|
||||||
my $atom = shift // 0;
|
my $atom = shift // 0;
|
||||||
|
|
||||||
# Since we expect this sub to be called multiple times with the same arguments, cache the results
|
# Since we expect this sub to be called multiple times with the same arguments, cache the results
|
||||||
state %cache;
|
|
||||||
$cache_key = "${package}:${depth}:${atom}";
|
$cache_key = "${package}:${depth}:${atom}";
|
||||||
|
|
||||||
if ( !exists $cache{$cache_key} ) {
|
if ( !exists $package_dep_cache{$cache_key} ) {
|
||||||
@dependencies =
|
my @dependencies =
|
||||||
qx/equery -C -q g --depth=$depth $package/; #depth=0 it's all
|
qx/equery -C -q g --depth=$depth $package/; #depth=0 it's all
|
||||||
chomp @dependencies;
|
chomp @dependencies;
|
||||||
|
|
||||||
@@ -148,10 +148,10 @@ sub package_deps {
|
|||||||
@dependencies
|
@dependencies
|
||||||
);
|
);
|
||||||
|
|
||||||
$cache{$cache_key} = \@dependencies;
|
$package_dep_cache{$cache_key} = \@dependencies;
|
||||||
}
|
}
|
||||||
|
|
||||||
return @{ $cache{$cache_key} };
|
return @{ $package_dep_cache{$cache_key} };
|
||||||
}
|
}
|
||||||
|
|
||||||
#Input: nothing
|
#Input: nothing
|
||||||
@@ -178,18 +178,26 @@ sub calculate_missing {
|
|||||||
my @dependencies = package_deps( $package, $depth, 1 );
|
my @dependencies = package_deps( $package, $depth, 1 );
|
||||||
|
|
||||||
if ($prune_virtuals) {
|
if ($prune_virtuals) {
|
||||||
say "[$package] Pruning dependencies of virtual packages";
|
|
||||||
my %install_dependencies = map { $_ => 1 } @dependencies;
|
my %install_dependencies = map { $_ => 1 } @dependencies;
|
||||||
|
|
||||||
# Look for any virtuals and remove its immediate dependencies to avoid
|
# Look for any virtuals and remove its immediate dependencies to avoid
|
||||||
# installing multiple conflicting packages one by one
|
# installing multiple conflicting packages one by one
|
||||||
my @virtual_deps;
|
my @virtual_deps = ();
|
||||||
for my $dep (@dependencies) {
|
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) {
|
for my $dep (@virtual_deps) {
|
||||||
$install_dependencies{$dep} = 0 if ( $dep !~ /^virtual\// );
|
if ( $dep !~ /^virtual\// ) {
|
||||||
|
$install_dependencies{$dep} = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@dependencies = grep { $install_dependencies{$_} } @dependencies;
|
@dependencies = grep { $install_dependencies{$_} } @dependencies;
|
||||||
}
|
}
|
||||||
@@ -203,6 +211,10 @@ sub calculate_missing {
|
|||||||
my @to_install = grep( defined $available_packs{$_},
|
my @to_install = grep( defined $available_packs{$_},
|
||||||
uniq( grep( !defined $installed_packs{$_}, @dependencies ) ) );
|
uniq( grep( !defined $installed_packs{$_}, @dependencies ) ) );
|
||||||
@to_install = grep { length } @to_install;
|
@to_install = grep { length } @to_install;
|
||||||
|
|
||||||
|
# Strip out the target package from the dependency list
|
||||||
|
@to_install = grep { to_atom($_) ne to_atom($package) } @to_install;
|
||||||
|
|
||||||
say "[$package] packages that will be installed with equo: @to_install"
|
say "[$package] packages that will be installed with equo: @to_install"
|
||||||
if @to_install > 0;
|
if @to_install > 0;
|
||||||
|
|
||||||
@@ -212,6 +224,8 @@ sub calculate_missing {
|
|||||||
# Input : complete gentoo package (sys-fs/foobarfs-1.9.2)
|
# Input : complete gentoo package (sys-fs/foobarfs-1.9.2)
|
||||||
# Output: atom form (sys-fs/foobarfs)
|
# Output: atom form (sys-fs/foobarfs)
|
||||||
sub atom { s/-[0-9]{1,}.*$//; }
|
sub atom { s/-[0-9]{1,}.*$//; }
|
||||||
|
# Same again as a function
|
||||||
|
sub to_atom { my $p=shift; $p =~ s/-[0-9]{1,}.*$//; return $p; }
|
||||||
|
|
||||||
# Input: Array
|
# Input: Array
|
||||||
# Output: array with unique elements
|
# Output: array with unique elements
|
||||||
@@ -314,6 +328,8 @@ if ( $remote_portdir ne "" ) {
|
|||||||
system("chown -R portage:portage /usr/portage");
|
system("chown -R portage:portage /usr/portage");
|
||||||
system("chmod -R ug+w,a+rX /usr/portage");
|
system("chmod -R ug+w,a+rX /usr/portage");
|
||||||
}
|
}
|
||||||
|
system("mkdir /var/lib/layman") if ( ! -d "/var/lib/layman" );
|
||||||
|
system("touch /var/lib/layman/make.conf && layman-updater -R") if ( ! -e "/var/lib/layman/make.conf" );
|
||||||
|
|
||||||
system("echo 'y' | layman -f -a $_") for @overlays;
|
system("echo 'y' | layman -f -a $_") for @overlays;
|
||||||
|
|
||||||
@@ -377,7 +393,9 @@ unless ( $skip_portage_sync == 1 ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# preparing for MOAR automation
|
# preparing for MOAR automation
|
||||||
qx|eselect profile set $profile|;
|
say "Setting new profile to $profile" if defined $profile;
|
||||||
|
qx|eselect profile set $profile| if defined $profile;
|
||||||
|
system("eselect profile list") if defined $profile;
|
||||||
|
|
||||||
if ( $use_equo && $entropy_repository eq "weekly" ) {
|
if ( $use_equo && $entropy_repository eq "weekly" ) {
|
||||||
qx|equo repo disable sabayonlinux.org|;
|
qx|equo repo disable sabayonlinux.org|;
|
||||||
|
|||||||
@@ -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.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")
|
[ -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 "$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
|
fi
|
||||||
|
|
||||||
echo "Spawning the package builder container for '$@'."
|
echo "Spawning the package builder container for '$@'."
|
||||||
echo ""
|
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 $@
|
docker run $DOCKER_OPTS "${docker_env[@]}" "${docker_volumes[@]}" $DOCKER_IMAGE $@
|
||||||
|
|||||||
+2
-2
@@ -88,8 +88,8 @@ database-format = bz2
|
|||||||
# disabled-eapis = 1,2
|
# disabled-eapis = 1,2
|
||||||
# expiration-based-scope = disable
|
# expiration-based-scope = disable
|
||||||
# nonfree-packages-directory-support = disable
|
# nonfree-packages-directory-support = disable
|
||||||
rss-feed = disable
|
rss-feed = enable
|
||||||
changelog = disable
|
changelog = enable
|
||||||
rss-name = packages.rss
|
rss-name = packages.rss
|
||||||
rss-base-url = http://packages.sabayon.org/?quicksearch=
|
rss-base-url = http://packages.sabayon.org/?quicksearch=
|
||||||
rss-website-url = http://www.sabayon.org/
|
rss-website-url = http://www.sabayon.org/
|
||||||
|
|||||||
Reference in New Issue
Block a user