Improved package update
authorAlexander Ebert <ebert@woltlab.com>
Sun, 20 Apr 2014 15:53:57 +0000 (17:53 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 20 Apr 2014 15:53:57 +0000 (17:53 +0200)
wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php

index bab11e22b46fc8d382f474414a7e8bc3107a375a..59391c9064ed3d20cc6dc5d49e95f68758bf563c 100644 (file)
@@ -87,8 +87,13 @@ class PackageInstallationNodeBuilder {
                // required packages
                $this->buildRequirementNodes();
                
+               // register package version
+               self::$pendingPackages[$this->installation->getArchive()->getPackageInfo('name')] = $this->installation->getArchive()->getPackageInfo('version');
+               
                // install package itself
-               $this->buildPackageNode();
+               if ($this->installation->queue->action == 'install') {
+                       $this->buildPackageNode();
+               }
                
                // package installation plugins
                $this->buildPluginNodes();
@@ -100,6 +105,10 @@ class PackageInstallationNodeBuilder {
                
                // child queues
                $this->buildChildQueues();
+               
+               if ($this->installation->queue->action == 'update') {
+                       $this->buildPackageNode();
+               }
        }
        
        /**
@@ -421,8 +430,6 @@ class PackageInstallationNodeBuilder {
                                'requirements' => $this->requirements
                        ))
                ));
-               
-               self::$pendingPackages[$this->installation->getArchive()->getPackageInfo('name')] = $this->installation->getArchive()->getPackageInfo('version');
        }
        
        /**
@@ -548,6 +555,13 @@ class PackageInstallationNodeBuilder {
         * @return      string
         */
        protected function buildPluginNodes() {
+               if (!empty($this->node)) {
+                       $this->parentNode = $this->node;
+                       $this->sequenceNo = 0;
+               }
+               
+               $this->node = $this->getToken();
+               
                $pluginNodes = array();
                
                $this->emptyNode = true;