-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #208 from dalehenrich/dev_dev
misc. bugfixes/features
- Loading branch information
Showing
180 changed files
with
653 additions
and
217 deletions.
There are no files selected for viewing
15 changes: 0 additions & 15 deletions
15
...sitory/Tode-GemStone-Core2x.package/TDGemStoneTool.extension/instance/buBackup.safely..st
This file was deleted.
Oops, something went wrong.
6 changes: 3 additions & 3 deletions
6
...sion/instance/performOnServer.logging..st → ...sion/instance/performOnServer.logging..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
*topez-server-33x-core | ||
*tode-gemstone-core2x | ||
performOnServer: command logging: logging | ||
| result | | ||
result := (System performOnServer: command) asUnicodeString. | ||
result := System performOnServer: command. | ||
logging | ||
ifTrue: [ | ||
Transcript | ||
cr; | ||
show: command printString; | ||
cr; | ||
show: result ]. | ||
^ result | ||
^ result |
4 changes: 4 additions & 0 deletions
4
repository/Tode-GemStone-Core2x.package/TDGemStoneTool.extension/instance/systemIsVoting.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*tode-gemstone-core2x | ||
systemIsVoting | ||
|
||
^false |
31 changes: 31 additions & 0 deletions
31
...-GemStone-Core3x.package/TDAbstractDevTool.extension/instance/performOnServer.logging..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
*tode-gemstone-core3x | ||
performOnServer: commandLine logging: logging | ||
| result | | ||
result := self | ||
performOnServer: commandLine | ||
status: [ :performOnServerStatusArray | | ||
"Array of 5 elements: | ||
raw status Integer, | ||
child process status Integer (after WEXITSTATUS macro applied), | ||
result String (or nil if operation failed) , | ||
error string from script file write, fork, or result file read , | ||
errno value, a SmallInteger from file write, fork, or file read" | ||
(performOnServerStatusArray at: 1) ~~ 0 | ||
ifTrue: [ | ||
| message | | ||
message := 'performOnServer: ' , commandLine printString , ' stdout: ' | ||
, (performOnServerStatusArray at: 3) printString | ||
, ' failed with status: ' | ||
, (performOnServerStatusArray at: 1) printString , ' errno: ' | ||
, (performOnServerStatusArray at: 5) printString , ' errStr: ' | ||
, (performOnServerStatusArray at: 4) asString. | ||
self error: message ]. | ||
performOnServerStatusArray at: 3 ]. | ||
logging | ||
ifTrue: [ | ||
Transcript | ||
cr; | ||
show: commandLine printString; | ||
cr; | ||
show: result ]. | ||
^ result |
5 changes: 5 additions & 0 deletions
5
...e-GemStone-Core3x.package/TDAbstractDevTool.extension/instance/performOnServer.status..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*tode-gemstone-core3x | ||
performOnServer: commandLine status: statusBlock | ||
| performOnServerStatusArray | | ||
performOnServerStatusArray := System _performOnServer: commandLine. | ||
^ statusBlock value: performOnServerStatusArray |
6 changes: 6 additions & 0 deletions
6
repository/Tode-GemStone-Core3x.package/TDAbstractDevTool.extension/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"class" : { | ||
}, | ||
"instance" : { | ||
"performOnServer:logging:" : "dkh 09/16/2015 14:27", | ||
"performOnServer:status:" : "dkh 09/16/2015 14:29" } } |
File renamed without changes.
18 changes: 0 additions & 18 deletions
18
...sitory/Tode-GemStone-Core3x.package/TDGemStoneTool.extension/instance/buBackup.safely..st
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
repository/Tode-GemStone-Core3x.package/TDGemStoneTool.extension/instance/systemIsVoting.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
*tode-gemstone-core3x | ||
systemIsVoting | ||
| vs sessId | | ||
vs := System voteState. | ||
sessId := System sessionIdHoldingGcLock. | ||
^ sessId ~= 0 or: [ vs > 0 and: [ vs < 4 ] ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
repository/Tode-GemStone-Core3x.package/monticello.meta/version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
(name 'Tode-GemStone-Core3x-dkh.2' message 'add --safely option to `bu backup` command' id 'c59dc3b6-a4e5-4e60-b5f8-1e4622b999b8' date '03/22/2015' time '08:07:11' author 'dkh' ancestors ((name 'Tode-GemStone-Core3x-dkh.1' message 'fixing `bu` command for 2.4.x' id '6fc89f19-19a6-4eac-af9b-30576a638d2e' date '11/20/2014' time '11:21:19' author 'dkh' ancestors () stepChildren ())) stepChildren ()) | ||
(name 'Tode-GemStone-Core3x-dkh.3' message 'Issue #202: add --uncompressed option to `bu backup` command. Default for `bu backup` is to create a compressed backup. Also add a `bu validate` command for validating the readability of backup files ... update tests ,, improve (hopefully) performOnServer: functionality by getting back explicit command status' id '6f045600-4da2-4552-b935-8d8e96f40ce5' date '09/16/2015' time '15:45:20' author 'dkh' ancestors ((name 'Tode-GemStone-Core3x-dkh.2' message 'add --safely option to `bu backup` command' id 'c59dc3b6-a4e5-4e60-b5f8-1e4622b999b8' date '03/22/2015' time '08:07:11' author 'dkh' ancestors ((name 'Tode-GemStone-Core3x-dkh.1' message 'fixing `bu` command for 2.4.x' id '6fc89f19-19a6-4eac-af9b-30576a638d2e' date '11/20/2014' time '11:21:19' author 'dkh' ancestors () stepChildren ())) stepChildren ())) stepChildren ()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
repository/Tode-GemStone-Server-Core.package/TDGemStoneTool.class/class/buvalidateManPage.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
bu | ||
buvalidateManPage | ||
^ TDManPage | ||
commandName: 'validate' | ||
fromString: | ||
'NAME | ||
bu validate - Validate that backup file is readable | ||
SYNOPSIS | ||
bu [--dir=<backup-directory>] validate [--snapshot] <backup-file> | ||
DESCRIPTION | ||
Verify the readability of the specified bacup file. | ||
With no options specified, the backup file will be read from the directory | ||
specified by the `bu directory` command. The default backup directory is named | ||
''backups'' and is located in the $GEMSTONE_DATADIR. | ||
With the --dir option specified, the restore file will be read from the named | ||
directory. | ||
With the --snapshot option specified the <backup-file> in the snapshot directory | ||
will be validated. | ||
EXAMPLES | ||
bu validate sample.dbf.gz | ||
bu --dir=/opt/gemstone/backups validate sample.dbf.gz | ||
bu validate --snapshot extent0.sample.dbf | ||
SEE ALSO | ||
bu --help backup | ||
bu --help directory | ||
bu --help info | ||
bu --help list | ||
' |
3 changes: 3 additions & 0 deletions
3
...itory/Tode-GemStone-Server-Core.package/TDGemStoneTool.class/instance/buBackup.safely..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bu | ||
buBackup: backupPath safely: safely | ||
^ self buBackup: backupPath safely: safely uncompressed: false |
26 changes: 26 additions & 0 deletions
26
...mStone-Server-Core.package/TDGemStoneTool.class/instance/buBackup.safely.uncompressed..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
bu | ||
buBackup: backupPath safely: safely uncompressed: uncompressed | ||
| theBackupPath | | ||
self systemIsVoting | ||
ifTrue: [ ^ 'Please wait until system is no longer voting and try again' ]. | ||
Transcript | ||
cr; | ||
show: '---Starting backup to ' , backupPath printString , ' ('; | ||
show: TimeStamp now asString; | ||
show: ')'. | ||
theBackupPath := uncompressed | ||
ifTrue: [ backupPath ] | ||
ifFalse: [ | ||
| postFix | | ||
postFix := '.gz'. | ||
(backupPath endsWith: postFix) | ||
ifTrue: [ backupPath ] | ||
ifFalse: [ | ||
".gz automatically added to filename during compressed backup" | ||
backupPath , postFix ] ]. | ||
self fullBackupTo: theBackupPath safely: safely uncompressed: uncompressed. | ||
self class lastBackup: theBackupPath. | ||
Transcript | ||
cr; | ||
show: '---Finished backup to ' , LastBackup. | ||
^ theBackupPath |
3 changes: 3 additions & 0 deletions
3
...mStone-Server-Core.package/TDGemStoneTool.class/instance/buValidateReadableBackupFile..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bu | ||
buValidateReadableBackupFile: backupFilePath | ||
^ self copydbf: '' forFilePath: backupFilePath , ' /dev/null' |
15 changes: 11 additions & 4 deletions
15
repository/Tode-GemStone-Server-Core.package/TDGemStoneTool.class/instance/bubackup.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
bu | ||
bubackup | ||
" | ||
bu [--dir=<backup-directory>] backup [--safely] <backup-file> | ||
bu [--dir=<backup-directory>] backup [--safely] [--uncompressed] <backup-file> | ||
" | ||
|
||
| backupFilePath safely | | ||
self getSubcommandOptsMixedLongShort: {#('safely' nil #'none')}. | ||
| backupFilePath safely uncompressed | | ||
self | ||
getSubcommandOptsMixedLongShort: | ||
{#('safely' nil #'none'). | ||
#('uncompressed' nil #'none')}. | ||
backupFilePath := self resolveBackupFilePath. | ||
subOptions | ||
at: 'safely' | ||
ifPresent: [ :ignored | safely := true ] | ||
ifAbsent: [ safely := false ]. | ||
^ self buBackup: backupFilePath safely: safely | ||
subOptions | ||
at: 'uncompressed' | ||
ifPresent: [ :ignored | uncompressed := true ] | ||
ifAbsent: [ uncompressed := false ]. | ||
^ self buBackup: backupFilePath safely: safely uncompressed: uncompressed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
repository/Tode-GemStone-Server-Core.package/TDGemStoneTool.class/instance/buvalidate.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
bu | ||
buvalidate | ||
" | ||
bu [--dir=<backup-directory>] validate [--snapshot] <backup-file> | ||
" | ||
|
||
| filePath | | ||
self getSubcommandOptsMixedLongShort: {#('snapshot' nil #'none')}. | ||
filePath := subOptions | ||
at: 'snapshot' | ||
ifPresent: [ :ignored | self resolveSnapshotFilePath ] | ||
ifAbsent: [ self resolveBackupFilePath ]. | ||
self buValidateReadableBackupFile: filePath |
6 changes: 6 additions & 0 deletions
6
...y/Tode-GemStone-Server-Core.package/TDGemStoneTool.class/instance/copydbf.forFilePath..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
bu | ||
copydbf: args forFilePath: filePath | ||
| copyDbfCommand | | ||
copyDbfCommand := (GsFile _expandEnvVariable: 'GEMSTONE' isClient: false) | ||
, '/bin/copydbf ' , args , ' ' , filePath. | ||
^ self performOnServer: copyDbfCommand logging: true |
26 changes: 1 addition & 25 deletions
26
...y/Tode-GemStone-Server-Core.package/TDGemStoneTool.class/instance/fullBackupTo.safely..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,3 @@ | ||
bu | ||
fullBackupTo: backupPath safely: safely | ||
| backupFilename backupDirName backupDir result | | ||
ServerFileDirectory | ||
splitName: backupPath | ||
to: [ :dirPath :filename | | ||
backupDirName := dirPath. | ||
backupFilename := filename ]. | ||
backupDir := ServerFileDirectory on: backupDirName. | ||
(backupDir fileExists: backupFilename) | ||
ifTrue: [ | ||
safely | ||
ifTrue: [ | ||
Transcript | ||
cr; | ||
show: | ||
'Skipping backup, --safely specified and ' , backupFilename printString | ||
, ' exists.'. | ||
^ false ]. | ||
backupDir deleteFileNamed: backupFilename ]. | ||
System commitTransaction. | ||
result := SystemRepository fullBackupTo: backupPath. | ||
result == true | ||
ifFalse: [ ^ self error: 'Could not complete the backup: ' , result ]. "we have been left outside of transaction in manual | ||
transaction mode" | ||
System transactionMode: #'autoBegin'. | ||
^ true | ||
^ self fullBackupTo: backupPath safely: safely uncompressed: false |
Oops, something went wrong.