summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2022-11-30 17:45:17 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2022-11-30 17:45:17 +0000
commiteb6d3112745b994a7780a9d9f82b5887a268badd (patch)
tree2298bb20d5726306a1f729445386492eb6f9b199
parentcf9c00370ebb3e431a4c4e42925cbba731467257 (diff)
downloaddraklive-install-eb6d3112745b994a7780a9d9f82b5887a268badd.tar
draklive-install-eb6d3112745b994a7780a9d9f82b5887a268badd.tar.gz
draklive-install-eb6d3112745b994a7780a9d9f82b5887a268badd.tar.bz2
draklive-install-eb6d3112745b994a7780a9d9f82b5887a268badd.tar.xz
draklive-install-eb6d3112745b994a7780a9d9f82b5887a268badd.zip
Allow user to specify the mirror/downloader when applying updates.
-rw-r--r--NEWS2
-rwxr-xr-xdraklive-install31
2 files changed, 32 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index beabe8b..8f27bcc 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- allow user to specify a specific mirror and downloader when applying
+ updates at the end of installation
- call mygtk3::flush() more frequently whilst copying the filesystem,
to make the main window more responsive to window events
- use run_program::get_stdout to calculate installed size, to
diff --git a/draklive-install b/draklive-install
index 35afff3..996d6e3 100755
--- a/draklive-install
+++ b/draklive-install
@@ -475,12 +475,41 @@ Do you want to setup the update media?")),
return 0;
};
+ require urpm;
+ require urpm::media;
+
+ my $urpm = urpm->new();
+ $urpm->{log} = \&log::l;
+ urpm::set_files($urpm, $::prefix);
+ urpm::media::read_config($urpm);
+
+ $in->{packages} = $urpm;
+ $in->{product_id} = mageia_release_info();
+
+ require mirror;
+ require urpm::download;
+
+ my $downloader = sub {
+ my ($url) = @_;
+ urpm::download::get_content($urpm, $url);
+ };
+ mirror::register_downloader($downloader);
+
+ my $urpmi_options = { mirror_url => '$MIRRORLIST' };
+
try_again:
enable_network_connection($in);
+ any::ask_mirror_and_downloader($in, $urpmi_options);
+ any::urpmi_set_downloader($in, $urpm, $urpmi_options->{downloader}) || die("Failed to set downloader\n");
+
+ if ($urpmi_options->{mirror_url} ne '$MIRRORLIST') {
+ $urpmi_options->{mirror_url} = any::ask_mirror($in, 'distrib', $urpmi_options->{mirror_url});
+ }
+
clean_rpmdb_shared_regions();
- if (any::urpmi_add_all_media($in)) {
+ if (any::urpmi_add_all_media($in, undef, $urpmi_options->{mirror_url})) {
log::l("successfully added update media");
return 1;
}