diff --git a/software/index.cgi b/software/index.cgi index 1b65d031e..aaf63ad21 100755 --- a/software/index.cgi +++ b/software/index.cgi @@ -37,19 +37,18 @@ print &ui_hr(); print &ui_subheading($text{'index_install'}); print &text('index_installmsg', &package_system()),"
\n";
-$upid = time().$$;
-print &ui_form_start("install_pack.cgi?id=$upid", "form-data", undef,
- &read_parse_mime_javascript($upid, [ "upload" ])),"\n";
@opts = ( );
-push(@opts, [ 0, $text{'index_local'},
- &ui_textbox("local", undef, 50)."\n".
- &file_chooser_button("local", 0, 2) ]);
-push(@opts, [ 1, $text{'index_uploaded'},
- &ui_upload("upload", 50) ]);
-push(@opts, [ 2, $text{'index_ftp'},
- &ui_textbox("url", undef, 50)."\n".
- ($has_search_system ? &capture_function_output(
- \&search_system_input) : "") ]);
+if (!$no_package_install) {
+ push(@opts, [ 0, $text{'index_local'},
+ &ui_textbox("local", undef, 50)."\n".
+ &file_chooser_button("local", 0, 2) ]);
+ push(@opts, [ 1, $text{'index_uploaded'},
+ &ui_upload("upload", 50) ]);
+ push(@opts, [ 2, $text{'index_ftp'},
+ &ui_textbox("url", undef, 50)."\n".
+ ($has_search_system ? &capture_function_output(
+ \&search_system_input) : "") ]);
+ }
if ($has_update_system) {
push(@opts, [ 3, $text{$update_system.'_input'},
&ui_textbox("update", undef, 30)."\n".
@@ -57,9 +56,20 @@ if ($has_update_system) {
(defined(&show_update_system_opts) &&
($opts = &show_update_system_opts()) ? "
".$opts : "") ]);
}
-print &ui_radio_table("source", 0, \@opts);
-print &ui_submit($text{'index_installok'}),"\n";
-print &ui_form_end();
+if (@opts) {
+ $upid = time().$$;
+ print &ui_form_start("install_pack.cgi?id=$upid", "form-data", undef,
+ &read_parse_mime_javascript($upid, [ "upload" ])),"\n";
+ if (@opts > 1) {
+ print &ui_radio_table("source", $opts[0]->[0], \@opts);
+ }
+ else {
+ print "",$opts[0]->[1]," ",$opts[0]->[2],"
\n"; + print &ui_hidden("source", $opts[0]->[0]); + } + print &ui_submit($text{'index_installok'}),"\n"; + print &ui_form_end(); + } # Show search form by file, if supported by package system if (!$no_package_filesearch) { diff --git a/software/pkgsrc-lib.pl b/software/pkgsrc-lib.pl index 2ca0db8e8..30be1d178 100644 --- a/software/pkgsrc-lib.pl +++ b/software/pkgsrc-lib.pl @@ -2,6 +2,7 @@ $ENV{'PATH'} .= ":/usr/pkg/bin:/usr/pkg/sbin"; $pkgin_sqlite_db = "/var/db/pkgin/pkgin.db"; +$no_package_install = 1; sub list_package_system_commands {