diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-02-17 05:18:52 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-02-17 05:18:52 +0000 |
commit | 1af187a1925ae95681e75b3cb29f2ba7c092773a (patch) | |
tree | 99120d942fa2dcad302940043f817ef06143116c /etc | |
parent | 5daf170812d1a524be530663b006b9a4140098b2 (diff) | |
download | pfsense-1af187a1925ae95681e75b3cb29f2ba7c092773a.zip pfsense-1af187a1925ae95681e75b3cb29f2ba7c092773a.tar.gz |
Ensure /tmp/y exists before running pkg_delete command.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/pkg-utils.inc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index 7b4aa95..3225195 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -742,6 +742,11 @@ function delete_package($pkg, $pkgid) { function delete_package_recursive($pkg) { global $config, $g; + $fd = fopen("{$g['tmp_path']}/y", "w"); + for($line = 0; $line < 10; $line++) { + fwrite($fd, "y\n"); + } + fclose($fd); $info = ""; exec("/usr/sbin/pkg_info -r " . $pkg . " 2>&1", $info); exec("cat {$g['tmp_path']}/y | /usr/sbin/pkg_delete " . $pkg ." > /dev/null 2>&1"); @@ -753,11 +758,6 @@ function delete_package_recursive($pkg) { $depend = trim(array_pop(explode(":", $line))); if(in_array($depend, $pkgdb)) delete_package_recursive($depend); } - $fd = fopen("{$g['tmp_path']}/y", "w"); - for($line = 0; $line < 10; $line++) { - fwrite($fd, "y\n"); - } - fclose($fd); return; } |