[Pkg] Installer: Installer-Core-mtf.234.mcz

squeak-dev-noreply at lists.squeakfoundation.org squeak-dev-noreply at lists.squeakfoundation.org
Fri Oct 10 22:24:50 UTC 2008


A new version of Installer-Core was added to project Installer:
http://www.squeaksource.com/Installer/Installer-Core-mtf.234.mcz

==================== Summary ====================

Name: Installer-Core-mtf.234
Author: mtf
Time: 9 October 2008, 4:31:26 pm
UUID: 46a0ae9d-6dc7-47db-94ff-c8e896b408cd
Ancestors: Installer-Core-mtf.233

moved the Launcher support code out of cruft
moved Installer view: out of cruft

=============== Diff against Installer-Core-mtf.233 ===============

Item was added:
+ ----- Method: Installer>>reportFor:page:on: (in category 'action report') -----
+ reportFor: theLine page: thePage on: report 
+  	
+ 	[ thePage atEnd ] whileFalse: [ 
+ 		| line |
+ 		line := thePage nextLine.
+ 		Installer actionMatch: line reportOn: report ifNoMatch: [ report nextPutAll: line; cr. ]].!

Item was added:
+ ----- Method: Installer class>>do: (in category 'launcher support') -----
+ do: webPageName
+ 
+ 	| rs |
+ 	self webSearchPath isEmpty ifTrue: [ ^self error: 'search path not set' ].
+ 	rs := webPageName readStream.
+ 	[ rs atEnd ] whileFalse: [ self install: (rs upTo: $;) ].
+ !

