[BUGFIX] Fix core update if core location exists 64/36664/3
authorFrederic Gaus <gaus@flagbit.de>
Thu, 5 Feb 2015 01:18:46 +0000 (02:18 +0100)
committerNicole Cordes <typo3@cordes.co>
Mon, 16 Feb 2015 09:49:42 +0000 (10:49 +0100)
If multiple installations are symlinked to the same core location,
the core updater fails on the second update because the new version
already exists.

Check for this situation and skip unneeded tasks during the update
process.

Change-Id: I4c3c11f0e45c240e15913d5de5a3156ef5ad0aa6
Resolves: #58009
Releases: master, 6.2
Reviewed-on: http://review.typo3.org/36664
Reviewed-by: Frederic Gaus <gaus@flagbit.de>
Tested-by: Frederic Gaus <gaus@flagbit.de>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
typo3/sysext/install/Classes/Service/CoreUpdateService.php
typo3/sysext/install/Resources/Public/Javascript/Install.js

index 70a0365..8aac119 100644 (file)
@@ -16,6 +16,10 @@ namespace TYPO3\CMS\Install\Service;
 
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\OpcodeCacheUtility;
+use TYPO3\CMS\Core\Utility\PathUtility;
+use TYPO3\CMS\Install\Service\Exception\RemoteFetchException;
+use TYPO3\CMS\Install\Status\StatusInterface;
+use TYPO3\CMS\Install\Status\StatusUtility;
 
 /**
  * Core update service.
@@ -42,7 +46,7 @@ class CoreUpdateService {
        protected $coreVersionService;
 
        /**
-        * @var array<\TYPO3\CMS\Install\Status\StatusInterface>
+        * @var StatusInterface[]
         */
        protected $messages = array();
 
