From e57793872187fc668a1a6a8ae2fa4d3d68331c33 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Sat, 25 Aug 2007 06:49:08 +0000 Subject: (edit_callback) fix moving altered medium at end of media list (#32489) --- Rpmdrake/edit_urpm_sources.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Rpmdrake/edit_urpm_sources.pm') 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; -- cgit v1.2.1