Skip to content

Commit

Permalink
Homepage|Build Repository: Doomsday expects JSON object graphs for Pa…
Browse files Browse the repository at this point in the history
…ckages with two components

Existing versions of Doomsday's VersionInfo parser minimally expects
version numbers containing at least the major and minor components.
Unfortunately this means we'll have to return fully specified numbers
so as to avoid crashing existing, old Doomsday installs (usually our
policy is to omit trailing zero components in version numbers).
  • Loading branch information
danij-deng committed Jun 7, 2015
1 parent 2bb5e9b commit dcb7d6f
Showing 1 changed file with 15 additions and 20 deletions.
35 changes: 15 additions & 20 deletions web/plugins/buildrepository/packages/basepackage.class.php
@@ -1,26 +1,20 @@
<?php
/**
* @file basepackage.class.php
* Abstract base for all Package objects.
/** @file basepackage.class.php Abstract base for all Package objects.
*
* @section License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
* @authors Copyright © 2009-2015 Daniel Swanson <danij@dengine.net>
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* @author Copyright &copy; 2009-2013 Daniel Swanson <danij@dengine.net>
* <small>This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. This program is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details. You should have received a copy of the GNU
* General Public License along with this program; if not, see:
* http://www.gnu.org/licenses</small>
*/

includeGuard('BasePackage');
Expand Down Expand Up @@ -101,7 +95,8 @@ public function populateGraphTemplate(&$tpl)
$tpl['fulltitle'] = $this->composeFullTitle();

// Textual version representation.
$tpl['version'] = is_null($this->version)? '0' : "{$this->version}";
/// @note Older versions of Doomsday assume a string with all version components specified.
$tpl['version'] = is_null($this->version)? '0' : $this->version->asText();

// Component version representation.
$tpl['version_major'] = is_null($this->version)? 0 : $this->version->major;
Expand Down

0 comments on commit dcb7d6f

Please sign in to comment.