On Fri, Nov 09, 2018 at 10:40:41PM +0100, Levente Uzonyi wrote:
Hi Chris,
I presume you didn't see Installer-Core-dtl.426.mcz in the Inbox. Btw, before any of these now competing versions get pushed into the Trunk, I'd like to see tests which document the expected behavior of these methods. I'm pretty sure dtl.426, cmm.427 and the current version in Trunk all behave differently.
Levente
I added some new tests in Tests-dtl.403 that provide coverage.
The tests show a failure for the bug in trunk, as also fail for the incorrect update that I did in Installer-Core-dtl.425. The tests pass for Installer-Core-dtl.426, which contains the correct fix.
Dave
On Fri, 9 Nov 2018, Chris Muller wrote:
Hi Dave, good catch! Say, I imported your method changes directly to the current trunk state in hopes you are okay leaving dtl.425 behind.
If so, please feel move this fix to trunk or I will within the next day or so. This is an important fix because it affects people loading software even in 5.2, so we should also backport it to 5.2.
Regards, ChrisOn Fri, Nov 9, 2018 at 1:46 PM commits@source.squeak.org wrote:
Chris Muller uploaded a new version of Installer-Core to project The Inbox: http://source.squeak.org/inbox/Installer-Core-cmm.427.mcz
==================== Summary ====================
Name: Installer-Core-cmm.427 Author: cmm Time: 9 November 2018, 1:46:00.513629 pm UUID: 080be346-3724-453d-ab98-190199cc236f Ancestors: Installer-Core-cmm.424
If an explicit MC version is specified for Installer, load that version. Otherwise load the most recent version of the applicable package or package branch.
=============== Diff against Installer-Core-cmm.424 ===============
Item was removed:
- ----- Method: InstallerMonticello>>mcDetectFileBlock: (in category
'monticello') -----
- mcDetectFileBlock: pkg
pkg isString ifTrue: [ ^ [ :aMCVersionName |
(pkg beginsWith: aMCVersionName
packageAndBranchName) and: [aMCVersionName beginsWith: pkg ] ] ].
(pkg isKindOf: Array)
ifTrue: [ ^ [ :aMCVersionName | pkg anySatisfy:
[ :item |
(item beginsWith:
aMCVersionName packageAndBranchName) and: [aMCVersionName beginsWith: item ] ] ] ].
pkg isBlock ifTrue: [ ^ pkg ].
- !
Item was changed:
----- Method: InstallerMonticello>>mcThing (in category 'monticello')
mcThing | loader | loader := self classMCVersionLoader new.
"several attempts to read files - repository readableFileNames sometimes fails" self packages
do: [:pkg |
| mcVersion versionNames sortedVersions
fileToLoad version |
mcVersion := pkg asMCVersionName .
do: [:pkg |
| versionNames fileToLoad version | versionNames := mc versionNamesForPackageNamed:
(mcVersion versionNumber = 0
(pkg asMCVersionName versionNumber = 0 ifTrue: [ "Just a package name specified, use it whole." pkg ]
ifFalse: [mcVersion packageName]).
sortedVersions := versionNames sorted: self
mcSortFileBlock.
fileToLoad := self versionToLoad: mcVersion
fromVersions: sortedVersions.
ifFalse: [pkg asMCVersionName
packageName]).
fileToLoad := (versionNames sorted: self
mcSortFileBlock)
detect: (self
mcDetectFileBlock: pkg)
ifNone: [ nil ]. fileToLoad ifNotNil: [version := mc versionNamed: fileToLoad. (version isKindOf: MCConfiguration) ifTrue: [^ version] ifFalse: [self normalizedRepositories do: [:repo | MCRepositoryGroup default addRepository: repo]. self normalizedRepositories do: [:repo | version workingCopy repositoryGroup addRepository: repo]. loader addVersion: version]. self logCR: ' found ' , version fileName , '...']]. ^ loader!
Item was added:
- ----- Method: InstallerMonticello>>versionToLoad:fromVersions: (in
category 'monticello') -----
- versionToLoad: mcVersion fromVersions: sortedVersions
"From a list of sortedVersions, answer the most recent version or
the
exact version if explicitly specified."
^ sortedVersions
detect: [:aMCVersionName | aMCVersionName = mcVersion
"explicit version specified"]
ifNone: [sortedVersions
detect: [:aMCVersionName | (mcVersion
beginsWith: aMCVersionName packageAndBranchName)
and: [aMCVersionName
beginsWith: mcVersion "most recent version that matches"]]
ifNone: []]!