From: Stephen Soltesz Date: Tue, 13 Apr 2010 16:12:39 +0000 (+0000) Subject: use plc_config.php values to pick default bootcd, otherwise choose last X-Git-Tag: www-register-wizard-4.3-3~3 X-Git-Url: http://git.onelab.eu/?p=www-register-wizard.git;a=commitdiff_plain;h=57f416508ed554a5715807f75c7fd4f2ee2d9eee use plc_config.php values to pick default bootcd, otherwise choose last directory listed by "ls -d /usr/share/bootcd*" --- diff --git a/application/controllers/download.php b/application/controllers/download.php index 5b71081..843d29f 100644 --- a/application/controllers/download.php +++ b/application/controllers/download.php @@ -11,6 +11,7 @@ include 'plc_header.php'; // Common functions require_once 'plc_functions.php'; +require_once 'plc_config.php'; include 'plc_objects.php'; @@ -250,7 +251,16 @@ class Download extends Controller { } function get_bootcd_version() { - $BOOTCD="/usr/share/bootcd"; + // pick default bootcd flavors. need more flexibility + // TODO: find a way to handle 32/64 bit. + if ( defined("PLC_FLAVOUR_NODE_PLDISTRO") ) + { + // This approach only works for 5.0 + $BOOTCD = "/usr/share/bootcd-" . PLC_FLAVOUR_NODE_PLDISTRO . "-" . PLC_FLAVOUR_NODE_FCDISTRO . "-" . PLC_FLAVOUR_NODE_ARCH; + } else { + $BOOTCD = exec ("ls -d /usr/share/bootcd*"); + } + $BOOTCDVERSION="$BOOTCD/build/version.txt"; $version = trim(file_get_contents($BOOTCDVERSION)); $bootcd_version = PLC_NAME . "-BootCD-".$version;