summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-10-10 14:15:41 -0300
committerRenato Botelho <renato@netgate.com>2016-10-10 14:15:51 -0300
commitce6e65199b66018ff2304cd7a6889b41addf6f03 (patch)
tree2ff020e63a00f1488ff6e51b6faa95e582db5988
parent215c86be234b7f37dba4c554e4a36088dc430e12 (diff)
downloadpfsense-ce6e65199b66018ff2304cd7a6889b41addf6f03.zip
pfsense-ce6e65199b66018ff2304cd7a6889b41addf6f03.tar.gz
Create pkg.conf with ABI settings
-rw-r--r--src/etc/inc/pkg-utils.inc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/etc/inc/pkg-utils.inc b/src/etc/inc/pkg-utils.inc
index 0531415..2b21fa9 100644
--- a/src/etc/inc/pkg-utils.inc
+++ b/src/etc/inc/pkg-utils.inc
@@ -1199,6 +1199,21 @@ function pkg_switch_repo($path) {
@unlink("/usr/local/etc/pkg/repos/{$g['product_name']}.conf");
@symlink($path, "/usr/local/etc/pkg/repos/{$g['product_name']}.conf");
+ $abi_file = str_replace('.conf', '.abi', $path);
+ $altabi_file = str_replace('.conf', '.altabi', $path);
+
+ if (file_exists($abi_file) && file_exists($altabi_file)) {
+ $abi = file_get_contents($abi_file);
+ $altabi = file_get_contents($altabi_file);
+
+ $pkg_conf = array(
+ "ABI={$abi}",
+ "ALTABI={$altabi}"
+ );
+
+ file_put_contents("/usr/local/etc/pkg.conf", $pkg_conf);
+ }
+
return pkg_update(true);
}
OpenPOWER on IntegriCloud