Commit f43922a6 authored by Patrick Schmalstig's avatar Patrick Schmalstig
Browse files

Add support for dev releases (treated as alpha)

parent e1e686bb
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -254,7 +254,9 @@ class Module_admin_make_release
        $version_file = preg_replace($pattern, $replacement, $version_file);

        // Update branch status flag
        if (strpos($new_version, 'alpha') !== false) {
        if (strpos($new_version, 'dev') !== false) {
            $_replacement = 'VERSION_ALPHA';
        } elseif (strpos($new_version, 'alpha') !== false) {
            $_replacement = 'VERSION_ALPHA';
        } elseif (strpos($new_version, 'beta') !== false) {
            $_replacement = 'VERSION_BETA';
@@ -442,7 +444,10 @@ class Module_admin_make_release
        $new_version = $this->get_new_version();

        $release_description = null;
        if (strpos($new_version, 'alpha') !== false) {
        if (strpos($new_version, 'dev') !== false) {
            $release_description = do_lang('DESCRIPTION_RELEASE_DEV');
            $default_necessity = 'unrecommended';
        } elseif (strpos($new_version, 'alpha') !== false) {
            $release_description = do_lang('DESCRIPTION_RELEASE_ALPHA');
            $default_necessity = 'unrecommended';
        } elseif (strpos($new_version, 'beta') !== false) {
@@ -494,7 +499,7 @@ class Module_admin_make_release
            [
                do_lang_tempcode('BUILD_OPTIONS_BLEEDING_EDGE'),
                'bleeding_edge',
                ((strpos($new_version, 'alpha') !== false) || (strpos($new_version, 'beta') !== false)) ? '1' : '0',
                ((strpos($new_version, 'dev') !== false) || (strpos($new_version, 'alpha') !== false) || (strpos($new_version, 'beta') !== false)) ? '1' : '0',
                '',
                false
            ],
+1 −0
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ BUILD_OPTIONS_REBUILD_SQL=Re-build .sql files (if the default database structure
BUILD_OPTIONS_OVERWRITE_KEY_PAIR=Overwrite the key pair for this version if it already exists (you must upload the new keys from <kbd>data_custom/keys</kbd> to the homesite server, same path)
BUILD_OPTIONS_SKIP_DATA_FILES=Skip downloading updated data files (certificate authorities, geolocation, IP whitelists)

DESCRIPTION_RELEASE_DEV=This is an unofficial and unsupported development build.
DESCRIPTION_RELEASE_ALPHA=This version is an alpha release of the next major version of the software.
DESCRIPTION_RELEASE_BETA=This version is a beta release of the next major version of the software.
DESCRIPTION_RELEASE_RC=This version is a release candidate of the next major version of the software.
+4 −4
Original line number Diff line number Diff line
@@ -129,12 +129,12 @@ function get_version_dotted__from_anything(string $any_format) : string
    // Change dashes and spaces to dots
    $dotted = str_replace(['-', ' '], ['.', '.'], $dotted);

    foreach (['alpha', 'beta', 'RC'] as $qualifier) {
    foreach (['alpha', 'beta', 'RC', 'dev'] as $qualifier) {
        $dotted = preg_replace('#\.?' . preg_quote($qualifier, '#') . '\.?#i', '.' . $qualifier, $dotted);
    }

    // Canonical to not have extra .0's on end. Don't really care about what the software stores as we clean this up in our server's version.php - it is crucial that news post and download names are canonical though so version.php works. NB: Latest recommended versions are done via download name and description labelling.
    $dotted = preg_replace('#(\.0)+($|\.alpha|\.beta|\.RC)#', '$2', $dotted);
    $dotted = preg_replace('#(\.0)+($|\.alpha|\.beta|\.dev|\.RC)#', '$2', $dotted);

    return $dotted;
}
@@ -151,7 +151,7 @@ function get_version_components__from_dotted(string $dotted) : array
    $qualifier = null;
    $qualifier_number = null;
    $basis_dotted_number = null;
    foreach (['RC', 'beta', 'alpha'] as $type) {
    foreach (['RC', 'beta', 'alpha', 'dev'] as $type) {
        if (strpos($dotted, '.' . $type) !== false) {
            $qualifier = $type;
            $qualifier_number = intval(substr($dotted, strrpos($dotted, '.' . $type) + strlen('.' . $type)));
@@ -191,7 +191,7 @@ function get_version_components__from_dotted(string $dotted) : array
 */
function get_version_pretty__from_dotted(string $dotted) : string
{
    return preg_replace('#(\.0)*\.(alpha|beta|RC)#', ' ${2}', $dotted);
    return preg_replace('#(\.0)*\.(alpha|beta|RC|dev)#', ' ${2}', $dotted);
}

/**