diff options
author | jim-p <jimp@pfsense.org> | 2011-02-26 11:34:19 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2011-02-26 11:34:19 -0500 |
commit | 73d885d7c4fd6a9900fc59c7c6b9aabf5667ffb5 (patch) | |
tree | c6506377bc323f8b3f492c9c2408fdcf1504efbc /etc | |
parent | 17e7a243508c1c60a027716703a1bc7687ae0033 (diff) | |
download | pfsense-73d885d7c4fd6a9900fc59c7c6b9aabf5667ffb5.zip pfsense-73d885d7c4fd6a9900fc59c7c6b9aabf5667ffb5.tar.gz |
Ensure the pkg staging area exists on nanobsd before trying to use it.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/pkg-utils.inc | 7 | ||||
-rw-r--r-- | etc/phpshellsessions/gitsync | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index 3f901e2..a97de3a 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -453,8 +453,11 @@ function pkg_fetch_recursive($pkgname, $filename, $dependlevel = 0, $base_url = if (($g['platform'] == "nanobsd") || ($g['platform'] == "embedded")) { $pkgtmpdir = "/usr/bin/env PKG_TMPDIR=/root/ "; - $pkgstaging = "-t /root/tmp/instmp.XXXXXX"; - $fetchdir = "/root/tmp/"; + $pkgstagingdir = "/root/tmp"; + if (!is_dir($pkgstagingdir)) + mkdir($pkgstagingdir); + $pkgstaging = "-t {$pkgstagingdir}/instmp.XXXXXX"; + $fetchdir = $pkgstagingdir; } else { $fetchdir = $g['tmp_path']; } diff --git a/etc/phpshellsessions/gitsync b/etc/phpshellsessions/gitsync index aaca2c7..d0be7a1 100644 --- a/etc/phpshellsessions/gitsync +++ b/etc/phpshellsessions/gitsync @@ -29,7 +29,10 @@ if(!file_exists("/usr/local/bin/git")) { echo "Cannot find git, fetching..."; if (($g['platform'] == "nanobsd") || ($g['platform'] == "embedded")) { $pkgtmpdir = "/usr/bin/env PKG_TMPDIR=/root/ "; - $pkgstaging = "-t /root/tmp/instmp.XXXXXX"; + $pkgstagingdir = "/root/tmp"; + if (!is_dir($pkgstagingdir)) + mkdir($pkgstagingdir); + $pkgstaging = "-t {$pkgstagingdir}/instmp.XXXXXX"; } system("{$pkgtmpdir}/usr/sbin/pkg_add {$pkgstaging} -r git"); } |