diff options
Diffstat (limited to 'etc/inc/pkg-utils.inc')
-rw-r--r-- | etc/inc/pkg-utils.inc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index 94195d2..91a211d 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -99,6 +99,21 @@ conf_mount_ro(); * ******/ function remove_freebsd_package($packagestring) { + exec("/usr/local/sbin/pbi_info {$packagestring} | /usr/bin/awk '/Prefix/ {print $2}'",$pbidir); + $pbidir = $pbidir[0]; + $linkdirs = array('bin','sbin'); + foreach($linkdirs as $dir) { + if(is_dir("{$pbidir}/{$dir}")) { + file_put_contents('/tmp/vcoque.debug',"{$pbidir}/{$dir}",FILE_APPEND); + $files = scandir("{$pbidir}/{$dir}"); + foreach($files as $f) { + if($f != '.' && $f != '..') { + unlink("/usr/local/{$dir}/{$f}"); + } + } + } + } + exec("/usr/local/sbin/pbi_delete {$packagestring} 2>>/tmp/pbi_delete_errors.txt"); } |