diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-02-17 05:18:58 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-02-17 05:18:58 +0000 |
commit | 1b7df51e651fb45a57c4eeba1a308d965a1653ea (patch) | |
tree | a1210b522c51ac8c7350f19a6a3936090e6c5842 | |
parent | ca5de7de98b8a8c93cae0070689e8614e744b063 (diff) | |
download | pfsense-1b7df51e651fb45a57c4eeba1a308d965a1653ea.zip pfsense-1b7df51e651fb45a57c4eeba1a308d965a1653ea.tar.gz |
Ensure /tmp/y exists before running pkg_delete command.
-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 1b74d6c..6ebca06 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -744,6 +744,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"); @@ -755,11 +760,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; } |