Use the package updates module to install new packages

This commit is contained in:
Jamie Cameron
2018-11-03 17:06:10 -07:00
parent 74c4386779
commit 7a4c83ba35
5 changed files with 22 additions and 4 deletions

View File

@@ -209,5 +209,7 @@ print &ui_table_row($text{'index_action'},
print &ui_table_end();
print &ui_form_end([ [ "save", $text{'save'} ] ]);
# Show install form
&ui_print_footer("/", $text{'index'});

View File

@@ -47,6 +47,7 @@ index_searchok=Search
index_clear=Show All
update_title=Update Packages
update_title2=Install Packages
update_pkg=Now updating $1 ..
update_pkg2=Now installing $1 ..
update_done=Installed package $1 $2.
@@ -78,8 +79,8 @@ update_oldver=Current version
update_newver=New version
update_confirm=Install Now
update_none=None
update_ops=Building complete list of updates ..
update_rebootdesc=One of the updated packages requires a reboot to be fully applied.
update_ops=Building complete list of packages ..
update_rebootdesc=One of the installed packages requires a reboot to be fully applied.
update_reboot=Reboot Now
sched_title=Scheduled Update

View File

@@ -38,7 +38,8 @@ else {
# Upgrade some packages
my @pkgs = split(/\0/, $in{'u'});
@pkgs || &error($text{'update_enone'});
&ui_print_unbuffered_header(undef, $text{'update_title'}, "");
&ui_print_unbuffered_header(undef,
$in{'mode'} eq 'new' ? $text{'update_title2'} : $text{'update_title'}, "");
# Save this CGI from being killed by a webmin or apache upgrade
$SIG{'TERM'} = 'IGNORE';
@@ -61,6 +62,8 @@ else {
print &ui_form_start("update.cgi", "post");
print &ui_hidden("mode", $in{'mode'});
print &ui_hidden("search", $in{'search'});
print &ui_hidden("redir", $in{'redir'});
print &ui_hidden("redirdesc", $in{'redirdesc'});
foreach $ps (@pkgs) {
print &ui_hidden("u", $ps);
}

View File

@@ -41,3 +41,5 @@ Added support for updating and installing packages from FreeBSD ports.
Added support for the FreeBSD pkgng binary package repository as an alternative to ports.
---- Changes since 1.740 ----
MacOS systems with PKGsrc installed can now use this module to manage and install binary packages.
---- Changes since 1.890 ----
When installing a package, the list of other dependencies that will be also installed is displayed for confirmation.

View File

@@ -13,7 +13,17 @@ else {
}
&error_setup($text{'install_err'});
if ($in{source} >= 2) {
if ($in{'source'} == 3 && &foreign_installed("package-updates")) {
# Use the package updates module instead, as it has a nicer UI
&redirect("/package-updates/update.cgi?redir=/$module_name/".
"&redirdesc=".&urlize($module_info{'desc'}).
"&mode=new".
"&".join("&", map { "u=".&urlize($_) }
split(/\s+/, $in{'update'})));
return;
}
if ($in{'source'} >= 2) {
&ui_print_unbuffered_header(undef, $text{'install_title'}, "", "install");
}
else {