Mageia Bugzilla – Attachment 5160 Details for
Bug 12766
Existence of backports packages causes problems in rpmdrake
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
patch to solve the problem
backports.patch (text/plain), 3.17 KB, created by
Angelo Naselli
on 2014-05-15 10:16:50 CEST
(
hide
)
Description:
patch to solve the problem
Filename:
MIME Type:
Creator:
Angelo Naselli
Created:
2014-05-15 10:16:50 CEST
Size:
3.17 KB
patch
obsolete
>diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm >index 2972477..ad9304a 100644 >--- a/Rpmdrake/gui.pm >+++ b/Rpmdrake/gui.pm >@@ -647,9 +647,12 @@ sub pkgs_provider { > installed => $h->{installed}, > all => [ keys %$pkgs ], > ); >+ #anaselli NOTE tv has set into $all_pkgs only latest updates, not all of them >+ # if backports are enabled those are offered, and not if disabled, >+ # so non needs to remove inactive_backports from all packages > my %tmp_filter_methods = ( > all => sub { >- [ difference2([ keys %$pkgs ], $h->{inactive_backports}) ]; >+ [ keys %$pkgs ]; > }, > all_updates => sub { > # potential "updates" from media not tagged as updates: >diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm >index e9229b8..28dc1f0 100644 >--- a/Rpmdrake/pkg.pm >+++ b/Rpmdrake/pkg.pm >@@ -518,17 +518,12 @@ sub get_pkgs { > $urpm->{rpmdrake_state} = $state; #- Don't forget it > $gurpm->progress($level = 0.7); > >+ #anaselli NOTE tv has set into $all_pkgs only latest updates, not all of them >+ # but that has some issues on backports, and the old management, >+ # such as filters for instance, let's set backport first then and >+ # only if they are enabled > my %l; > reset_pbar_count(1); >- foreach my $pkg (@{$urpm->{depslist}}) { >- update_pbar($gurpm); >- $pkg->flag_upgrade or next; >- my $key = $pkg->name . $pkg->arch; >- $l{$key} = $pkg if !$l{$key} || $l{$key}->compare($pkg); >- } >- my @installable_pkgs = map { my $n = $_->fullname; $all_pkgs{$n} = { pkg => $_ }; $n } values %l; >- undef %l; >- > my @inactive_backports; > my @active_backports; > my @backport_medias = get_backport_media($urpm); >@@ -542,16 +537,36 @@ sub get_pkgs { > > my $backports = > $medium->{searchmedia} ? \@inactive_backports : \@active_backports; >- > foreach my $pkg_id ($medium->{start} .. $medium->{end}) { > next if !$pkg_id; > my $pkg = $urpm->{depslist}[$pkg_id]; > $pkg->flag_upgrade or next; > my $name = $pkg->fullname; >+ > push @$backports, $name; >- $all_pkgs{$name} = { pkg => $pkg, is_backport => 1 }; >+ if (!$medium->{searchmedia}) { >+ my $key = $pkg->name . $pkg->arch; >+ if (!$l{$key} || $l{$key}->compare($pkg)) { >+ $l{$key} = $pkg ; >+ #anaselli letting the is_backport_flag >+ $all_pkgs{$name} = { pkg => $pkg, is_backport => 1 }; >+ } >+ } > } > } >+ >+ foreach my $pkg (@{$urpm->{depslist}}) { >+ update_pbar($gurpm); >+ $pkg->flag_upgrade or next; >+ my $key = $pkg->name . $pkg->arch; >+ #anaselli NOTE that backports are also in @{$urpm->{depslist}} >+ if (member($pkg->fullname, @inactive_backports)) { >+ $l{$key} = $pkg if !$l{$key} || $l{$key}->compare($pkg); >+ } >+ } >+ my @installable_pkgs = map { my $n = $_->fullname; $all_pkgs{$n} = { pkg => $_ }; $n } values %l; >+ undef %l; >+ > my @updates = @requested; > # selecting updates by default but skipped ones (MageiaUpdate only): > foreach (@requested_strict) {
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm index 2972477..ad9304a 100644 --- a/Rpmdrake/gui.pm +++ b/Rpmdrake/gui.pm @@ -647,9 +647,12 @@ sub pkgs_provider { installed => $h->{installed}, all => [ keys %$pkgs ], ); + #anaselli NOTE tv has set into $all_pkgs only latest updates, not all of them + # if backports are enabled those are offered, and not if disabled, + # so non needs to remove inactive_backports from all packages my %tmp_filter_methods = ( all => sub { - [ difference2([ keys %$pkgs ], $h->{inactive_backports}) ]; + [ keys %$pkgs ]; }, all_updates => sub { # potential "updates" from media not tagged as updates: diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index e9229b8..28dc1f0 100644 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -518,17 +518,12 @@ sub get_pkgs { $urpm->{rpmdrake_state} = $state; #- Don't forget it $gurpm->progress($level = 0.7); + #anaselli NOTE tv has set into $all_pkgs only latest updates, not all of them + # but that has some issues on backports, and the old management, + # such as filters for instance, let's set backport first then and + # only if they are enabled my %l; reset_pbar_count(1); - foreach my $pkg (@{$urpm->{depslist}}) { - update_pbar($gurpm); - $pkg->flag_upgrade or next; - my $key = $pkg->name . $pkg->arch; - $l{$key} = $pkg if !$l{$key} || $l{$key}->compare($pkg); - } - my @installable_pkgs = map { my $n = $_->fullname; $all_pkgs{$n} = { pkg => $_ }; $n } values %l; - undef %l; - my @inactive_backports; my @active_backports; my @backport_medias = get_backport_media($urpm); @@ -542,16 +537,36 @@ sub get_pkgs { my $backports = $medium->{searchmedia} ? \@inactive_backports : \@active_backports; - foreach my $pkg_id ($medium->{start} .. $medium->{end}) { next if !$pkg_id; my $pkg = $urpm->{depslist}[$pkg_id]; $pkg->flag_upgrade or next; my $name = $pkg->fullname; + push @$backports, $name; - $all_pkgs{$name} = { pkg => $pkg, is_backport => 1 }; + if (!$medium->{searchmedia}) { + my $key = $pkg->name . $pkg->arch; + if (!$l{$key} || $l{$key}->compare($pkg)) { + $l{$key} = $pkg ; + #anaselli letting the is_backport_flag + $all_pkgs{$name} = { pkg => $pkg, is_backport => 1 }; + } + } } } + + foreach my $pkg (@{$urpm->{depslist}}) { + update_pbar($gurpm); + $pkg->flag_upgrade or next; + my $key = $pkg->name . $pkg->arch; + #anaselli NOTE that backports are also in @{$urpm->{depslist}} + if (member($pkg->fullname, @inactive_backports)) { + $l{$key} = $pkg if !$l{$key} || $l{$key}->compare($pkg); + } + } + my @installable_pkgs = map { my $n = $_->fullname; $all_pkgs{$n} = { pkg => $_ }; $n } values %l; + undef %l; + my @updates = @requested; # selecting updates by default but skipped ones (MageiaUpdate only): foreach (@requested_strict) {
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 12766
:
5158
|
5160
|
5161
|
5166
|
5185
|
5186
|
5187
|
5216
|
5217