aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-08-25 06:49:08 +0000
committerThierry Vignaud <tv@mandriva.org>2007-08-25 06:49:08 +0000
commite57793872187fc668a1a6a8ae2fa4d3d68331c33 (patch)
tree817fb3e5ede7091590c9b0254dc0ec2a8c2b5932
parentdf28b302207b4b425760e4cc6e47e8fad0fee8d4 (diff)
downloadrpmdrake-e57793872187fc668a1a6a8ae2fa4d3d68331c33.tar
rpmdrake-e57793872187fc668a1a6a8ae2fa4d3d68331c33.tar.gz
rpmdrake-e57793872187fc668a1a6a8ae2fa4d3d68331c33.tar.bz2
rpmdrake-e57793872187fc668a1a6a8ae2fa4d3d68331c33.tar.xz
rpmdrake-e57793872187fc668a1a6a8ae2fa4d3d68331c33.zip
(edit_callback) fix moving altered medium at end of media list (#32489)
-rwxr-xr-xRpmdrake/edit_urpm_sources.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/Rpmdrake/edit_urpm_sources.pm b/Rpmdrake/edit_urpm_sources.pm
index 3c0d52e9..5ec45706 100755
--- a/Rpmdrake/edit_urpm_sources.pm
+++ b/Rpmdrake/edit_urpm_sources.pm
@@ -477,8 +477,22 @@ sub edit_callback() {
my $saved_proxy = urpm::download::get_proxy($name);
undef $saved_proxy if !defined $saved_proxy->{http_proxy} && !defined $saved_proxy->{ftp_proxy};
urpm::media::select_media($urpm, $name);
+ if (my ($media) = grep { $_->{name} eq $name } @{$urpm->{media}}) {
+ put_in_hash($media, {
+ url => $url,
+ name => $name,
+ with_hdlist => $with_hdlist,
+ update => $update,
+ proxy => $saved_proxy,
+ downloader => $downloader,
+ modified => 1,
+ });
+ urpm::media::write_config($urpm);
+ update_sources_noninteractive($urpm, [ media => $name ], transient => $::main_window, nolock => 1);
+ } else {
urpm::media::remove_selected_media($urpm);
add_medium_and_check($urpm, { nolock => 1, proxy => $saved_proxy }, $name, $url, $with_hdlist, update => $update, if_($downloader, downloader => $downloader));
+ }
return $name;
}
return undef;