Item was added:
+ ----- Method: Installer>>reportSection:on: (in category 'action report') -----
+ reportSection: line on: report
+ 	
+ 	report isEmpty ifFalse: [ report cr ].
+ 	report nextPutAll: '">>>> ' ; nextPutAll: (line copyWithout: $"); nextPut: $"; cr.
+ 
+ 	!

Item was added:
+ ----- Method: InstallerUrl>>action:reportOn: (in category 'action report') -----
+ action: line reportOn: report 
+  
+ 	url :=  line readStream upTo: $' ; upTo: $'.
+   	
+ 	self reportSection: line on: report.
+ 
+ 	(pageDataStream := self urlGet: self urlToDownload) 
+ 		ifNil: [ self error: 'unable to contact host' ].
+ 	 	
+ 	self reportFor: line page: pageDataStream on: report !

Item was added:
+ ----- Method: Installer class>>actionMatch:reportOn:ifNoMatch: (in category 'action report') -----
+ actionMatch: theLine reportOn: report ifNoMatch: aBlock
+ 
+ 	| line |	
+ 	line := theLine withBlanksCondensed.
+ 	self allSubclassesDo: [:class |
+ 		(class canReportLine: line)
+ 		ifTrue: [ ^ class new action: theLine reportOn: report ]].
+ 	^ aBlock value!

Item was added:
+ ----- Method: InstallerMantis>>action:reportOn: (in category 'action report') -----
+ action: line reportOn: report
+ 	
+ 	| param mantis |
+ 	mantis := Installer mantis.
+ 	param :=  line readStream upTo: $: ; upTo: $..
+ 	
+ 	mantis setBug: ((param readStream upTo: $'; atEnd)
+ 		 ifTrue: [  param ]
+ 		 ifFalse: [ param readStream upTo: $'; upTo: $' ]).
+ 	
+ 	self reportSection: line on: report.
+ 	report nextPutAll: (mantis replaceEntitiesIn: mantis markersBegin readStream).
+ 	self reportFor: line page: mantis maScript on: report.
+ 	report nextPutAll: (mantis replaceEntitiesIn: mantis markersEnd readStream); cr.
+ 	!

Item was added:
+ ----- Method: InstallerMantis class>>canReportLine: (in category 'action report') -----
+ canReportLine: line
+ 	^ line beginsWith: 'Installer mantis fixBug:'!

Item was added:
+ ----- Method: InstallerWeb class>>canReportLine: (in category 'action report') -----
+ canReportLine: line
+ 	^ ((line beginsWith: 'Installer install:') | (line beginsWith: 'Installer do:'))!

Item was added:
+ ----- Method: Installer class>>view: (in category 'instanciation') -----
+ view: webPageNameOrUrl
+ 
+ 	| theReport |
+ 
+ 	theReport := String streamContents: [ :report | 
+ 	(webPageNameOrUrl beginsWith: 'http://') ifTrue: [ 
+ 		self actionMatch: ('Installer installUrl: ', (webPageNameOrUrl printString),'.')  	
+ 			reportOn: report ifNoMatch: []
+ 	]
+ 	ifFalse: [
+ 		self actionMatch: ('Installer install: ', (webPageNameOrUrl printString),'.')  	
+ 			reportOn: report ifNoMatch: []
+ 	]].
+ 
+ 	Workspace new contents: (theReport contents); openLabel: webPageNameOrUrl.
+ 
+ 	^theReport contents
+ !

Item was added:
+ ----- Method: Installer class>>launchHelp (in category 'launcher support') -----
+ launchHelp
+ 
+ ^'path=/dir/*.txt          Specify a search path for the item to install
+ p=/dir1/*.txt;<url2>/    Multiple items delimited by ;
+                          The page name is typically appended to the path string, or
+                          if a "*" is present, it will be replaced by the page name.
+ 					
+ in,i,install=<page>      Page appended to the path to begin the install process
+ url,u=<url>              Install using an explicit url from which to obtain a script or file
+ file=<url>                Install using a local file
+ +debug                   Do not trap errors
+ view=<page>              Print the script that would have been installed.
+ 
+ For more options use Script eval="Installer ... " 
+ '
+ !

Item was added:
+ ----- Method: Installer class>>launchFrom: (in category 'launcher support') -----
+ launchFrom: launcher
+ 
+ 	^self launchWith: launcher getParameters!

Item was added:
+ ----- Method: InstallerWeb>>action:reportOn: (in category 'action report') -----
+ action: line reportOn: report
+ 	
+ 	self package: (line readStream upTo: $' ; upTo: $').
+ 
+ 	self reportSection: line on: report.
+ 	
+  	url := self webFindUrlToDownload.
+ 	
+ 	self reportFor: line page: pageDataStream on: report !

Item was added:
+ ----- Method: InstallerUrl class>>canReportLine: (in category 'action report') -----
+ canReportLine: line
+ 	^ ((line beginsWith: 'Installer installUrl:') and: 
+ 		[ | ext |
+ 		 ext :=  (line readStream upToAll: '''.') copyAfterLast: $..
+ 		 (#( 'cs' 'st' 'mcz' 'sar') includes: ext) not ])!

Item was added:
+ ----- Method: Installer class>>canReportLine: (in category 'action report') -----
+ canReportLine: line
+ 	^ false!

Item was added:
+ ----- Method: Installer class>>launchWith: (in category 'launcher support') -----
+ launchWith: params
+ 
+  	params at: 'P' ifPresent: [ :v | params at: 'PATH' put: v ].
+  	params at: 'I' ifPresent: [ :v | params at: 'INSTALL' put: v ].
+  	params at: 'IN' ifPresent: [ :v | params at: 'INSTALL' put: v ].
+  	params at: 'U' ifPresent: [ :v | params at: 'URL' put: v ].
+ 
+ 	params at: 'PATH' ifPresent: [ :v | 
+ 		self webSearchPathFrom: v.
+ 	].
+ 
+ 	params at: 'USER' ifPresent: [ :v | 
+ 		Utilities setAuthorInitials: v
+ 	].
+ 	params at: 'VERSION' ifPresent: [ :v | 
+ 		SystemVersion current version: v
+ 	].
+ 	params at: 'VIEW' ifPresent: [ :v |
+ 		self view: v
+ 	].
+ 
+ 	IsSetToTrapErrors := true.
+ 	params at: 'DEBUG' ifPresent: [ :v | IsSetToTrapErrors := (v == true) not ].
+ 
+  	params at: 'URL' ifPresent: [ :v | 
+ 		 self installUrl: v
+ 	].
+ 
+ 	params at: 'FILE' ifPresent: [ :v | 
+ 		 self installFile: v
+ 	].
+  
+  	params at: 'INSTALL' ifPresent: [ :v | 
+ 		  self do: v
+ 	].
+ 	params at: 'DO' ifPresent: [ :v | 
+ 		  self do: v
+ 	].
+  
+ 	 ^true
+ 
+ 	!

Item was removed:
- ----- Method: InstallerCruft>>reportFor:page:on: (in category 'action report') -----
- reportFor: theLine page: thePage on: report 
-  	
- 	[ thePage atEnd ] whileFalse: [ 
- 		| line |
- 		line := thePage nextLine.
- 		self actionMatch: line reportOn: report ifNoMatch: [ report nextPutAll: line; cr. ]].!

Item was removed:
- ----- Method: InstallerCruft class>>do: (in category 'launcher support') -----
- do: webPageName
- 
- 	| rs |
- 	self webSearchPath isEmpty ifTrue: [ ^self error: 'search path not set' ].
- 	rs := webPageName readStream.
- 	[ rs atEnd ] whileFalse: [ self install: (rs upTo: $;) ].
- !

Item was removed:
- ----- Method: InstallerCruft>>urlAction:reportOn: (in category 'action report') -----
- urlAction: line reportOn: report 
-  
- 	url :=  line readStream upTo: $' ; upTo: $'.
-   	
- 	self reportSection: line on: report.
- 
- 	(pageDataStream := self urlGet: self urlToDownload) 
- 		ifNil: [ self error: 'unable to contact host' ].
- 	 	
- 	self reportFor: line page: pageDataStream on: report !

Item was removed:
- ----- Method: InstallerCruft>>reportSection:on: (in category 'action report') -----
- reportSection: line on: report
- 	
- 	report isEmpty ifFalse: [ report cr ].
- 	report nextPutAll: '">>>> ' ; nextPutAll: (line copyWithout: $"); nextPut: $"; cr.
- 
- 	!

Item was removed:
- ----- Method: InstallerCruft>>webAction:reportOn: (in category 'action report') -----
- webAction: line reportOn: report
- 	
- 	self package: (line readStream upTo: $' ; upTo: $').
- 
- 	self reportSection: line on: report.
- 	
-  	url := self webFindUrlToDownload.
- 	
- 	self reportFor: line page: pageDataStream on: report !

Item was removed:
- ----- Method: InstallerCruft class>>view: (in category 'instanciation') -----
- view: webPageNameOrUrl
- 
- 	| theReport |
- 
- 	theReport := String streamContents: [ :report | 
- 	(webPageNameOrUrl beginsWith: 'http://') ifTrue: [ 
- 		self new urlAction: ('Installer installUrl: ', (webPageNameOrUrl printString),'.')  	
- 						 reportOn: report.
- 	]
- 	ifFalse: [
- 		self new webAction: ('Installer install: ', (webPageNameOrUrl printString),'.')  	
- 						 reportOn: report.
- 	]].
- 
- 	Workspace new contents: (theReport contents); openLabel: webPageNameOrUrl.
- 
- 	^theReport contents
- !

Item was removed:
- ----- Method: InstallerCruft class>>launchHelp (in category 'launcher support') -----
- launchHelp
- 
- ^'path=/dir/*.txt          Specify a search path for the item to install
- p=/dir1/*.txt;<url2>/    Multiple items delimited by ;
-                          The page name is typically appended to the path string, or
-                          if a "*" is present, it will be replaced by the page name.
- 					
- in,i,install=<page>      Page appended to the path to begin the install process
- url,u=<url>              Install using an explicit url from which to obtain a script or file
- file=<url>                Install using a local file
- +debug                   Do not trap errors
- view=<page>              Print the script that would have been installed.
- 
- For more options use Script eval="Installer ... " 
- '
- !

Item was removed:
- ----- Method: InstallerCruft>>actionMatch:reportOn:ifNoMatch: (in category 'action report') -----
- actionMatch: theLine reportOn: report ifNoMatch: aBlock
- 
- 	| line |	
- 	line := theLine withBlanksCondensed.
- 	((line beginsWith: 'Installer install:') | (line beginsWith: 'Installer do:')) 
- 		ifTrue: [ ^self webAction: theLine reportOn: report ].
- 		
- 	((line beginsWith: 'Installer installUrl:') and: 
- 		[ | ext |
- 		 ext :=  (line readStream upToAll: '''.') copyAfterLast: $..
- 		 (#( 'cs' 'st' 'mcz' 'sar') includes: ext) not ]) ifTrue: [ ^self urlAction: theLine reportOn: report ].
- 
- 	(line beginsWith: 'Installer mantis fixBug:') ifTrue: [ ^self mantisAction: theLine reportOn: report ].
- 	aBlock value.
- !

Item was removed:
- ----- Method: InstallerCruft class>>launchFrom: (in category 'launcher support') -----
- launchFrom: launcher
- 
- 	^self launchWith: launcher getParameters!

Item was removed:
- ----- Method: InstallerCruft class>>launchWith: (in category 'launcher support') -----
- launchWith: params
- 
-  	params at: 'P' ifPresent: [ :v | params at: 'PATH' put: v ].
-  	params at: 'I' ifPresent: [ :v | params at: 'INSTALL' put: v ].
-  	params at: 'IN' ifPresent: [ :v | params at: 'INSTALL' put: v ].
-  	params at: 'U' ifPresent: [ :v | params at: 'URL' put: v ].
- 
- 	params at: 'PATH' ifPresent: [ :v | 
- 		self webSearchPathFrom: v.
- 	].
- 
- 	params at: 'USER' ifPresent: [ :v | 
- 		Utilities setAuthorInitials: v
- 	].
- 	params at: 'VERSION' ifPresent: [ :v | 
- 		SystemVersion current version: v
- 	].
- 	params at: 'VIEW' ifPresent: [ :v |
- 		self view: v
- 	].
- 
- 	IsSetToTrapErrors := true.
- 	params at: 'DEBUG' ifPresent: [ :v | IsSetToTrapErrors := (v == true) not ].
- 
-  	params at: 'URL' ifPresent: [ :v | 
- 		 self installUrl: v
- 	].
- 
- 	params at: 'FILE' ifPresent: [ :v | 
- 		 self installFile: v
- 	].
-  
-  	params at: 'INSTALL' ifPresent: [ :v | 
- 		  self do: v
- 	].
- 	params at: 'DO' ifPresent: [ :v | 
- 		  self do: v
- 	].
-  
- 	 ^true
- 
- 	!

Item was removed:
- ----- Method: InstallerCruft>>mantisAction:reportOn: (in category 'action report') -----
- mantisAction: line reportOn: report
- 	
- 	| param mantis |
- 	mantis := Installer mantis.
- 	param :=  line readStream upTo: $: ; upTo: $..
- 	
- 	mantis setBug: ((param readStream upTo: $'; atEnd)
- 		 ifTrue: [  param ]
- 		 ifFalse: [ param readStream upTo: $'; upTo: $' ]).
- 	
- 	self reportSection: line on: report.
- 	report nextPutAll: (mantis replaceEntitiesIn: mantis markersBegin readStream).
- 	self reportFor: line page: mantis maScript on: report.
- 	report nextPutAll: (mantis replaceEntitiesIn: mantis markersEnd readStream); cr.
- 	!



More information about the Packages mailing list