Revision 71e7de02
Added by Renato Botelho over 4 years ago
src/etc/inc/pkg-utils.inc | ||
---|---|---|
761 | 761 |
$pkg_config = array(); |
762 | 762 |
$id = get_package_id($package_name); |
763 | 763 |
|
764 |
if ($id < 0 || |
|
765 |
!isset($config['installedpackages']['package'][$id]['configurationfile'])) { |
|
764 |
if ($id < 0 || !isset($config['installedpackages']['package'][$id])) { |
|
766 | 765 |
return $pkg_config; |
767 | 766 |
} |
768 | 767 |
|
769 |
$pkg_configurationfile = |
|
770 |
$config['installedpackages']['package'][$id]['configurationfile']; |
|
768 |
$pkg_data = $config['installedpackages']['package'][$id]; |
|
771 | 769 |
|
772 |
if (empty($pkg_configurationfile) || |
|
773 |
!file_exists('/usr/local/pkg/' . $pkg_configurationfile)) { |
|
770 |
if (empty($pkg_data['configurationfile'])) { |
|
771 |
return $pkg_config; |
|
772 |
} |
|
773 |
|
|
774 |
if (!file_exists('/usr/local/pkg/' . $pkg_data['configurationfile'])) { |
|
774 | 775 |
return $pkg_config; |
775 | 776 |
} |
776 | 777 |
|
777 | 778 |
$pkg_config = parse_xml_config_pkg('/usr/local/pkg/' . |
778 |
$pkg_configurationfile, "packagegui");
|
|
779 |
$pkg_data['configurationfile'], "packagegui");
|
|
779 | 780 |
|
780 | 781 |
return $pkg_config; |
781 | 782 |
} |
Also available in: Unified diff
Simplify logic