Skip to content

Commit

Permalink
Add initial sar building implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusDoe committed Jan 8, 2024
1 parent 21f4b76 commit 27c482f
Show file tree
Hide file tree
Showing 25 changed files with 120 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sar
buildSar
^ SquotSarBuilder buildSarFrom: self
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sar
writeSarToFileNamed: aString
self buildSar writeToFileNamed: aString.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"basicName:" : "mad 12/8/2023 17:30",
"branchName:" : "mad 6/4/2023 16:09",
"branchesBaseName" : "mad 6/4/2023 16:09",
"buildSar" : "mad 11/14/2023 18:33",
"changeSetsFromCommit:toCommit:" : "mad 9/6/2023 19:28",
"changeSetsFromCommitToImage:" : "mad 9/6/2023 19:28",
"changeSetsFromFSCommit:toFSCommit:" : "mad 9/20/2023 12:51",
Expand Down Expand Up @@ -147,4 +148,5 @@
"updateHeadToRef:" : "mad 9/13/2023 21:36",
"upstreamRemoteNameAndRefFor:" : "mad 12/13/2023 19:01",
"upstreamRemoteNameAndRefForBranch:" : "mad 12/13/2023 19:02",
"withUnitOfWork:" : "mad 8/31/2023 12:58" } }
"withUnitOfWork:" : "mad 8/31/2023 12:58",
"writeSarToFileNamed:" : "mad 11/14/2023 18:34" } }
3 changes: 3 additions & 0 deletions src/Squot.package/SquotCodeMapper.class/instance/addToSar..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sar
addToSar: aSarBuilder
aSarBuilder addPackage: self package at: self pathWithPackage.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"instance" : {
"=" : "mad 9/26/2023 15:20",
"aboutToStyle:with:requestor:at:" : "mad 11/7/2023 12:09",
"addToSar:" : "mad 11/14/2023 19:01",
"changeSetFromFSCommit:toFSCommit:" : "mad 9/6/2023 19:03",
"changeSetFromFSCommit:toImage:" : "mad 9/6/2023 19:03",
"changeSetFromImage:toFSCommit:" : "mad 9/6/2023 19:03",
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
instance creation
buildSarFrom: aWorkingCopy
^ (self newWithWorkingCopy: aWorkingCopy) buildSar
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
instance creation
newWithWorkingCopy: aWorkingCopy
^ self new
workingCopy: aWorkingCopy;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
building
addPackage: aPackage at: aPath
(self addedPackages includes: aPackage) ifTrue: [^ self].
self
addVersion: ((MCWorkingCopy forPackage: aPackage)
newVersionWithName: aPackage name
message: 'Created by Squot for an export to a .sar')
at: aPath.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
addPreambleLine: aString
self preamble: self preamble, aString, String cr.
12 changes: 12 additions & 0 deletions src/Squot.package/SquotSarBuilder.class/instance/addVersion.at..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
building
addVersion: aVersion at: aPath
| stream mczPath |
(self addedPackages includes: aVersion package) ifTrue: [^ self].
stream := RWBinaryOrTextStream on: (String new: 10000).
aVersion fileOutOn: stream.
mczPath := (SquotPathUtilities asString: aPath), '.mcz'.
(self zip addString: stream contents as: mczPath)
desiredCompressionLevel: 0. "mcz is already compressed"
self addPreambleLine: ('self fileInMonticelloZipVersionNamed: {1}.'
format: {mczPath printString}).
self addedPackages add: aVersion package.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
addedPackages: aSet
addedPackages := aSet
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
addedPackages
^ addedPackages
5 changes: 5 additions & 0 deletions src/Squot.package/SquotSarBuilder.class/instance/buildSar.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
building
buildSar
self mappers do: [:each | each addToSar: self].
self zip addString: self preamble as: 'install/preamble'.
^ self zip
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
initialize-release
initialize
super initialize.
self
zip: ZipArchive new;
preamble: '';
addedPackages: Set new.
3 changes: 3 additions & 0 deletions src/Squot.package/SquotSarBuilder.class/instance/mappers.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
mappers
^ self workingCopy mappers
3 changes: 3 additions & 0 deletions src/Squot.package/SquotSarBuilder.class/instance/preamble..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
preamble: aString
preamble := aString
3 changes: 3 additions & 0 deletions src/Squot.package/SquotSarBuilder.class/instance/preamble.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
preamble
^ preamble
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
workingCopy: aWorkingCopy
workingCopy := aWorkingCopy
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
workingCopy
^ workingCopy
3 changes: 3 additions & 0 deletions src/Squot.package/SquotSarBuilder.class/instance/zip..st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
zip: aZipArchive
zip := aZipArchive
3 changes: 3 additions & 0 deletions src/Squot.package/SquotSarBuilder.class/instance/zip.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
zip
^ zip
19 changes: 19 additions & 0 deletions src/Squot.package/SquotSarBuilder.class/methodProperties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"class" : {
"buildSarFrom:" : "mad 11/14/2023 18:28",
"newWithWorkingCopy:" : "mad 11/14/2023 18:27" },
"instance" : {
"addPackage:at:" : "mad 11/14/2023 19:28",
"addPreambleLine:" : "mad 11/14/2023 18:46",
"addVersion:at:" : "mad 11/21/2023 15:15",
"addedPackages" : "mad 11/14/2023 19:05",
"addedPackages:" : "mad 1/8/2024 20:33",
"buildSar" : "mad 11/14/2023 18:30",
"initialize" : "mad 11/14/2023 19:05",
"mappers" : "mad 11/14/2023 18:35",
"preamble" : "mad 11/14/2023 18:30",
"preamble:" : "mad 11/14/2023 18:30",
"workingCopy" : "mad 11/14/2023 18:30",
"workingCopy:" : "mad 11/14/2023 18:30",
"zip" : "mad 11/14/2023 18:30",
"zip:" : "mad 11/14/2023 18:31" } }
17 changes: 17 additions & 0 deletions src/Squot.package/SquotSarBuilder.class/properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"category" : "Squot-Mapper-Sar",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
"workingCopy",
"zip",
"preamble",
"addedPackages" ],
"name" : "SquotSarBuilder",
"pools" : [
],
"super" : "Object",
"type" : "normal" }
1 change: 1 addition & 0 deletions src/Squot.package/monticello.meta/categories.st
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ SystemOrganization addCategory: #'Squot-Mapper-Blob'!
SystemOrganization addCategory: #'Squot-Mapper-Sound'!
SystemOrganization addCategory: #'Squot-Mapper-Multitext'!
SystemOrganization addCategory: #'Squot-Mapper-Code'!
SystemOrganization addCategory: #'Squot-Mapper-Sar'!
SystemOrganization addCategory: #'Squot-Mapper-Utilities'!

0 comments on commit 27c482f

Please sign in to comment.