diff options
author | Renato Botelho <garga@FreeBSD.org> | 2015-05-07 13:37:39 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2015-05-07 13:37:39 -0300 |
commit | 4d4e9b060319386aef900cde3a62831a446e70ce (patch) | |
tree | f0b6d73ecf87cd1ccbd574a734ffa118bde7b468 /etc/phpshellsessions/gitsync | |
parent | 7379d80ff033d2e82d3b33bc76bc826aefacbe4d (diff) | |
download | pfsense-4d4e9b060319386aef900cde3a62831a446e70ce.zip pfsense-4d4e9b060319386aef900cde3a62831a446e70ce.tar.gz |
Fix git path and use pkg_install() to install it on gitsync
Diffstat (limited to 'etc/phpshellsessions/gitsync')
-rw-r--r-- | etc/phpshellsessions/gitsync | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/etc/phpshellsessions/gitsync b/etc/phpshellsessions/gitsync index 617d816..b9bda60 100644 --- a/etc/phpshellsessions/gitsync +++ b/etc/phpshellsessions/gitsync @@ -12,7 +12,7 @@ require_once("rrd.inc"); require_once("pfsense-utils.inc"); $GIT_PKG = "git"; // Either "git" or the full package URL -$GIT_BIN= "/usr/pbi/bin/git"; +$GIT_BIN= "/usr/local/bin/git"; $GIT_REPO = "git://github.com/pfsense/pfsense.git"; $DEFAULT_BRANCH = "master"; $CODIR = "/root/pfsense"; @@ -76,37 +76,13 @@ unlink_if_exists("/tmp/config.cache"); conf_mount_rw(); if (!file_exists($GIT_BIN)) { - echo "Cannot find git, fetching...\n"; - require_once("config.inc"); - require_once("util.inc"); require_once("pkg-utils.inc"); - echo "Trying to fetch package info..."; - $pkg_info = get_pkg_info(); - if ($pkg_info) { - echo " Done.\n"; - } else { - $xmlrpc_base_url = get_active_xml_rpc_base_url(); - echo "\n" . sprintf(gettext(' >>> Unable to communicate with %1$s. Please verify DNS and interface configuration, and that %2$s has functional Internet connectivity.'), $xmlrpc_base_url, $g['product_name']) . "\n"; + echo "Cannot find git, installing...\n"; + if (!pkg_install('git')) { + echo "\nERROR: Unable to install git pkg.\n"; return; } - if (empty($pkg_info["git"])) { - echo "Can't locate git package in pfSense repo. Using FreeBSD pkg repo.."; - - if (($g['platform'] == "nanobsd")) { - $pkgtmpdir = "/usr/bin/env PKG_TMPDIR=/root/ "; - $pkgstagingdir = "/root/tmp"; - if (!is_dir($pkgstagingdir)) { - mkdir($pkgstagingdir); - } - $pkgstaging = "-t {$pkgstagingdir}/instmp.XXXXXX"; - } - system("{$pkgtmpdir}/usr/sbin/pkg_add {$pkgstaging} -r {$GIT_PKG}"); - - } else { - install_package("git", $pkg_info["git"], true); - echo "Done.\n"; - } } # Remove mainline if exists (older) |