Merge pull request #22264 from owncloud/read-version-from-info.xml-only

No longer evaluate appinfo/version
This commit is contained in:
Thomas Müller 2016-02-11 14:28:51 +01:00
commit 207c1a661b
6 changed files with 6 additions and 19 deletions

View File

@ -564,7 +564,7 @@ class OC_App {
} }
/** /**
* get the last version of the app, either from appinfo/version or from appinfo/info.xml * get the last version of the app from appinfo/info.xml
* *
* @param string $appId * @param string $appId
* @return string * @return string
@ -584,15 +584,10 @@ class OC_App {
* @return string * @return string
*/ */
public static function getAppVersionByPath($path) { public static function getAppVersionByPath($path) {
$versionFile = $path . '/appinfo/version';
$infoFile = $path . '/appinfo/info.xml'; $infoFile = $path . '/appinfo/info.xml';
if (is_file($versionFile)) {
return trim(file_get_contents($versionFile));
} else {
$appData = self::getAppInfo($infoFile, true); $appData = self::getAppInfo($infoFile, true);
return isset($appData['version']) ? $appData['version'] : ''; return isset($appData['version']) ? $appData['version'] : '';
} }
}
/** /**

View File

@ -297,9 +297,6 @@ class AppManager implements IAppManager {
/** /**
* Returns the app information from "appinfo/info.xml". * Returns the app information from "appinfo/info.xml".
* *
* If no version was present in "appinfo/info.xml", reads it
* from the external "appinfo/version" file instead.
*
* @param string $appId app id * @param string $appId app id
* *
* @return array app iinfo * @return array app iinfo

View File

@ -390,16 +390,11 @@ class OC_Installer{
} }
// check if the ocs version is the same as the version in info.xml/version // check if the ocs version is the same as the version in info.xml/version
$versionFile= $extractDir.'/appinfo/version';
if(is_file($versionFile)) {
$version = trim(file_get_contents($versionFile));
}else{
$version = trim($info['version']); $version = trim($info['version']);
}
if(isset($data['appdata']['version']) && $version<>trim($data['appdata']['version'])) { if(isset($data['appdata']['version']) && $version<>trim($data['appdata']['version'])) {
OC_Helper::rmdirr($extractDir); OC_Helper::rmdirr($extractDir);
throw new \Exception($l->t("App can't be installed because the version in info.xml/version is not the same as the version reported from the app store")); throw new \Exception($l->t("App can't be installed because the version in info.xml is not the same as the version reported from the app store"));
} }
return $info; return $info;

View File

@ -142,7 +142,7 @@ class App {
} }
/** /**
* Get the last version of the app, either from appinfo/version or from appinfo/info.xml * Get the last version of the app from appinfo/info.xml
* @param string $app * @param string $app
* @return string * @return string
* @since 4.0.0 * @since 4.0.0

Binary file not shown.

Binary file not shown.