Revision b6584d17
Added by Ermal LUÇI over 11 years ago
etc/inc/pkg-utils.inc | ||
---|---|---|
361 | 361 |
global $config, $static_output; |
362 | 362 |
global $builder_package_install; |
363 | 363 |
|
364 |
// Back up /usr/local/lib libraries first if |
|
365 |
// not running from the builder code. |
|
366 |
// also take into account rrd binaries |
|
367 |
if(!$builder_package_install) { |
|
368 |
if(!file_exists("/tmp/pkg_libs.tgz")) { |
|
369 |
$static_output .= "Backing up libraries... "; |
|
370 |
update_output_window($static_output); |
|
371 |
mwexec("/usr/bin/tar czPf /tmp/pkg_libs.tgz `/bin/cat /etc/pfSense_md5.txt | /usr/bin/grep 'local/lib' | /usr/bin/awk '{ print $2 }' | /usr/bin/cut -d'(' -f2 | /usr/bin/cut -d')' -f1`", true); |
|
372 |
mwexec("/usr/bin/tar czPf /tmp/pkg_bins.tgz `/bin/cat /etc/pfSense_md5.txt | /usr/bin/grep 'rrd' | /usr/bin/awk '{ print $2 }' | /usr/bin/cut -d'(' -f2 | /usr/bin/cut -d')' -f1`", true); |
|
373 |
$static_output .= "\n"; |
|
374 |
} |
|
375 |
} |
|
376 |
|
|
377 | 364 |
$id = get_pkg_id($pkg_name); |
378 | 365 |
if ($id >= 0) { |
379 | 366 |
stop_service(get_pkg_internal_name($config['installedpackages']['package'][$id])); |
... | ... | |
399 | 386 |
} |
400 | 387 |
delete_package_xml($pkg_name); |
401 | 388 |
|
402 |
// Restore libraries that we backed up if not |
|
403 |
// running from the builder code. |
|
404 |
if(!$builder_package_install) { |
|
405 |
$static_output .= "Cleaning up... "; |
|
406 |
update_output_window($static_output); |
|
407 |
mwexec("/usr/bin/tar xzPfk /tmp/pkg_libs.tgz -C /", true); |
|
408 |
mwexec("/usr/bin/tar xzPfk /tmp/pkg_bins.tgz -C /", true); |
|
409 |
@unlink("/tmp/pkg_libs.tgz"); |
|
410 |
@unlink("/tmp/pkg_bins.tgz"); |
|
411 |
$static_output .= gettext("done.") . "\n"; |
|
412 |
update_output_window($static_output); |
|
413 |
} |
|
389 |
$static_output .= gettext("done.") . "\n"; |
|
390 |
update_output_window($static_output); |
|
414 | 391 |
} |
415 | 392 |
|
416 | 393 |
function force_remove_package($pkg_name) { |
Also available in: Unified diff
Do not do any operations on system libraries. Nowdays pbis are used and those do not break things by definition