From 4dbbc6b34a299f30ac429dd448bd0294d453dd5e Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Tue, 13 Sep 2016 22:08:43 +0100 Subject: [PATCH] Strip out package itself from package_deps Package_deps returned the target package in the output which is not strictly true (the package is not a dependency of itself really). In calcuate_missing also means we install the package once using entropy (if available), and then immediately replace it with portage, which just wastes effort. It breaks installation in the cases where the older equo version blocks the new portage version (e.g. change of slot). This should remove the target package from the list of packages to be installed with entropy. --- builder | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/builder b/builder index 18469b8..1df074b 100755 --- a/builder +++ b/builder @@ -211,6 +211,10 @@ sub calculate_missing { my @to_install = grep( defined $available_packs{$_}, uniq( grep( !defined $installed_packs{$_}, @dependencies ) ) ); @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" if @to_install > 0; @@ -220,6 +224,8 @@ sub calculate_missing { # Input : complete gentoo package (sys-fs/foobarfs-1.9.2) # Output: atom form (sys-fs/foobarfs) 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 # Output: array with unique elements