split codename and version from version field in config-xml file as this eases automation

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2015-02-11 07:15:05 +01:00
parent c482db8c89
commit 1f24ca9ba2
6 changed files with 14 additions and 4 deletions

View File

@@ -195,6 +195,9 @@ function getCompleteDistroName($cparser)
{ {
// get distro-info // get distro-info
$dist_display = $cparser->distributionName; $dist_display = $cparser->distributionName;
if ($cparser->distributionCodename != '') {
$dist_display .= " ".$cparser->distributionCodename;
}
if ($cparser->distributionVersion != '') { if ($cparser->distributionVersion != '') {
$dist_display .= " (" . $cparser->distributionVersion . ")"; $dist_display .= " (" . $cparser->distributionVersion . ")";
} }

View File

@@ -53,6 +53,12 @@ class ConfigParser {
*/ */
public $distributionName = ''; public $distributionName = '';
/**
* Codename of the distribution this configuration is for
* @var string
*/
public $distributionCodename = '';
/** /**
* Version of the distribution this configuration is for * Version of the distribution this configuration is for
* @var string * @var string
@@ -99,6 +105,7 @@ class ConfigParser {
switch ((string)$key) { switch ((string)$key) {
case "name": $this->distributionName = (string)$value; break; case "name": $this->distributionName = (string)$value; break;
case "version": $this->distributionVersion = (string)$value; break; case "version": $this->distributionVersion = (string)$value; break;
case "codename": $this->distributionCodename = (string)$value; break;
case "deprecated": (string)$value == 'true' ? $this->deprecated = true : $this->deprecated = false; break; case "deprecated": (string)$value == 'true' ? $this->deprecated = true : $this->deprecated = false; break;
} }
} }

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<froxlor> <froxlor>
<distribution name="Gentoo" version="Base System release 2.2"> <distribution name="Gentoo" version="2.2">
<services> <services>
<!-- HTTP --> <!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}"> <service type="http" title="{{lng.admin.configfiles.http}}">

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<froxlor> <froxlor>
<distribution name="Ubuntu" version="Precise, 12.04"> <distribution name="Ubuntu" codename="Precise" version="12.04">
<services> <services>
<!-- HTTP --> <!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}"> <service type="http" title="{{lng.admin.configfiles.http}}">

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<froxlor> <froxlor>
<distribution name="Ubuntu" version="Trusty, 14.04"> <distribution name="Ubuntu" codename="Trusty" version="14.04">
<services> <services>
<!-- HTTP --> <!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}"> <service type="http" title="{{lng.admin.configfiles.http}}">

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<froxlor> <froxlor>
<distribution name="Debian" version="Wheezy, 7.x"> <distribution name="Debian" codename="Wheezy" version="7.x">
<services> <services>
<!-- HTTP --> <!-- HTTP -->
<service type="http" title="{{lng.admin.configfiles.http}}"> <service type="http" title="{{lng.admin.configfiles.http}}">