summaryrefslogtreecommitdiffstats
path: root/etc/inc/pkg-utils.inc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2015-05-07 13:27:52 -0300
committerRenato Botelho <garga@FreeBSD.org>2015-05-07 13:27:52 -0300
commit57a608c5b63a3644e8573d6a1e9352e79b17fb06 (patch)
tree5553f48091e57fa12e91f45413350e798e5dba89 /etc/inc/pkg-utils.inc
parent04dd9b0464a437df9a8a44312f4842629b46b415 (diff)
downloadpfsense-57a608c5b63a3644e8573d6a1e9352e79b17fb06.zip
pfsense-57a608c5b63a3644e8573d6a1e9352e79b17fb06.tar.gz
Remove unused function pkg_fetch_recursive()
Diffstat (limited to 'etc/inc/pkg-utils.inc')
-rw-r--r--etc/inc/pkg-utils.inc109
1 files changed, 0 insertions, 109 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc
index 3eee510..74cabd0 100644
--- a/etc/inc/pkg-utils.inc
+++ b/etc/inc/pkg-utils.inc
@@ -296,115 +296,6 @@ function sync_package($package_name) {
}
}
-/*
- * pkg_fetch_recursive: Download and install a FreeBSD PBI package. This function provides output to
- * a progress bar and output window.
- */
-function pkg_fetch_recursive($pkgname, $filename, $dependlevel = 0, $base_url = "") {
- global $static_output, $g, $config;
-
- // Clean up incoming filenames
- $filename = str_replace(" ", " ", $filename);
- $filename = str_replace("\n", " ", $filename);
- $filename = str_replace(" ", " ", $filename);
-
- $pkgs = explode(" ", $filename);
- foreach ($pkgs as $filename) {
- $filename = trim($filename);
- if ($g['platform'] == "nanobsd") {
- $pkgtmpdir = "/usr/bin/env PKG_TMPDIR=/root/ ";
- $pkgstagingdir = "/root/tmp";
- if (!is_dir($pkgstagingdir)) {
- mkdir($pkgstagingdir);
- }
- $pkgstaging = "-o {$pkgstagingdir}/instmp.XXXXXX";
- $fetchdir = $pkgstagingdir;
- } else {
- $fetchdir = $g['tmp_path'];
- }
-
- /* FreeBSD has no PBI's hosted, so fall back to our own URL for now. (Maybe fail to PC-BSD?) */
- $rel = get_freebsd_version();
- $priv_url = "https://files.pfsense.org/packages/{$rel}/All/";
- if (empty($base_url)) {
- $base_url = $priv_url;
- }
- if (substr($base_url, -1) == "/") {
- $base_url = substr($base_url, 0, -1);
- }
- $fetchto = "{$fetchdir}/apkg_{$filename}";
- $static_output .= "\n" . str_repeat(" ", $dependlevel * 2 + 1) . "Downloading {$base_url}/{$filename} ... ";
- if (download_file_with_progress_bar("{$base_url}/{$filename}", $fetchto) !== true) {
- if ($base_url != $priv_url && download_file_with_progress_bar("{$priv_url}/{$filename}", $fetchto) !== true) {
- $static_output .= " could not download from there or {$priv_url}/{$filename}.\n";
- update_output_window($static_output);
- return false;
- } else if ($base_url == $priv_url) {
- $static_output .= " failed to download.\n";
- update_output_window($static_output);
- return false;
- } else {
- $static_output .= " [{$osname} repository]\n";
- update_output_window($static_output);
- }
- }
- $static_output .= " (extracting)\n";
- update_output_window($static_output);
-
- $pkgaddout = "";
-
- $no_checksig = "";
- if (isset($config['system']['pkg_nochecksig'])) {
- $no_checksig = "--no-checksig";
- }
-
- $result = exec("/usr/local/sbin/pbi_add " . $pkgstaging . " -f -v {$no_checksig} " . escapeshellarg($fetchto) . " 2>&1", $pkgaddout, $rc);
- pkg_debug($pkgname . " " . print_r($pkgaddout, true) . "\n");
- if ($rc == 0) {
- $pbi_name = preg_replace('/\.pbi$/','',$filename);
-
- $gb = exec("/usr/local/sbin/pbi_info {$pbi_name} | /usr/bin/awk '/Prefix/ {print $2}'", $pbi_prefix);
- $pbi_prefix = $pbi_prefix[0];
-
- $links = get_pbi_binaries(escapeshellarg($pbi_name));
- foreach ($links as $link) {
- @unlink("/usr/local/{$link['link_name']}");
- @symlink("{$link['target']}","/usr/local/{$link['link_name']}");
- }
-
- $extra_links = array(
- array("target" => "bin", "link_name" => "sbin"),
- array("target" => "local/lib", "link_name" => "lib"),
- array("target" => "local/libexec", "link_name" => "libexec"),
- array("target" => "local/share", "link_name" => "share"),
- array("target" => "local/www", "link_name" => "www"),
- array("target" => "local/etc", "link_name" => "etc")
- );
-
- foreach ($extra_links as $link) {
- if (!file_exists($pbi_prefix . "/" . $link['target'])) {
- continue;
- }
- @rmdir("{$pbi_prefix}/{$link['link_name']}");
- unlink_if_exists("{$pbi_prefix}/{$link['link_name']}");
- @symlink("{$pbi_prefix}/{$link['target']}", "{$pbi_prefix}/{$link['link_name']}");
- }
- pkg_debug("pbi_add successfully completed.\n");
- } else {
- if (is_array($pkgaddout)) {
- foreach ($pkgaddout as $line) {
- $static_output .= " " . $line .= "\n";
- }
- }
-
- update_output_window($static_output);
- pkg_debug("pbi_add failed.\n");
- return false;
- }
- }
- return true;
-}
-
function get_pbi_binaries($pbi) {
$result = array();
OpenPOWER on IntegriCloud