From 0eb1f1009538bd3253c20bc35351e53cd752c30d Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 28 Nov 2018 09:30:09 +0100 Subject: [PATCH] firmware: rename "opnsense" version file to "core" We already have "kernel" and "base" and plugins also follow this pattern by only registering its name once per devel or release version. This kills ambiguity for "opnsense" vs. "opnsense-version" and makes it more branding friendly. Suffice to say "core", "kernel" and "base" are reserved names and also align with tools.git. --- .gitignore | 2 +- Makefile | 4 ++-- plist | 2 +- src/etc/inc/config.inc | 2 +- src/man/man8/opnsense-version.8 | 2 +- .../mvc/app/controllers/OPNsense/Base/ControllerBase.php | 2 +- src/opnsense/version/{opnsense.in => core.in} | 0 src/sbin/opnsense-version | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) rename src/opnsense/version/{opnsense.in => core.in} (100%) diff --git a/.gitignore b/.gitignore index cec17ae20..2b1d712a9 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,6 @@ /src/opnsense/changelog /src/www/wpad.dat /src/opnsense/version/* -!/src/opnsense/version/opnsense.in +!/src/opnsense/version/core.in .idea/ /src/opnsense/www/.htrouter.php diff --git a/Makefile b/Makefile index 086e99086..eaafa4fe1 100644 --- a/Makefile +++ b/Makefile @@ -154,8 +154,8 @@ want-${WANT}: mount: @if [ ! -f ${WRKDIR}/.mount_done ]; then \ echo -n "Enabling core.git live mount..."; \ - sed ${SED_REPLACE} ${.CURDIR}/src/opnsense/version/opnsense.in > \ - ${.CURDIR}/src/opnsense/version/opnsense; \ + sed ${SED_REPLACE} ${.CURDIR}/src/opnsense/version/core.in > \ + ${.CURDIR}/src/opnsense/version/core; \ mount_unionfs ${.CURDIR}/src ${LOCALBASE}; \ touch ${WRKDIR}/.mount_done; \ echo "done"; \ diff --git a/plist b/plist index a91564bfb..81dfd73ab 100644 --- a/plist +++ b/plist @@ -862,7 +862,7 @@ /usr/local/opnsense/site-python/sqlite3_helper.py /usr/local/opnsense/site-python/watchers/__init__.py /usr/local/opnsense/site-python/watchers/dhcpd.py -/usr/local/opnsense/version/opnsense +/usr/local/opnsense/version/core /usr/local/opnsense/www/api.php /usr/local/opnsense/www/css/bootstrap-datepicker3.min.css /usr/local/opnsense/www/css/bootstrap-select-1.13.3.css diff --git a/src/etc/inc/config.inc b/src/etc/inc/config.inc index 52d0c8576..f0959e8d7 100644 --- a/src/etc/inc/config.inc +++ b/src/etc/inc/config.inc @@ -30,7 +30,7 @@ */ /* XXX make this a getter function for traceability */ -$g = json_decode(file_get_contents('/usr/local/opnsense/version/opnsense'), true); +$g = json_decode(file_get_contents('/usr/local/opnsense/version/core'), true); openlog($g['product_id'], LOG_ODELAY, LOG_USER); register_shutdown_function('closelog'); diff --git a/src/man/man8/opnsense-version.8 b/src/man/man8/opnsense-version.8 index 5c12f606c..3274d23c3 100644 --- a/src/man/man8/opnsense-version.8 +++ b/src/man/man8/opnsense-version.8 @@ -74,7 +74,7 @@ Return the product version website. .El .Sh FILES .Bl -tag -width Ds -.It Pa /usr/local/opnsense/version/opnsense +.It Pa /usr/local/opnsense/version/core The version metadata file of the release package. .El .Sh EXIT STATUS diff --git a/src/opnsense/mvc/app/controllers/OPNsense/Base/ControllerBase.php b/src/opnsense/mvc/app/controllers/OPNsense/Base/ControllerBase.php index 1b11107c5..c3b89d78a 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/Base/ControllerBase.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/Base/ControllerBase.php @@ -191,7 +191,7 @@ class ControllerBase extends ControllerRoot } // parse product properties, use template (.in) when not found - $firmware_product_fn = __DIR__.'/../../../../../version/opnsense'; + $firmware_product_fn = __DIR__.'/../../../../../version/core'; $firmware_product_fn = !is_file($firmware_product_fn) ? $firmware_product_fn .".in" : $firmware_product_fn; $product_vars = json_decode(file_get_contents($firmware_product_fn), true); foreach ($product_vars as $product_key => $product_var) { diff --git a/src/opnsense/version/opnsense.in b/src/opnsense/version/core.in similarity index 100% rename from src/opnsense/version/opnsense.in rename to src/opnsense/version/core.in diff --git a/src/sbin/opnsense-version b/src/sbin/opnsense-version index 63d6ddd97..35e66753f 100755 --- a/src/sbin/opnsense-version +++ b/src/sbin/opnsense-version @@ -27,7 +27,7 @@ VERSIONDIR="/usr/local/opnsense/version" OPENSSL="/usr/local/bin/openssl" OUTPUT= -DO_PKG="-p opnsense" +DO_PKG="-p core" DO_SIZE= while getopts p:s OPT; do @@ -64,7 +64,7 @@ if [ ! -f ${VERSION} ]; then exit 1 fi -if [ "${DO_PKG}" != "-p opnsense" ]; then +if [ "${DO_PKG}" != "-p core" ]; then cat ${VERSION} exit 0 fi