-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Here's a question related to PackageInfo and Monticello.
I've also asked this question on the (moderated) Cuis mailing list.
The Cuis Help system on code management says:
"More details about how PackageInfo decides what code belongs in a package are available at http://wiki.squeak.org/squeak/3329 .
To install packages (.pck.st files) in Cuis, use the FileList, navigate to the appropriate directory (on disk, or in a GitHub repository, etc), select the package file and click on [Install Package]."
My question is whether there is a way to get PackageInfo .pkg.st files,
from Monticello packages.
I downloaded the Monticello package DoItFirst-System-Support-dtl.14.mcz
and unzip'ed the file, from the UNIX command line.
This results in some files in a directory but unfortunately without .pkg.st :
bash-4.4$ find .
.
./version
./snapshot.bin
./package
./DoItFirst-System-Support-dtl.14.mcz
./snapshot
./snapshot/source.st
I was hoping to be able to fileIn the snapshot/source.st file,
or to use another method to add this package to Cuis.
Because I don't see a .pck.st file, I am trying to fileIn the source.st.
Assuming the idea to fileIn the snapshot/source.st file is correct,
I tried to fileIn the source.st file, however this fails.
The initalize method of the DoItFirst class is doing:
initialize
Smalltalk addToStartUpList: self before: SmallInteger.
When I try to load this class in a Cuis smalltalk image, it complains
that the Smalltalk class in Cuis doesNotUnderstand addToStartUpList: before:
However my main question is generally speaking whether it is possible
to load Monticello packages into Squeak, for example by a method
(unknown to me) to create .pkg.st files.
Thanks!
David Stes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBCAAGBQJfyRvaAAoJEAwpOKXMq1MaaBwH/2BAVrDAOEN+LI1sotGE6Syk
WtEp56nsAVKkINb6gW6I8+AvWpnpGgiPse9TrHIR9MR76ZyFKbh7HEC0M4f4zeZX
zoi2IYGOoc5lpce2sEygjNQhaqTD4RfWwQ6Kh3Cr4pDnyabusYV/hTPDSeTmOABJ
g1zWc6WPoL9wCIYeFRPJa9P0ShRH5c7WOEnd/RmQzzIlUsodqOaEkU+P01IXF6t0
EwwUTKMNevxuLTwyDIkxqQ+YxSoiA2ARuP9xeEnESYF4x3OFE8uNMZ7QekBkMETE
HJoHw+Re+jl752W38TJudtIsu5FeQ4tOIzZ4BMEGieGRVtHxzcRBluygcQTPK8g=
=iBnx
-----END PGP SIGNATURE-----
Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.1194.mcz
==================== Summary ====================
Name: System-eem.1194
Author: eem
Time: 2 December 2020, 9:58:22.669121 pm
UUID: e3212f4a-d84c-4e35-b05e-ab5e16af91c0
Ancestors: System-tonyg.1193
When computing SystemNavigation>>allSentMessagesWithout: use anyAndAllSelectorsDo: which does a much better job than the existing code, and uses (indirectly) Scanner>>isMessageSelector: which provides a single point of definition to maintain cnsistency across tools, etc.
=============== Diff against System-tonyg.1193 ===============
Item was changed:
----- Method: SystemNavigation>>allSentMessagesWithout: (in category 'query') -----
allSentMessagesWithout: classesAndMessagesPair
"Answer the set of selectors which are sent somewhere in the system,
computed in the absence of the supplied classes and messages."
| sent absentClasses absentSelectors |
sent := IdentitySet new: CompiledMethod instanceCount.
absentClasses := classesAndMessagesPair first.
absentSelectors := classesAndMessagesPair second.
"sd 29/04/03"
+ Cursor execute showWhile:
+ [self environment allClassesAndTraitsDo:
+ [:cls |
+ ((absentClasses includes: cls) ifTrue: [{}] ifFalse: [{cls. cls classSide}]) do:
+ [:each |
+ (absentSelectors isEmpty
- Cursor execute showWhile: [
- self environment allClassesAndTraitsDo: [:cls |
- ((absentClasses includes: cls)
- ifTrue: [{}]
- ifFalse: [{cls. cls classSide}])
- do: [:each | (absentSelectors isEmpty
ifTrue: [each selectors]
+ ifFalse: [each selectors copyWithoutAll: absentSelectors]) do:
+ [:sel | "Include all sels, but not if sent by self"
+ (each compiledMethodAt: sel) anyAndAllSelectorsDo:
+ [:m|
+ m == sel ifFalse:
+ [sent add: m]]]]]].
- ifFalse: [each selectors copyWithoutAll: absentSelectors])
- do: [:sel | "Include all sels, but not if sent by self"
- (each compiledMethodAt: sel) allLiteralsDo: [:m |
- self flag: #dicuss. "mt: How to distinguish a symbol from a selector?"
- (m isSymbol and: [m size > 0 and: [m first isLowercase]])
- ifTrue: ["might be sent"
- m == sel ifFalse: [sent add: m]].
- ]]]]].
"The following may be sent without being in any literal frame"
Smalltalk specialSelectorNames do: [:sel | sent add: sel].
+ Smalltalk presumedSentMessages do: [:sel | sent add: sel].
+ ^sent!
- Smalltalk presumedSentMessages do: [:sel | sent add: sel].
- ^ sent.!
Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.1017.mcz
==================== Summary ====================
Name: Tools-eem.1017
Author: eem
Time: 2 December 2020, 9:56:20.281149 pm
UUID: 03df7799-92b9-4912-bed6-c446397b0cf8
Ancestors: Tools-eem.1016
In the browsers use Compiledmethod>>anyAndAllMessages instead of CompiledMethod>>messages. false positives are more tolerable tnan omitted selectors sent via perform: et al.
e.g. HaloMorph>>#addRotateHandle: really does send
#startRot:with: and #doRot:with:, albeit indirectly via perform:.
=============== Diff against Tools-eem.1016 ===============
Item was changed:
----- Method: StringHolder>>withSelectorAndMessagesIn:evaluate: (in category '*Tools') -----
withSelectorAndMessagesIn: aCompiledMethod evaluate: aBlock
"Allow the user to choose one selector, chosen from the currently selected message's selector, as well as those of all messages sent by it, and evaluate aBlock on behalf of chosen selector. If there is only one possible choice, simply make it; if there are multiple choices, put up a menu, and evaluate aBlock on behalf of the the chosen selector, doing nothing if the user declines to choose any"
| selectorOrNil messages |
selectorOrNil := aCompiledMethod selector.
+ messages := aCompiledMethod anyAndAllMessages.
- messages := aCompiledMethod messages.
messages remove: selectorOrNil ifAbsent: ["do nothing"].
messages ifEmpty: "If only one item, there is no choice"
[^selectorOrNil ifNotNil: [aBlock value: selectorOrNil]].
self systemNavigation
showMenuOf: messages
withFirstItem: selectorOrNil
ifChosenDo: aBlock!
Eliot Miranda uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-eem.920.mcz
==================== Summary ====================
Name: Collections-eem.920
Author: eem
Time: 2 December 2020, 9:49:01.130251 pm
UUID: 3767683c-33f6-4874-9e6c-83719db04fe3
Ancestors: Collections-mt.919
Add Symbol>>isMessageSelector, implemented in terms of Scanner class>>isMessageSelector:
=============== Diff against Collections-mt.919 ===============
Item was added:
+ ----- Method: Symbol>>isMessageSelector (in category 'testing') -----
+ isMessageSelector
+ "Answer if the receiver is a valid message selector. This method is not perfect.
+ The compiler does allow all caps to be selectors but these are not included.
+ If AllowUnderscoreSelectors is true then _ is a valid selector but this will be excluded
+ also. But it is IMO more useful to exclude class names and hence exclude some rarely
+ used selectors than to erroneously identify class names as message selectors."
+
+ ^Scanner isMessageSelector: self!
Eliot Miranda uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-eem.452.mcz
==================== Summary ====================
Name: Compiler-eem.452
Author: eem
Time: 2 December 2020, 9:41:04.063795 pm
UUID: 4799ba54-ed87-4188-a653-e36499d92994
Ancestors: Compiler-eem.451
Provide an acceptably accurate means to test if a SYmbol is probably a message selector, Scanner class>>isMessageSelector:.
=============== Diff against Compiler-eem.451 ===============
Item was added:
+ ----- Method: Scanner class>>isMessageSelector: (in category 'testing') -----
+ isMessageSelector: aSymbol
+ "Answer if the argument is a valid message selector.
+ This is optimized for fast filtering."
+ | first last sz type |
+ (sz := aSymbol size) = 0 ifTrue: [^false].
+ first := aSymbol at: 1.
+ last := aSymbol at: sz.
+ type := TypeTable at: first asciiValue.
+
+ type == #xLetter ifTrue:
+ ["Alas some people (myself included) do create selectors with an initial capital.
+ But this is unusual, and it is even rarer for these to be unary selectors, so I think
+ it is better to exclude class names than include the few exceptions."
+ (first isUppercase and: [last ~~ $:]) ifTrue:
+ [^false].
+ "Could be unary or keyword, may include underscores if AllowUnderscoreSelectors.
+ It is possible to be more agressive here, filtering out two successive colons, but I'm lazy"
+ ^aSymbol allSatisfy: (AllowUnderscoreSelectors
+ ifTrue:
+ [last == $:
+ ifTrue: [[:c| c == $: or: [c == $_ or: [c isAlphaNumeric]]]]
+ ifFalse: [[:c| c ~~ $: and: [c == $_ or: [c isAlphaNumeric]]]]]
+ ifFalse:
+ [last == $:
+ ifTrue: [[:c| c == $: or: [c isAlphaNumeric]]]
+ ifFalse: [[:c| c ~~ $: and: [c isAlphaNumeric]]]])].
+
+ type == #xBinary ifTrue:
+ [^aSymbol allSatisfy: [:c| c == $| or: [(TypeTable at: c asciiValue) == #xBinary]]].
+
+ ^type == #xUnderscore
+ and: [AllowUnderscoreSelectors
+ and: [self isMessageSelector: aSymbol allButFirst]]
+
+ "| implemented |
+ implemented := Set new.
+ self systemNavigation allSelect: [:m| implemented add: m selector. false].
+ ^Symbol allSubInstances select: [:s| (implemented includes: s) not and: [self isMessageSelector: s]]"
+
+ "| implemented |
+ implemented := Set new.
+ self systemNavigation allSelect: [:m| implemented add: m selector. false].
+ ^implemented reject: [:s| self isMessageSelector: s]"!
David T. Lewis uploaded a new version of 60Deprecated to project The Trunk:
http://source.squeak.org/trunk/60Deprecated-dtl.85.mcz
==================== Summary ====================
Name: 60Deprecated-dtl.85
Author: dtl
Time: 2 December 2020, 9:44:10.427748 pm
UUID: 010bb2cd-bb23-4d42-aa88-84c21eefaa31
Ancestors: 60Deprecated-mt.84
Deprecate #totalSeconds and #millisecondClockValue in DateAndTime and refer senders to the canonical implementations in Time.
=============== Diff against 60Deprecated-mt.84 ===============
Item was added:
+ ----- Method: DateAndTime class>>millisecondClockValue (in category '*60Deprecated') -----
+ millisecondClockValue
+
+ self deprecated: 'Use Time class>>millisecondClockValue instead'.
+ ^ self clock millisecondClockValue!
Item was added:
+ ----- Method: DateAndTime class>>totalSeconds (in category '*60Deprecated') -----
+ totalSeconds
+
+ self deprecated: 'Use Time class>>totalSeconds instead'.
+ ^ self clock totalSeconds!
David T. Lewis uploaded a new version of Chronology-Core to project The Trunk:
http://source.squeak.org/trunk/Chronology-Core-dtl.64.mcz
==================== Summary ====================
Name: Chronology-Core-dtl.64
Author: dtl
Time: 2 December 2020, 9:43:40.709057 pm
UUID: b3804941-fd01-4700-a64b-b00c42165675
Ancestors: Chronology-Core-eem.63
Deprecate #totalSeconds and #millisecondClockValue in DateAndTime and refer senders to the canonical implementations in Time.
=============== Diff against Chronology-Core-eem.63 ===============
Item was removed:
- ----- Method: DateAndTime class>>millisecondClockValue (in category 'smalltalk-80') -----
- millisecondClockValue
-
- ^ self clock millisecondClockValue!
Item was removed:
- ----- Method: DateAndTime class>>totalSeconds (in category 'smalltalk-80') -----
- totalSeconds
-
- ^ self clock totalSeconds!
David T. Lewis uploaded a new version of WebClient-Core to project The Trunk:
http://source.squeak.org/trunk/WebClient-Core-dtl.127.mcz
==================== Summary ====================
Name: WebClient-Core-dtl.127
Author: dtl
Time: 2 December 2020, 9:21:11.256021 pm
UUID: b29c5835-46cf-4f51-b822-b3494063f3f7
Ancestors: WebClient-Core-mt.126
Eliminate the only known use of DateAndTime class>>totalSeconds, use the proper method in class Time instead.
=============== Diff against WebClient-Core-mt.126 ===============
Item was changed:
----- Method: WebUtils class>>logEntryFor:response: (in category 'misc') -----
logEntryFor: request response: response
"Create a log entry in common log format from the given request / response"
| entry logdate logsize |
"CLF prints date as [day/month/year:hour:min:sec zone]"
logdate := String streamContents:[:s| | date |
+ date := DateAndTime fromSeconds: Time totalSeconds.
- date := DateAndTime fromSeconds: DateAndTime totalSeconds.
s nextPut: $[.
date asDate printOn: s format: #( 1 2 3 $/ 2 1 2).
s nextPut: $:.
date asTime print24: true on: s.
s nextPutAll:(' ',
(date offset hours >= 0 ifTrue:['+'] ifFalse:['-']),
(date offset hours abs asString padded: #left to: 2 with: $0),
(date offset minutes abs asString padded: #left to: 2 with: $0)
).
s nextPut: $].
].
"CLF prints zero length as - "
logsize := response contentLength ifNil:[0].
logsize = 0 ifTrue:[logsize := '-'].
entry := String streamContents:[:s|
s
nextPutAll: (request remoteHost ifNil:[
"Substitute with the host header"
(request headerAt: 'host') copyUpTo: $:
]);
nextPutAll: ' -'; "RFC 1413 identity of client"
nextPutAll: ' -'; "TODO: userid of authenticated user"
nextPutAll: ' ', logdate;
nextPutAll: ' "', request requestLine, '"';
nextPutAll: ' ', response code;
nextPutAll: ' ', logsize.
].
^entry
!