Overview
Comment: | Make the 'getCommonContainingDirectory' procedure work correctly for all corner cases. More cleanup. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | uploaderClient |
Files: | files | file ages | folders |
SHA1: |
2a6ac9473f58908b948e094bcacb5366 |
User & Date: | mistachkin on 2016-12-18 20:56:29 |
Other Links: | branch diff | manifest | tags |
Context
2016-12-18
| ||
21:50 | More work on supporting the package uploader client. Use the new OpenPGP 'keys' file (i.e. 'keys.asc', the one with potentially more than one Package Signing Key). Closed-Leaf check-in: 0fc9d3e420 user: mistachkin tags: uploaderClient | |
20:56 | Make the 'getCommonContainingDirectory' procedure work correctly for all corner cases. More cleanup. check-in: 2a6ac9473f user: mistachkin tags: uploaderClient | |
03:10 | Comments, cleanup, more work in progress on the uploader client. Not yet tested. Also, 'getContainingDirectory' still needs work to forbid mismatched root directories. check-in: e05a3e1067 user: mistachkin tags: uploaderClient | |
Changes
Modified client/1.0/neutral/pkgr_upload.eagle from [42f6088384] to [da6cc3acc8].
︙ | ︙ | |||
105 106 107 108 109 110 111 | return $value } else { return $list } } # | > > > > > > > > > > > > > > > > > > > > > > > > > > > | | | > | | | > > | | | | > > | | > | > | | | | > > | > > | > | > > > > > > | > | | | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | return $value } else { return $list } } # # NOTE: This procedure counts the common path components for two paths. The # count is returned, zero if there are no common path components. The # path1 and path2 arguments are the paths to compare. This procedure # may not raise script errors. # proc countCommonPathParts { path1 path2 } { set parts1 [file split $path1] set length1 [llength $parts1] set parts2 [file split $path2] set length2 [llength $parts2] set length [expr {min($length1, $length2)}] for {set index 0} {$index < $length} {incr index} { set part1 [lindex $parts1 $index] set part2 [lindex $parts2 $index] if {$part1 ne $part2} then { return $index } } return $length } # # NOTE: This procedure processes a list of (fully?) qualified file names and # tries to determine their common containing directory, if any. The # fileNames argument is the list of (fully?) qualified file names to # process. This procedure may not raise script errors. If there is # no common containing directory, an empty string is returned. # proc getCommonContainingDirectory { fileNames } { set length [llength $fileNames] if {$length == 0} then { return "" } set oldFileName [lindex $fileNames 0] if {$length == 1} then { return [file dirname $oldFileName] } set minimumCount 0 for {set index 1} {$index < $length} {incr index} { set newFileName [lindex $fileNames $index] set newCount [countCommonPathParts $oldFileName $newFileName] if {$newCount == 0} then { return "" } if {$minimumCount == 0 || $newCount < $minimumCount} then { set oldFileName $newFileName set minimumCount $newCount } } if {$minimumCount == 0} then { return "" } incr minimumCount -1 return [eval file join [lrange [file split $oldFileName] 0 $minimumCount]] } # # NOTE: This procedure attempts to process a list of (fully?) qualified file # names and return the corresponding list of relative file names. The # fileNames argument is the list of (fully?) qualified file names to # process. The maximumLevels argument is the maximum path depth that # is allowed for all file names. This procedure may raise script # errors. # proc getRelativeFileNames { fileNames maximumLevels } { set directory [getCommonContainingDirectory $fileNames] set directoryParts [file split $directory] set fileNameIndex [expr {[llength $directoryParts] - 1}] if {$fileNameIndex < 0} then { error [appendArgs \ "invalid containing directory \"" $directory \ "\": cannot go up one level"] |
︙ | ︙ | |||
181 182 183 184 185 186 187 | } # # NOTE: This procedure attempts to create a script chunk that appends the # specified list of file names to a list variable. The fileNames # argument is the list of (fully?) qualified file names to append to # the list variable. The maximumLevels argument is the maximum path | | | | | 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | } # # NOTE: This procedure attempts to create a script chunk that appends the # specified list of file names to a list variable. The fileNames # argument is the list of (fully?) qualified file names to append to # the list variable. The maximumLevels argument is the maximum path # depth that is allowed for all file names. This procedure may raise # script errors. # proc getScriptChunkForFileNames { fileNames maximumLevels } { set result "" set relativeFileNames [getRelativeFileNames $fileNames $maximumLevels] foreach relativeFileName $relativeFileNames { if {[string length $result] > 0} then { append result \n } append result { lappend fileNames [file join } |
︙ | ︙ | |||
216 217 218 219 220 221 222 223 224 | # empty string -OR- one of the literal strings "neutral", "win32-arm", # "win32-x86", "win64-arm64", "win64-ia64", or "win64-x64". The # fileNames argument is the list of (fully?) qualified file names to # be downloaded when the associated package is being provided. The # options argument is reserved for future use, it should be an empty # list. # proc createRepositoryScript { language version platform fileNames options } { ::PackageDownloader::verifyLanguageAndVersion $language $version isClient | > < | < | 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | # empty string -OR- one of the literal strings "neutral", "win32-arm", # "win32-x86", "win64-arm64", "win64-ia64", or "win64-x64". The # fileNames argument is the list of (fully?) qualified file names to # be downloaded when the associated package is being provided. The # options argument is reserved for future use, it should be an empty # list. # # <public> proc createRepositoryScript { language version platform fileNames options } { ::PackageDownloader::verifyLanguageAndVersion $language $version isClient return [string trim [string map [list \r\n \n \ %language% [formatStringMapValue $language] \ %version% [formatStringMapValue $version] \ %platform% [formatStringMapValue $platform] \ %backslash% \\ %ns% ::PackageDownloader %fileNames% \ [getScriptChunkForFileNames $fileNames 2]] { apply [list [list] { package require Eagle.Package.Downloader %ns%::resetCookieAndLoginSimple set fileNames [list] |
︙ | ︙ | |||
250 251 252 253 254 255 256 257 258 259 260 261 262 263 | } # # NOTE: This procedure attempts to stage the specified package files using # Fossil. The fileNames argument is a list of (fully?) qualified # local file names to stage. # proc stagePackageFiles { language version platform fileNames } { variable checkoutDirectory variable fossilAddCommand set relativeFileNames [getRelativeFileNames $fileNames] set savedPwd [pwd]; cd $checkoutDirectory | > | 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | } # # NOTE: This procedure attempts to stage the specified package files using # Fossil. The fileNames argument is a list of (fully?) qualified # local file names to stage. # # <public> proc stagePackageFiles { language version platform fileNames } { variable checkoutDirectory variable fossilAddCommand set relativeFileNames [getRelativeFileNames $fileNames] set savedPwd [pwd]; cd $checkoutDirectory |
︙ | ︙ | |||
296 297 298 299 300 301 302 303 304 305 306 307 308 309 | # # NOTE: This procedure attempts to commit the staged package files to the # remote package file repository using Fossil. The varName argument # is the name of a scalar variable in the context of the immediate # caller that will receive the resulting Fossil check-in identifier. # proc commitPackageFiles { varName } { variable checkoutDirectory variable fossilCommitCommand variable fossilCommitPattern set branch ""; # TODO: Figure out a good branch. set comment ""; # TODO: Figure out a good comment. | > | 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 | # # NOTE: This procedure attempts to commit the staged package files to the # remote package file repository using Fossil. The varName argument # is the name of a scalar variable in the context of the immediate # caller that will receive the resulting Fossil check-in identifier. # # <public> proc commitPackageFiles { varName } { variable checkoutDirectory variable fossilCommitCommand variable fossilCommitPattern set branch ""; # TODO: Figure out a good branch. set comment ""; # TODO: Figure out a good comment. |
︙ | ︙ |
Modified client/1.0/neutral/pkgr_upload.eagle.asc from [f35eaacddd] to [62a30ceb9e].
1 2 3 4 | -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Eagle Package Repository | | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Eagle Package Repository iQIcBAABCAAGBQJYVvfzAAoJEFAslq9JXcLZ3KYP/1ziIWg74l8Xat7PICttqWra 2eFS6x2/fJUK0sqol3pBDxNgn6PfQEFNeJOtP/FlLe7NCG2oOCcIZGuYzGQmZv9u UAQQiV6J6Tzn4ZQXETVcKFFkIZ8VhemK3BBuw4omSPogHCHTX7LiVAmsYjs6krhM q5UOuswqOidWBWvbaUrkq3SWrtYPj+M4oiNlpA3AjEcn/UePiag60jQi2ZJF+GaN cMa5iTHYBWPlnqjlXPOIEOJ4AUHULo9LwJtjkXPIqYNjuVyTJXuO5sRy8yTWIv8C FScTt6PS/ds5Yj6LMNsRDII9/broj04kb7eZt3LIruIxT+Cni0HXqfwydlHBBgng FgniTiWR6hM8TSOPH18jxjuZ8Cb3ML6Tb/OUul1QWZOrLz/RYszVRgbaC6Y3Z8Ga lVYdVXo247UvRwYMkgbSeVKEqhwv/prIh44Ii33cYqMGGRReV7/vAfxB8WXWTQBZ QQ96Z93LsP3lujXwecQQPfb+uBzcPvlFrwmWHmMjsQ/q09BIPbc+gCV0UmfMcax6 Lb9S/QNFWQ4CbjptpdiD/1JfSAwqLOuThQdCUGaQq+LPs297vMpmt2frL9gC7d3h /DmEGMMylse2852qFdHYCaWw4Yr8Sgn+lZ9eXuaqY0FCGjRTgTz5CR5f2JylY+mH Mhm7F3uErgDn97Jp/qht =QWS0 -----END PGP SIGNATURE----- |
Modified client/1.0/neutral/pkgr_upload.eagle.harpy from [4ce0ba16dd] to [cec3f80607].
︙ | ︙ | |||
17 18 19 20 21 22 23 | THE ASSOCIATED SOFTWARE MAY NOT WORK PROPERLY IF THIS FILE IS ALTERED. --> <Certificate xmlns="https://eagle.to/2011/harpy" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Protocol>None</Protocol> <Vendor>Mistachkin Systems</Vendor> | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | THE ASSOCIATED SOFTWARE MAY NOT WORK PROPERLY IF THIS FILE IS ALTERED. --> <Certificate xmlns="https://eagle.to/2011/harpy" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Protocol>None</Protocol> <Vendor>Mistachkin Systems</Vendor> <Id>57abf613-80dc-4e9a-b1bd-c0a6dac4e16f</Id> <HashAlgorithm>SHA512</HashAlgorithm> <EntityType>Script</EntityType> <TimeStamp>2016-12-18T20:55:40.0390625Z</TimeStamp> <Duration>-1.00:00:00</Duration> <Key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c RTswXoGuU62/QQbvtDnSoOPxbVGzdnqNTYRb01GRIImel2nzgWzNurWEvCwUgZS8MW70YVC1W823 VSA9lhWDYC4pjIBcVCPv+UhEMQQSh7kXTUOtENUW0KeBgE3u1H6/IV/VUX0dW7H+veDQA+eFOq6c CZ915nU6rscKtclLHPfl5GGWmMv42ZbhPugj2fKSGksYy7G8Z/Dk/QnjPZC3vxxPqsFHfux1mrWZ JZ3Uzz1a3rXlHybOqlkol6XUjwVCqg6n8w0R5/mNQVd9dRlqK4VduygkwZWXke1za5Diyb+ijT+Q 0pd38QH4hHSDKk61CqyojAYnoOov+On+1L20B6W1QsfiAXkxdOwCm2S6bhdHz8UrXI3j05hu3ZG2 yn6crlEoazGMhZf5bM3rBzkCV1MTtQmquRku//xkUXdjXADLoe73br+E6dpP9AS0w57IZC1uyH4g wp/eqVuK3t9pNHPqbveCm0vUG5yb3pdtNcrqHpXVjBa/mSmEPMG/6xdxlZjL1OXMq3Gr/6HydT/8 JBk9MdoXfgRg70QMoHJeoqf10NsrF1H06aindKQs99omWnymatRki8wcXszCl3BsLTjezk0= </Signature> </Certificate> |
Modified client/1.0/neutral/pkgr_upload.eagle.harpy.asc from [6121a4c8b4] to [1e3502e434].
1 2 3 4 | -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Eagle Package Repository | | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Eagle Package Repository iQIcBAABCAAGBQJYVvf0AAoJEFAslq9JXcLZ2B4QAIOriM66ke/AwFa96RpEYs8g YdiGg1k5ZpCRc8uVtPYcJnjtc1g325tf73jw7s5I/SThsmBSEFmIWKJwh0HVR6b2 m2xL0hS+D1ba5+sa6aBUrmn7jbw4i1z9+Rb4hqXacBhIyMaT5qRSN9WQl+mblBML cVU9NKYc8ifAmayqiOOvV3vcf3n2V+jiyjEyCw8NVT441JuPIm9jPkTP0oDdy/y6 l5a2TEvAIq1o9ovEXBkc5NJP8hC+haKdSAZId6q01/aY3L3ObRYCrHs/2iTygWM0 QmtvP9VPdjfQ6A7u4b1P5EBzQfFvvkOnbi9R2gb/xA06ZqC/heDtxCfl9xL1T8GH 4vl0+cENxY61G9avc5v0AoEQY+XFvhJpU5vL2PSpw0ZMFmQE4G50SuooD/pA+t8X ak+YFoLw2tVnGyDgO+CilF6cP/h1mY+dWvw6hx8aLQeDlNAWRHNco0wzaxDRhJJn KNvtwQqO2xGEnDbHkkA3ka0nyUYfyOnJnD+LGQKgKqUm+yMywChlK9NOtbdNrLce i8evvNEudOrQY1TLHNkGpJ4fP6LRQSU33MplPMYnYTyeqiJFpNsHjWWhk4cWxDcx oprP4sumZuZEHGXLXKXP2/V8/XDPQPuYCDARbkvO2YS84ZG1FadkZ6MkyDiIunSn +hD0AK7acs6BQTWdNQFf =Q5nF -----END PGP SIGNATURE----- |