summaryrefslogtreecommitdiffstats
path: root/etc/inc/pkg-utils.inc
diff options
context:
space:
mode:
authorVinicius Coque <vinicius.coque@bluepex.com>2011-09-29 00:49:11 -0300
committerVinicius Coque <vinicius.coque@bluepex.com>2011-09-29 00:49:29 -0300
commit531070641d91a40d826da26bfb5c1f47c82e912f (patch)
tree6836d8f68199e1b3bbf0d962f08c80a6b9402b3e /etc/inc/pkg-utils.inc
parent569aeae7918bc5c4c0a2f97f3fdfaeee322baf91 (diff)
downloadpfsense-531070641d91a40d826da26bfb5c1f47c82e912f.zip
pfsense-531070641d91a40d826da26bfb5c1f47c82e912f.tar.gz
remove symlinks for PBI binaries
Diffstat (limited to 'etc/inc/pkg-utils.inc')
-rw-r--r--etc/inc/pkg-utils.inc15
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");
}
OpenPOWER on IntegriCloud