private function createExtensionStructureDefinition(array $packages)
    {
        $structureBase = [];
        foreach ($packages as $package) {
            $extensionConfiguration = $this->packageManager->getExtensionConfiguration($package);

            if (isset($extensionConfiguration['uploadfolder']) && (bool)$extensionConfiguration['uploadfolder']) {
                $structureBase[] = $this->getExtensionUploadDirectory($package->getPackageKey());
            }

            if (!empty($extensionConfiguration['createDirs'])) {
                foreach (explode(',', $extensionConfiguration['createDirs']) as $directoryToCreate) {
                    $absolutePath = GeneralUtility::getFileAbsFileName(trim($directoryToCreate));
                    // Only create valid paths.
                    if (!empty($absolutePath)) {
                        $structureBase[] = $this->getDirectoryNodeByPath(PathUtility::stripPathSitePrefix($absolutePath));
                    }
                }
            }
        }

        return $structureBase;
    }