Revision 43ad432c
Added by Ermal Luçi over 15 years ago
etc/inc/pkg-utils.inc | ||
---|---|---|
62 | 62 |
|
63 | 63 |
safe_mkdir("/var/db/pkg"); |
64 | 64 |
|
65 |
conf_mount_rw(); |
|
65 | 66 |
$g['platform'] = trim(file_get_contents("/etc/platform")); |
66 |
if($g['platform'] == "pfSense") { |
|
67 |
safe_mkdir("/usr/local/pkg"); |
|
68 |
safe_mkdir("/usr/local/pkg/pf"); |
|
69 |
} else { |
|
70 |
if(!is_dir("/usr/local/pkg") or !is_dir("/usr/local/pkg/pf")) { |
|
71 |
conf_mount_rw(); |
|
67 |
if(!is_dir("/usr/local/pkg") or !is_dir("/usr/local/pkg/pf")) { |
|
72 | 68 |
safe_mkdir("/usr/local/pkg"); |
73 | 69 |
safe_mkdir("/usr/local/pkg/pf"); |
74 |
conf_mount_ro(); |
|
75 |
} |
|
76 | 70 |
} |
77 | 71 |
|
78 | 72 |
$version = split("-", trim(file_get_contents("/etc/version"))); |
... | ... | |
410 | 404 |
|
411 | 405 |
function install_package($package, $pkg_info = "") { |
412 | 406 |
global $g, $config, $pkg_interface, $fd_log, $static_output, $pkg_interface, $restart_sync; |
407 |
/* safe side. Write config below will send to ro again. */ |
|
408 |
conf_mount_rw(); |
|
409 |
|
|
413 | 410 |
if($pkg_interface == "console") |
414 | 411 |
echo "\n"; |
415 | 412 |
/* open logfiles and begin installation */ |
... | ... | |
651 | 648 |
$static_output = "Loading package instructions..."; |
652 | 649 |
update_output_window($static_output); |
653 | 650 |
fwrite($fd_log, "require_once('{$pkg_config['include_file']}')\n"); |
654 |
require_once($pkg_config['include_file']); |
|
651 |
if (file_exists($pkg_config['include_file'])) |
|
652 |
require_once($pkg_config['include_file']); |
|
655 | 653 |
} |
656 | 654 |
/* sidebar items */ |
657 | 655 |
if(is_array($pkg_config['menu'])) { |
... | ... | |
745 | 743 |
if($pkg_config['include_file'] <> "") { |
746 | 744 |
$static_output .= "\nLoading package instructions...\n"; |
747 | 745 |
update_output_window($static_output); |
748 |
require_once($pkg_config['include_file']); |
|
746 |
if (file_exists($pkg_config['include_file'])) |
|
747 |
require_once($pkg_config['include_file']); |
|
749 | 748 |
} |
750 | 749 |
} |
751 | 750 |
$static_output .= "\nStarting package deletion for {$pkg_info['name']}...\n"; |
Also available in: Unified diff
Ticket #396. Try to fix issues with missing include files or filesystem being in ro mode during operations.