--- a/Tools__NewSystemBrowser.st Fri Dec 13 00:11:00 2019 +0100
+++ b/Tools__NewSystemBrowser.st Fri Dec 13 20:44:37 2019 +0100
@@ -27108,6 +27108,10 @@
!
browseMenuClassesWithInvalidCopyright
+ "by this definition, an invalid copyright is one without year following the copyright string,
+ or one, where the copyright date does not correspond to the source-code-repository's initial version date
+ (because due to CVS being public, that is also its publishing date)."
+
|noCopyright copyrightOlder copyrightYounger invalid
oldest dateString ts copyright line yearFromCopyright yearFromCVS s|
@@ -27117,45 +27121,57 @@
invalid := OrderedCollection new.
Smalltalk allClassesDo:[:cls |
-
- (cls theMetaclass includesSelector:#copyright) ifFalse:[
- noCopyright add:cls.
- ] ifTrue:[
- Transcript showCR:' %1' with:cls name.
-
- copyright := ((cls theMetaclass sourceCodeAt:#copyright) ? '') asStringCollection.
- line := copyright detect:[:l | (l includesString:'Copyright' caseSensitive:false)
- and:[l includesAny:'0123456789']
- ]
- ifNone:nil.
- line isNil ifTrue:[
- invalid add:cls
- ] ifFalse:[
- s := line readStream.
- s skipUntil:[:c | c isDigit].
- yearFromCopyright := Integer readFrom:s.
-
- oldest := CVSSourceCodeManager oldestRevisionLogEntryOf:cls.
- dateString := oldest date.
- ts := Timestamp readFrom:dateString.
- yearFromCVS := ts year.
-
- yearFromCopyright = yearFromCVS ifFalse:[
- Transcript showCR:('%1 (CVS: %2 Copyright: %3)' bindWith:cls name with:yearFromCVS with:yearFromCopyright).
- yearFromCopyright < yearFromCVS ifTrue:[
- copyrightOlder add:cls.
- ] ifFalse:[
- copyrightYounger add:cls.
+ "/ skip private classes
+ cls isPrivate ifFalse:[
+ (cls theMetaclass includesSelector:#copyright) ifFalse:[
+ noCopyright add:cls.
+ ] ifTrue:[
+ Transcript showCR:' %1' with:cls name.
+
+ copyright := ((cls theMetaclass sourceCodeAt:#copyright) ? '') asStringCollection.
+ line := copyright detect:[:l | (l includesString:'Copyright' caseSensitive:false)
+ and:[l includesAny:'0123456789']
+ ]
+ ifNone:nil.
+ line isNil ifTrue:[
+ "/ sigh: some exceptions
+ (
+ #(
+ 'Manchester Goodie'
+ 'Public domain'
+ 'provided AS IS'
+ 'provided free of charge'
+ ) contains:[:fragment | (copyright includesString:fragment caseSensitive:false)]
+ ) ifFalse:[
+ invalid add:cls
+ ]
+ ] ifFalse:[
+ s := line readStream.
+ s skipUntil:[:c | c isDigit].
+ yearFromCopyright := Integer readFrom:s.
+
+ oldest := CVSSourceCodeManager oldestRevisionLogEntryOf:cls.
+ dateString := oldest date.
+ ts := Timestamp readFrom:dateString.
+ yearFromCVS := ts year.
+
+ yearFromCopyright = yearFromCVS ifFalse:[
+ Transcript showCR:('%1 (CVS: %2 Copyright: %3)' bindWith:cls name with:yearFromCVS with:yearFromCopyright).
+ yearFromCopyright < yearFromCVS ifTrue:[
+ copyrightOlder add:cls.
+ ] ifFalse:[
+ copyrightYounger add:cls.
+ ].
].
].
- ].
- ].
- ].
-
- self spawnClassBrowserFor:noCopyright label:'No copyright' in:#newBuffer.
- self spawnClassBrowserFor:copyrightOlder label:'Older copyright' in:#newBuffer.
- self spawnClassBrowserFor:copyrightYounger label:'Younger copyright' in:#newBuffer.
- self spawnClassBrowserFor:invalid label:'Invalid copyright' in:#newBuffer.
+ ].
+ ].
+ ].
+
+ noCopyright notEmpty ifTrue:[ self spawnClassBrowserFor:noCopyright label:'No copyright' in:#newBuffer. ]
+ copyrightOlder notEmpty ifTrue:[ self spawnClassBrowserFor:copyrightOlder label:'Older copyright' in:#newBuffer ].
+ copyrightYounger notEmpty ifTrue:[ self spawnClassBrowserFor:copyrightYounger label:'Younger copyright' in:#newBuffer ].
+ invalid notEmpty ifTrue:[ self spawnClassBrowserFor:invalid label:'Invalid copyright' in:#newBuffer ].
"/ noCopyright inspect.
"/ wrongCopyright inspect.