summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/urpm.pm b/urpm.pm
index 915a09e6..7c8ac708 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -2283,14 +2283,14 @@ sub get_unwanted_packages {
#- have a null list.
sub get_source_packages {
my ($urpm, $packages, %options) = @_;
- my ($id, $error, %local_sources, @list, %fullname2id, %file2fullnames, %examined);
+ my ($id, $error, %protected_files, %local_sources, @list, %fullname2id, %file2fullnames, %examined);
local (*D, *F, $_);
#- build association hash to retrieve id and examine all list files.
foreach (keys %$packages) {
my $p = $urpm->{depslist}[$_];
if ($urpm->{source}{$_}) {
- $local_sources{$_} = $urpm->{source}{$_};
+ $protected_files{$local_sources{$_} = $urpm->{source}{$_}} = undef;
} else {
$fullname2id{$p->fullname} = $_.'';
}
@@ -2316,10 +2316,10 @@ sub get_source_packages {
if (defined($id = delete $fullname2id{$fullname})) {
$local_sources{$id} = $filepath;
} else {
- $options{clean_other} and unlink $filepath;
+ $options{clean_other} && ! exists $protected_files{$filepath} and unlink $filepath;
}
} else {
- $options{clean_other} and unlink $filepath;
+ $options{clean_other} && ! exists $protected_files{$filepath} and unlink $filepath;
}
} else {
#- this file should be removed or is already empty.