From be3228221400d287b1832ac6bff4142eceffca46 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 2 Feb 2017 10:36:22 +0100 Subject: [PATCH] maintain an maintenance_release version in api/setup/setup.inc.php, also move update-checker images to api --- api/setup/setup.inc.php | 2 ++ api/src/Framework/Updates.php | 26 ++++++++------- .../default/images/security-update.png | Bin 0 -> 3757 bytes api/templates/default/images/update.png | Bin 0 -> 4467 bytes doc/rpm-build/checkout-build-archives.php | 31 ++++++++++++++++-- header.inc.php.template | 2 +- 6 files changed, 47 insertions(+), 14 deletions(-) create mode 100644 api/templates/default/images/security-update.png create mode 100644 api/templates/default/images/update.png diff --git a/api/setup/setup.inc.php b/api/setup/setup.inc.php index 80bdaec128..3e18cfdd51 100644 --- a/api/setup/setup.inc.php +++ b/api/setup/setup.inc.php @@ -14,6 +14,8 @@ $setup_info['api']['name'] = 'api'; $setup_info['api']['title'] = 'EGroupware API'; $setup_info['api']['version'] = '16.9.001'; $setup_info['api']['versions']['current_header'] = '1.29'; +// maintenance release in sync with changelog in doc/rpm-build/debian.changes +$setup_info['api']['versions']['maintenance_release'] = '16.1.20170118'; $setup_info['api']['enable'] = 3; $setup_info['api']['app_order'] = 1; $setup_info['api']['license'] = 'GPL'; diff --git a/api/src/Framework/Updates.php b/api/src/Framework/Updates.php index 68a9a57550..94b6bef301 100644 --- a/api/src/Framework/Updates.php +++ b/api/src/Framework/Updates.php @@ -81,12 +81,12 @@ class Updates { return null; } - return Html::a_href(Html::image('phpgwapi', 'security-update', lang('EGroupware security update %1 needs to be installed!', $versions['security'])), + return Html::a_href(Html::image('api', 'security-update', lang('EGroupware security update %1 needs to be installed!', $versions['security'])), 'http://www.egroupware.org/changelog', null, ' target="_blank"'); } if ($GLOBALS['egw_info']['user']['apps']['admin'] && version_compare($api, $versions['current'], '<')) { - return Html::a_href(Html::image('phpgwapi', 'update', lang('EGroupware maintenance update %1 available', $versions['current'])), + return Html::a_href(Html::image('api', 'update', lang('EGroupware maintenance update %1 available', $versions['current'])), 'http://www.egroupware.org/changelog', null, ' target="_blank"'); } } @@ -121,7 +121,7 @@ class Updates } /** - * Get current API version from changelog or database, whichever is bigger + * Get current API version from api/setup/setup.inc.php "maintenance_release" or database, whichever is bigger * * @param string &$changelog on return path to changelog * @return string @@ -130,16 +130,20 @@ class Updates { $changelog = EGW_SERVER_ROOT.'/doc/rpm-build/debian.changes'; - return Cache::getTree(__CLASS__, 'api_version', function() use ($changelog) + return Cache::getTree(__CLASS__, 'api_version', function() { - $version = preg_replace('/[^0-9.]/', '', $GLOBALS['egw_info']['server']['versions']['phpgwapi']); - // parse version from changelog - $matches = null; - if (($f = fopen($changelog, 'r')) && preg_match('/egroupware-epl \(([0-9.]+)/', fread($f, 80), $matches) && - version_compare($version, $matches[1], '<')) + $version = preg_replace('/[^0-9.]/', '', $GLOBALS['egw_info']['server']['versions']['api']); + + if (empty($GLOBALS['egw_info']['server']['versions']['maintenance_release'])) { - $version = $matches[1]; - fclose($f); + $setup_info = null; + include (EGW_SERVER_ROOT.'/api/setup/setup.inc.php'); + $GLOBALS['egw_info']['server']['versions'] += $setup_info['api']['versions']; + unset($setup_info); + } + if (version_compare($version, $GLOBALS['egw_info']['server']['versions']['maintenance_release'], '<')) + { + $version = $GLOBALS['egw_info']['server']['versions']['maintenance_release']; } return $version; }, array(), 300); diff --git a/api/templates/default/images/security-update.png b/api/templates/default/images/security-update.png new file mode 100644 index 0000000000000000000000000000000000000000..1a27f00cf0f02ec5efa568329a0a002fbcf17418 GIT binary patch literal 3757 zcmV;e4pQ-nP)};7D3^P~!2kdbPf0{URCt`tntO~~^>xQT=l8pJ9=mJr z8!xiKE9|Tvs1QV`BNIh5B+xX36q>jtp@gU|6{My4qqL2xR%z5$m5N%aZV(hxR4`Gq zl?YTk6yxwH25hG^i80jgu!+&yyK8%&^St+W`p2Ewot>RKJL}mNAL(j;_qTJ;J>Tzn z-a7+Lih`XQ9PFJK9PD}pyl;U4q*=ZHU*a{bVf}h992#oVeBSl<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R?3p*$7w);Og^A19=-JuTg!|8yUGnoU^I+cK-9Bhg`$TUA;&3w%4OExB97VvGYd2*Odz?bd7qw`tMTjw-iDv*9`%` z5QE~bU5tQw>o}>|vS^HeCCPI1`AR)Y^?oDWr5bd3U2A{IvRnkz)4LogP(E)8Y%Td; X{p``cx-eY700000NkvXXu0mjf>HIhq literal 0 HcmV?d00001 diff --git a/api/templates/default/images/update.png b/api/templates/default/images/update.png new file mode 100644 index 0000000000000000000000000000000000000000..e290f917b0be994020d4d345d3a51d66010ac88e GIT binary patch literal 4467 zcmV-(5sdDMP)};7D3^P~!2kde6-h)vRCt{2nR{?t)qTf5=iGg1cO|VJ z7JkTHpXLY%L3c@3D}Zly;rMUN&C3>{QAeeE3H+xVaeUr_M7w`4ef+b4x zczD550XVds%ioT5=Z%1a_ps(rD>q-t+#Or7MEF&pDi&$}@Mlz@c9E^&&iT@jd$8U zP9NUJrv=nZ^A5H00VRBS=?%A9fttlgvWv=PYm^u^9{3~+=S#ooWd34+kO+hWnU=f$ z!oT?DyDPQN|C6>>^MNxBit8{PdodRe5Ug2%zpBny4j-B~ z{ic!mBS16cjEyO!HMMKjv+~{tRkU&CwOAZ&Yvs$kZ^BnNe8*NS{$7#oxZ1WCL} zc*O_tRa9!5y_pv5w-voSUzxUlwt|I%>*b-LJSx?i_Z!oS_2A(hzqpuFsApg2U-gL*C=Ji ztw53;SU9Y>^43fGCgC}rO-AJ+rYxzx#j0(BoLE||5d`^1L7XfRp zWT@?o8w2pwyE{8cl)JeiCe&O`z0-n~0jYBA!86sM=H7&L2l*EiO-iXIfn|t9jdAtxN2{};nguEptMdnAwfL*t7Fw_jNxtO;K{at0 zP#_|JV3G-R(|hn=`+Jtq$Ym#O_QaP0LI72_lEnElNNy}qS;K$MD*+pyp#RV|u2q`dnM6;Ze$#Cl zt&pBW$dCut9zoe@uY}d^u4{!-6a5J{5YKWoWzUF~51gDgZ!+LQD^QU-2v#$2>bac2 z4_AJV%%u=e_AIdBG4>1G9zT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002ovPDHLk FV1kWcxe@>X literal 0 HcmV?d00001 diff --git a/doc/rpm-build/checkout-build-archives.php b/doc/rpm-build/checkout-build-archives.php index 50efbc5d92..d5899c091f 100755 --- a/doc/rpm-build/checkout-build-archives.php +++ b/doc/rpm-build/checkout-build-archives.php @@ -595,13 +595,16 @@ function do_editchangelog() throw new Exception("Changelog '$changelog' not found!"); } file_put_contents($changelog, update_changelog(file_get_contents($changelog))); + + update_api_setup($api_setup=$config['checkoutdir'].'/api/setup/setup.inc.php'); + if (file_exists($config['checkoutdir'].'/.git')) { - $cmd = $config['git']." commit -m 'Changelog for $config[version].$config[packaging]' ".$changelog; + $cmd = $config['git']." commit -m 'Changelog for $config[version].$config[packaging]' ".$changelog.' '.$api_setup; } else { - $cmd = $svn." commit -m 'Changelog for $config[version].$config[packaging]' ".$changelog; + $cmd = $svn." commit -m 'Changelog for $config[version].$config[packaging]' ".$changelog.' '.$api_setup; } run_cmd($cmd); @@ -875,6 +878,30 @@ function update_changelog($content) return $content; } +/** + * Update content of api/setup/setup.inc.php file with new maintenance version + * + * @param string $path full path to "api/setup/setup.inc.php" + */ +function update_api_setup($path) +{ + global $config; + + if (!($content = file_get_contents($path))) + { + throw new Exception("Could not read file '$path' to update maintenance-version!"); + } + + $content = preg_replace('/'.preg_quote("\$setup_info['api']['versions']['maintenance_release']", '/').'[^;]+;', + "\$setup_info['api']['versions']['maintenance_release'] = '".$config['version'].'.'.$config['packaging']."';", + $content); + + if (!file_put_contents($path, $content)) + { + throw new Exception("Could not update file '$path' with maintenance-version!"); + } +} + /** * Sign sha1sum file */ diff --git a/header.inc.php.template b/header.inc.php.template index 4e952ebb64..3ec4054b8c 100644 --- a/header.inc.php.template +++ b/header.inc.php.template @@ -52,8 +52,8 @@ $GLOBALS['egw_info']['server']['mcrypt_iv'] = '{MCRYPT_IV}'; $GLOBALS['egw_info']['flags']['page_start_time'] = microtime(true); include(EGW_SERVER_ROOT.'/api/setup/setup.inc.php'); +$GLOBALS['egw_info']['server']['versions'] = $setup_info['api']['versions']; $GLOBALS['egw_info']['server']['versions']['phpgwapi'] = $GLOBALS['egw_info']['server']['versions']['api'] = $setup_info['api']['version']; -$GLOBALS['egw_info']['server']['versions']['current_header'] = $setup_info['api']['versions']['current_header']; unset($setup_info); $GLOBALS['egw_info']['server']['versions']['header'] = '1.29';