@@ -58,7 +62,7 @@ class CoreUpdateService {
         *
         * @var string
         */
-       protected $currentCoreLocation;
+       protected $symlinkToCoreFiles;
 
        /**
         * Base URI for TYPO3 downloads
@@ -72,7 +76,7 @@ class CoreUpdateService {
         */
        public function initializeObject() {
                $this->setDownloadTargetPath(PATH_site . 'typo3temp/core-update/');
-               $this->currentCoreLocation = $this->discoverCurrentCoreLocation();
+               $this->symlinkToCoreFiles = $this->discoverCurrentCoreLocation();
                $this->downloadBaseUri = $this->coreVersionService->getDownloadBaseUri();
        }
 
@@ -111,7 +115,7 @@ class CoreUpdateService {
        /**
         * Get messages of previous method call
         *
-        * @return array<\TYPO3\CMS\Install\Status\StatusInterface>
+        * @return StatusInterface[]
         */
        public function getMessages() {
                return $this->messages;
@@ -126,9 +130,9 @@ class CoreUpdateService {
                $success = TRUE;
                try {
                        $this->coreVersionService->updateVersionMatrix();
-               } catch (\TYPO3\CMS\Install\Service\Exception\RemoteFetchException $e) {
+               } catch (RemoteFetchException $e) {
                        $success = FALSE;
-                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                       /** @var $message StatusInterface */
                        $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
                        $message->setTitle('Version matrix could not be fetched from get.typo3.org');
                        $message->setMessage(
@@ -149,7 +153,7 @@ class CoreUpdateService {
                $success = TRUE;
                $messages = array();
 
-               /** @var \TYPO3\CMS\Install\Status\StatusUtility $statusUtility */
+               /** @var StatusUtility $statusUtility */
                $statusUtility = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\StatusUtility');
 
                // Folder structure test: Update can be done only if folder structure returns no errors
@@ -159,9 +163,9 @@ class CoreUpdateService {
                $folderStructureWarnings = $statusUtility->filterBySeverity($folderStructureFacade->getStatus(), 'warning');
                if (count($folderStructureErrors) > 0 || count($folderStructureWarnings) > 0) {
                        $success = FALSE;
-                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                       /** @var $message StatusInterface */
                        $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                       $message->setTitle('Automatic core update not possible: Folder structure has errors or warnings');
+                       $message->setTitle('Automatic TYPO3 CMS core update not possible: Folder structure has errors or warnings');
                        $message->setMessage(
                                'To perform an update, the folder structure of this TYPO3 CMS instance must'
                                . ' stick to the conventions, or the update process could lead to unexpected'
@@ -173,9 +177,9 @@ class CoreUpdateService {
                // No core update on windows
                if (TYPO3_OS === 'WIN') {
                        $success = FALSE;
-                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                       /** @var $message StatusInterface */
                        $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                       $message->setTitle('Automatic core update not possible: Update not supported on Windows OS');
+                       $message->setTitle('Automatic TYPO3 CMS core update not possible: Update not supported on Windows OS');
                        $messages[] = $message;
                }
 
@@ -185,9 +189,9 @@ class CoreUpdateService {
                        $result = @touch($file);
                        if (!$result) {
                                $success = FALSE;
-                               /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                               /** @var $message StatusInterface */
                                $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                               $message->setTitle('Automatic core update not possible: No write access to document root');
+                               $message->setTitle('Automatic TYPO3 CMS core update not possible: No write access to document root');
                                $message->setMessage('Could not write a file in path "' . PATH_site . '"!');
                                $messages[] = $message;
                        } else {
@@ -195,16 +199,16 @@ class CoreUpdateService {
                        }
 
                        // Explicit write check to upper directory of current core location
-                       $coreLocation = @realPath($this->currentCoreLocation . '/../');
+                       $coreLocation = @realPath($this->symlinkToCoreFiles . '/../');
                        $file = $coreLocation . '/' . uniqid('install-core-update-test-', TRUE);
                        $result = @touch($file);
                        if (!$result) {
                                $success = FALSE;
-                               /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                               /** @var $message StatusInterface */
                                $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                               $message->setTitle('Automatic core update not possible: No write access to core location');
+                               $message->setTitle('Automatic TYPO3 CMS core update not possible: No write access to TYPO3 CMS core location');
                                $message->setMessage(
-                                       'New core should be installed in "' . $coreLocation . '", but this directory is not writable!'
+                                       'New TYPO3 CMS core should be installed in "' . $coreLocation . '", but this directory is not writable!'
                                );
                                $messages[] = $message;
                        } else {
@@ -214,9 +218,9 @@ class CoreUpdateService {
 
                if ($success && !$this->coreVersionService->isInstalledVersionAReleasedVersion()) {
                        $success = FALSE;
-                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                       /** @var $message StatusInterface */
                        $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                       $message->setTitle('Automatic core update not possible: You are running a development version of TYPO3');
+                       $message->setTitle('Automatic TYPO3 CMS core update not possible: You are running a development version of TYPO3');
                        $message->setMessage(
                                'Your current version is specified as ' . $this->coreVersionService->getInstalledVersion() . '.'
                                . ' This is a development version and can not be updated automatically. If this is a "git"'
@@ -236,35 +240,46 @@ class CoreUpdateService {
         * @return boolean TRUE on success
         */
        public function downloadVersion($version) {
-               $downloadUri = $this->downloadBaseUri . $version;
-               $fileLocation = $this->getDownloadTarGzTargetPath($version);
-
                $messages = array();
                $success = TRUE;
 
-               if (@file_exists($fileLocation)) {
-                       $success = FALSE;
-                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
-                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                       $message->setTitle('Core download exists in download location: ' . \TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix($this->downloadTargetPath));
+               if ($this->checkCoreFilesAvailable($version)) {
+                       /** @var $message StatusInterface */
+                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\NoticeStatus');
+                       $message->setTitle('Skipped download of TYPO3 CMS core. A core source directory already exists in destination path. Using this instead.');
                        $messages[] = $message;
                } else {
-                       $fileContent = GeneralUtility::getUrl($downloadUri);
-                       if (!$fileContent) {
+                       $downloadUri = $this->downloadBaseUri . $version;
+                       $fileLocation = $this->getDownloadTarGzTargetPath($version);
+
+                       if (@file_exists($fileLocation)) {
                                $success = FALSE;
-                               /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                               /** @var $message StatusInterface */
                                $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                               $message->setTitle('Download not successful');
+                               $message->setTitle('TYPO3 CMS core download exists in download location: ' . PathUtility::stripPathSitePrefix($this->downloadTargetPath));
                                $messages[] = $message;
                        } else {
-                               $fileStoreResult = file_put_contents($fileLocation, $fileContent);
-                               if (!$fileStoreResult) {
+                               $fileContent = GeneralUtility::getUrl($downloadUri);
+                               if (!$fileContent) {
                                        $success = FALSE;
-                                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                                       /** @var $message StatusInterface */
                                        $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                                       $message->setTitle('Unable to store download content');
+                                       $message->setTitle('Download not successful');
                                        $messages[] = $message;
-                               }
+                               } else {
+                                       $fileStoreResult = file_put_contents($fileLocation, $fileContent);
+                                       if (!$fileStoreResult) {
+                                               $success = FALSE;
+                                               /** @var $message StatusInterface */
+                                               $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                                               $message->setTitle('Unable to store download content');
+                                               $messages[] = $message;
+                                       } else {
+                                               $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\OkStatus');
+                                               $message->setTitle('TYPO3 CMS core download finished');
+                                               $messages[] = $message;
+                                       }
+                               }
                        }
                }
                $this->messages = $messages;
@@ -278,32 +293,43 @@ class CoreUpdateService {
         * @return boolean TRUE on success
         */
        public function verifyFileChecksum($version) {
-               $fileLocation = $this->getDownloadTarGzTargetPath($version);
-               $expectedChecksum = $this->coreVersionService->getTarGzSha1OfVersion($version);
-
                $messages = array();
                $success = TRUE;
 
-               if (!file_exists($fileLocation)) {
-                       $success = FALSE;
-                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
-                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                       $message->setTitle('Downloaded core not found');
+               if ($this->checkCoreFilesAvailable($version)) {
+                       /** @var $message StatusInterface */
+                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\WarningStatus');
+                       $message->setTitle('Verifying existing TYPO3 CMS core checksum is not possible');
                        $messages[] = $message;
                } else {
-                       $actualChecksum = sha1_file($fileLocation);
-                       if ($actualChecksum !== $expectedChecksum) {
+                       $fileLocation = $this->getDownloadTarGzTargetPath($version);
+                       $expectedChecksum = $this->coreVersionService->getTarGzSha1OfVersion($version);
+
+                       if (!file_exists($fileLocation)) {
                                $success = FALSE;
-                               /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                               /** @var $message StatusInterface */
                                $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                               $message->setTitle('New core checksum mismatch');
-                               $message->setMessage(
-                                       'The official TYPO3 CMS version system on https://get.typo3.org expects a sha1 checksum of '
-                                       . $expectedChecksum . ' from the content of the downloaded new core version ' . $version . '.'
-                                       . ' The actual checksum is ' . $actualChecksum . '. The update is stopped. This may be a'
-                                       . ' failed download, an attack, or an issue with the typo3.org infrastructure.'
-                               );
+                               $message->setTitle('Downloaded TYPO3 CMS core not found');
                                $messages[] = $message;
+                       } else {
+                               $actualChecksum = sha1_file($fileLocation);
+                               if ($actualChecksum !== $expectedChecksum) {
+                                       $success = FALSE;
+                                       /** @var $message StatusInterface */
+                                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                                       $message->setTitle('New TYPO3 CMS core checksum mismatch');
+                                       $message->setMessage(
+                                               'The official TYPO3 CMS version system on https://get.typo3.org expects a sha1 checksum of '
+                                               . $expectedChecksum . ' from the content of the downloaded new TYPO3 CMS core version ' . $version . '.'
+                                               . ' The actual checksum is ' . $actualChecksum . '. The update is stopped. This may be a'
+                                               . ' failed download, an attack, or an issue with the typo3.org infrastructure.'
+                                       );
+                                       $messages[] = $message;
+                               } else {
+                                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\OkStatus');
+                                       $message->setTitle('Checksum verified');
+                                       $messages[] = $message;
+                               }
                        }
                }
                $this->messages = $messages;
@@ -317,40 +343,51 @@ class CoreUpdateService {
         * @return boolean TRUE on success
         */
        public function unpackVersion($version) {
-               $fileLocation = $this->downloadTargetPath . $version . '.tar.gz';
-
                $messages = array();
                $success = TRUE;
 
-               if (!@is_file($fileLocation)) {
-                       $success = FALSE;
-                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
-                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                       $message->setTitle('Downloaded core not found');
-                       $messages[] = $message;
-               } elseif (@file_exists($this->downloadTargetPath . 'typo3_src-' . $version)) {
-                       $success = FALSE;
-                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
-                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                       $message->setTitle('Unpacked core exists in download location: ' . \TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix($this->downloadTargetPath));
+               if ($this->checkCoreFilesAvailable($version)) {
+                       /** @var $message StatusInterface */
+                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\NoticeStatus');
+                       $message->setTitle('Unpacking TYPO3 CMS core files skipped');
                        $messages[] = $message;
                } else {
-                       $unpackCommand = 'tar xf ' . escapeshellarg($fileLocation) . ' -C ' . escapeshellarg($this->downloadTargetPath) . ' 2>&1';
-                       exec($unpackCommand, $output, $errorCode);
-                       if ($errorCode) {
+                       $fileLocation = $this->downloadTargetPath . $version . '.tar.gz';
+
+                       if (!@is_file($fileLocation)) {
                                $success = FALSE;
-                               /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                               /** @var $message StatusInterface */
                                $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                               $message->setTitle('Unpacking core not successful');
+                               $message->setTitle('Downloaded TYPO3 CMS core not found');
                                $messages[] = $message;
+                       } elseif (@file_exists($this->downloadTargetPath . 'typo3_src-' . $version)) {
+                               $success = FALSE;
+                               /** @var $message StatusInterface */
+                               $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                               $message->setTitle('Unpacked TYPO3 CMS core exists in download location: ' . PathUtility::stripPathSitePrefix($this->downloadTargetPath));
+                               $messages[] = $message;
                        } else {
-                               $removePackedFileResult = unlink($fileLocation);
-                               if (!$removePackedFileResult) {
+                               $unpackCommand = 'tar xf ' . escapeshellarg($fileLocation) . ' -C ' . escapeshellarg($this->downloadTargetPath) . ' 2>&1';
+                               exec($unpackCommand, $output, $errorCode);
+                               if ($errorCode) {
                                        $success = FALSE;
-                                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                                       /** @var $message StatusInterface */
                                        $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                                       $message->setTitle('Removing packed core not successful');
+                                       $message->setTitle('Unpacking TYPO3 CMS core not successful');
                                        $messages[] = $message;
+                               } else {
+                                       $removePackedFileResult = unlink($fileLocation);
+                                       if (!$removePackedFileResult) {
+                                               $success = FALSE;
+                                               /** @var $message StatusInterface */
+                                               $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                                               $message->setTitle('Removing packed TYPO3 CMS core not successful');
+                                               $messages[] = $message;
+                                       } else {
+                                               $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\OkStatus');
+                                               $message->setTitle('Unpacking TYPO3 CMS core successful');
+                                               $messages[] = $message;
+                                       }
                                }
                        }
                }
@@ -365,32 +402,37 @@ class CoreUpdateService {
         * @return boolean TRUE on success
         */
        public function moveVersion($version) {
-               $downloadedCoreLocation = $this->downloadTargetPath . 'typo3_src-' . $version;
-               $newCoreLocation = @realPath($this->currentCoreLocation . '/../') . '/typo3_src-' . $version;
-
                $messages = array();
                $success = TRUE;
 
-               if (!@is_dir($downloadedCoreLocation)) {
-                       $success = FALSE;
-                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
-                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                       $message->setTitle('Unpacked core not found');
-                       $messages[] = $message;
-               } elseif (@is_dir($newCoreLocation)) {
-                       $success = FALSE;
-                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
-                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                       $message->setTitle('Another core source directory already exists in path ' . $newCoreLocation);
+               if ($this->checkCoreFilesAvailable($version)) {
+                       /** @var $message StatusInterface */
+                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\NoticeStatus');
+                       $message->setTitle('Moving TYPO3 CMS core files skipped');
                        $messages[] = $message;
                } else {
-                       $moveResult = rename($downloadedCoreLocation, $newCoreLocation);
-                       if (!$moveResult) {
+                       $downloadedCoreLocation = $this->downloadTargetPath . 'typo3_src-' . $version;
+                       $newCoreLocation = @realPath($this->symlinkToCoreFiles . '/../') . '/typo3_src-' . $version;
+
+                       if (!@is_dir($downloadedCoreLocation)) {
                                $success = FALSE;
-                               /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                               /** @var $message StatusInterface */
                                $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                               $message->setTitle('Moving core to ' . $newCoreLocation . ' failed');
+                               $message->setTitle('Unpacked TYPO3 CMS core not found');
                                $messages[] = $message;
+                       } else {
+                               $moveResult = rename($downloadedCoreLocation, $newCoreLocation);
+                               if (!$moveResult) {
+                                       $success = FALSE;
+                                       /** @var $message StatusInterface */
+                                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                                       $message->setTitle('Moving TYPO3 CMS core to ' . $newCoreLocation . ' failed');
+                                       $messages[] = $message;
+                               } else {
+                                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\OkStatus');
+                                       $message->setTitle('Moved TYPO3 CMS core to final location');
+                                       $messages[] = $message;
+                               }
                        }
                }
 
@@ -405,29 +447,29 @@ class CoreUpdateService {
         * @return boolean TRUE on success
         */
        public function activateVersion($version) {
-               $newCoreLocation = @realPath($this->currentCoreLocation . '/../') . '/typo3_src-' . $version;
+               $newCoreLocation = @realPath($this->symlinkToCoreFiles . '/../') . '/typo3_src-' . $version;
 
                $messages = array();
                $success = TRUE;
 
                if (!is_dir($newCoreLocation)) {
                        $success = FALSE;
-                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                       /** @var $message StatusInterface */
                        $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                       $message->setTitle('New core not found');
+                       $message->setTitle('New TYPO3 CMS core not found');
                        $messages[] = $message;
-               } elseif (!is_link($this->currentCoreLocation)) {
+               } elseif (!is_link($this->symlinkToCoreFiles)) {
                        $success = FALSE;
-                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                       /** @var $message StatusInterface */
                        $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                       $message->setTitle('TYPO3 source directory (typo3_src) is not a link');
+                       $message->setTitle('TYPO3 CMS core source directory (typo3_src) is not a link');
                        $messages[] = $message;
                } else {
                        $isCurrentCoreSymlinkAbsolute = PathUtility::isAbsolutePath(readlink($this->symlinkToCoreFiles));
-                       $unlinkResult = unlink($this->currentCoreLocation);
+                       $unlinkResult = unlink($this->symlinkToCoreFiles);
                        if (!$unlinkResult) {
                                $success = FALSE;
-                               /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                               /** @var $message StatusInterface */
                                $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
                                $message->setTitle('Removing old symlink failed');
                                $messages[] = $message;
@@ -435,14 +477,14 @@ class CoreUpdateService {
                                if (!$isCurrentCoreSymlinkAbsolute) {
                                        $newCoreLocation = $this->getRelativePath($newCoreLocation);
                                }
-                               $symlinkResult = symlink($newCoreLocation, $this->currentCoreLocation);
+                               $symlinkResult = symlink($newCoreLocation, $this->symlinkToCoreFiles);
                                if ($symlinkResult) {
                                        OpcodeCacheUtility::clearAllActive();
                                } else {
                                        $success = FALSE;
-                                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                                       /** @var $message StatusInterface */
                                        $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
-                                       $message->setTitle('Linking new core failed');
+                                       $message->setTitle('Linking new TYPO3 CMS core failed');
                                        $messages[] = $message;
                                }
                        }
@@ -478,4 +520,16 @@ class CoreUpdateService {
                return str_pad('', count($sourcePath) * 3, '..' . DIRECTORY_SEPARATOR) . implode(DIRECTORY_SEPARATOR, $targetPath);
        }
 
+       /**
+        * Check if there is are already core files available
+        * at the download destination.
+        *
+        * @param string $version A version number
+        * @return bool true when core files are available
+        */
+       protected function checkCoreFilesAvailable($version) {
+               $newCoreLocation = @realPath($this->symlinkToCoreFiles . '/../') . '/typo3_src-' . $version;
+               return @is_dir($newCoreLocation);
+       }
+
 }
index ed9a5a2..fd150e2 100644 (file)
@@ -70,22 +70,22 @@ TYPO3.Install.coreUpdate = {
                },
                coreUpdateDownload: {
                        loadingMessage: 'Downloading new core',
-                       finishMessage: 'Core download finished',
+                       finishMessage: undefined,
                        nextActionName: 'coreUpdateVerifyChecksum'
                },
                coreUpdateVerifyChecksum: {
                        loadingMessage: 'Verifying checksum of downloaded core',
-                       finishMessage: 'Checksum verified',
+                       finishMessage: undefined,
                        nextActionName: 'coreUpdateUnpack'
                },
                coreUpdateUnpack: {
                        loadingMessage: 'Unpacking core',
-                       finishMessage: 'Unpacking core successful',
+                       finishMessage: undefined,
                        nextActionName: 'coreUpdateMove'
                },
                coreUpdateMove: {
                        loadingMessage: 'Moving core',
-                       finishMessage: 'Moved core to final location',
+                       finishMessage: undefined,
                        nextActionName: 'clearCache'
                },
                clearCache: {