| Index: trunk/tools/mwmultiversion/multiversion/checkoutMediaWiki |
| — | — | @@ -83,67 +83,40 @@ |
| 84 | 84 | |
| 85 | 85 | # Create symlink to wmf-config/AdminSettings.php... |
| 86 | 86 | $path = "$destIP/AdminSettings.php"; |
| 87 | | - if ( !file_exists( $path ) ) { |
| 88 | | - if ( symlink( "../wmf-config/AdminSettings.php", $path ) ) { |
| 89 | | - print "Created AdminSettings.php symlink.\n"; |
| 90 | | - } |
| 91 | | - } else { |
| 92 | | - print "Symlink file already exists: $path\n"; |
| 93 | | - } |
| | 87 | + $link = "../wmf-config/AdminSettings.php"; |
| | 88 | + createSymlink( $path, $link, "Created AdminSettings.php symlink." ); |
| 94 | 89 | |
| 95 | 90 | # Create symlink to wmf-config/StartProfiler.php... |
| 96 | 91 | $path = "$destIP/StartProfiler.php"; |
| 97 | | - if ( !file_exists( $path ) ) { |
| 98 | | - if ( symlink( "../wmf-config/StartProfiler.php", $path ) ) { |
| 99 | | - print "Created StartProfiler.php symlink.\n"; |
| 100 | | - } |
| 101 | | - } else { |
| 102 | | - print "Symlink file already exists: $path\n"; |
| 103 | | - } |
| | 92 | + $link = "../wmf-config/StartProfiler.php"; |
| | 93 | + createSymlink( $path, $link, "Created StartProfiler.php symlink." ); |
| 104 | 94 | |
| 105 | 95 | # Create bits.wikimedia.org symlinks... |
| 106 | 96 | $path = "$commonHomeDir/docroot/bits/skins-$dstVersionNum"; |
| 107 | | - if ( !file_exists( $path ) ) { |
| 108 | | - if ( symlink( "$commonLocalDir/php-$dstVersionNum/skins/", $path ) ) { |
| 109 | | - print "Created skins-$dstVersionNum symlink.\n"; |
| 110 | | - } |
| 111 | | - } else { |
| 112 | | - print "Symlink file already exists: $path\n"; |
| 113 | | - } |
| | 97 | + $link = "$commonLocalDir/php-$dstVersionNum/skins/"; |
| | 98 | + createSymlink( $path, $link, "Created skins-$dstVersionNum symlink." ); |
| | 99 | + |
| 114 | 100 | $path = "$commonHomeDir/docroot/bits/w/extensions-$dstVersionNum"; |
| 115 | | - if ( !file_exists( $path ) ) { |
| 116 | | - if ( symlink( "$commonLocalDir/php-$dstVersionNum/extensions", $path ) ) { |
| 117 | | - print "Created w/extensions-$dstVersionNum symlink.\n"; |
| 118 | | - } |
| 119 | | - } else { |
| 120 | | - print "Symlink file already exists: $path\n"; |
| 121 | | - } |
| | 101 | + $link = "$commonLocalDir/php-$dstVersionNum/extensions"; |
| | 102 | + createSymlink( $path, $link, "Created w/extensions-$dstVersionNum symlink." ); |
| 122 | 103 | |
| | 104 | + # Create secure.wikimedia.org symlinks... |
| | 105 | + $path = "$commonHomeDir/docroot/secure/skins-$dstVersionNum"; |
| | 106 | + $link = "$commonLocalDir/php-$dstVersionNum/skins"; |
| | 107 | + createSymlink( $path, $link, "Created secure/skins-$dstVersionNum symlink." ); |
| | 108 | + |
| 123 | 109 | # Create skins/resources symlinks... |
| 124 | 110 | $path = "$commonHomeDir/live-1.5/extensions-$dstVersionNum"; |
| 125 | | - if ( !file_exists( $path ) ) { |
| 126 | | - if ( symlink( "$commonLocalDir/php-$dstVersionNum/extensions", $path ) ) { |
| 127 | | - print "Created live-1.5/extensions-$dstVersionNum symlink.\n"; |
| 128 | | - } |
| 129 | | - } else { |
| 130 | | - print "Symlink file already exists: $path\n"; |
| 131 | | - } |
| | 111 | + $link = "$commonLocalDir/php-$dstVersionNum/extensions"; |
| | 112 | + createSymlink( $path, $link, "Created live-1.5/extensions-$dstVersionNum symlink." ); |
| | 113 | + |
| 132 | 114 | $path = "$commonHomeDir/live-1.5/skins-$dstVersionNum"; |
| 133 | | - if ( !file_exists( $path ) ) { |
| 134 | | - if ( symlink( "$commonLocalDir/php-$dstVersionNum/skins", $path ) ) { |
| 135 | | - print "Created live-1.5/skins-$dstVersionNum symlink.\n"; |
| 136 | | - } |
| 137 | | - } else { |
| 138 | | - print "Symlink file already exists: $path\n"; |
| 139 | | - } |
| | 115 | + $link = "$commonLocalDir/php-$dstVersionNum/skins"; |
| | 116 | + createSymlink( $path, $link, "Created live-1.5/skins-$dstVersionNum symlink." ); |
| | 117 | + |
| 140 | 118 | $path = "$commonHomeDir/live-1.5/resources-$dstVersionNum"; |
| 141 | | - if ( !file_exists( $path ) ) { |
| 142 | | - if ( symlink( "$commonLocalDir/php-$dstVersionNum/resources", $path ) ) { |
| 143 | | - print "Created live-1.5/resources-$dstVersionNum symlink.\n"; |
| 144 | | - } |
| 145 | | - } else { |
| 146 | | - print "Symlink file already exists: $path\n"; |
| 147 | | - } |
| | 119 | + $link = "$commonLocalDir/php-$dstVersionNum/resources"; |
| | 120 | + createSymlink( $path, $link, "Created live-1.5/resources-$dstVersionNum symlink." ); |
| 148 | 121 | |
| 149 | 122 | # Create libs symlinks... |
| 150 | 123 | $libDir = "$commonHomeDir/php-$dstVersionNum/lib"; |
| — | — | @@ -172,4 +145,14 @@ |
| 173 | 146 | print "\nMediaWiki $dstVersionNum, from $svnVersion, successfully checked out.\n"; |
| 174 | 147 | } |
| 175 | 148 | |
| | 149 | +function createSymlink( $path, $link, $createdMsg ) { |
| | 150 | + if ( !file_exists( $path ) ) { |
| | 151 | + if ( symlink( $link, $path ) ) { |
| | 152 | + print "$createdMsg\n"; |
| | 153 | + } |
| | 154 | + } else { |
| | 155 | + print "Symlink file already exists: $path\n"; |
| | 156 | + } |
| | 157 | +} |
| | 158 | + |
| 176 | 159 | checkoutMediaWiki(); |