ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/iblocaldb/nongui/IBXUpgradeConfFile.pas
(Generate patch)

Comparing ibx/trunk/iblocaldb/nongui/IBXUpgradeConfFile.pas (file contents):
Revision 315 by tony, Thu Feb 25 11:56:36 2021 UTC vs.
Revision 345 by tony, Mon Aug 23 14:22:29 2021 UTC

# Line 112 | Line 112 | type
112      destructor Destroy; override;
113      class function IsAbsolutePath(aPath: string): boolean;
114      function CheckUpgradeAvailable(RequiredVersionNo: integer): boolean;
115 <    function GetUpgradeInfo(VersionNo: integer; var UpgradeInfo: TUpgradeInfo): boolean;
115 >    function GetUpgradeInfo(SectionHeaderTemplate: string; VersionNo: integer;
116 >      var UpgradeInfo: TUpgradeInfo): boolean;
117      function GetSourceFile(aName: string; var FileName: string): boolean;
118      procedure GetParamValue(Sender: TObject; ParamName: string; var BlobID: TISC_QUAD);
119      property UpgradeAvailableToVersion: integer read GetUpgradeAvailableToVersion;
# Line 125 | Line 126 | implementation
126  
127   uses ZStream, IBBlob, ibxscript, IBMessages;
128  
128 const
129  sSectionheader      = 'Version.%.3d';
130
129   resourcestring
130    sInvalidConfFile = 'Database Upgrade Required, but the Upgrade File (%s) is missing or not specified';
131    sUpgradeRequired = 'Database Upgrade Required, but the Upgrade File is out of Date. '+
# Line 177 | Line 175 | begin
175      raise EUpgradeConfFileError.CreateFmt(sUpgradeRequired, [RequiredVersionNo,CurVersion]);
176   end;
177  
178 < function TUpgradeConfFile.GetUpgradeInfo(VersionNo: integer;
178 > function TUpgradeConfFile.GetUpgradeInfo(SectionHeaderTemplate: string; VersionNo: integer;
179    var UpgradeInfo: TUpgradeInfo): boolean;
180   begin
181     Result := false;
182 <   FCurrentVersion := Format(sSectionheader,[VersionNo]);
182 >   FCurrentVersion := Format(SectionHeaderTemplate,[VersionNo]);
183     UpgradeInfo.UserMessage := FUpgradeInfo.ReadString(FCurrentVersion,'Msg',
184                                  Format(sNoInfo,[VersionNo]));
185     UpgradeInfo.UpdateSQLFile := FUpgradeInfo.ReadString(FCurrentVersion,'Upgrade','');
# Line 192 | Line 190 | begin
190       if not IsAbsolutePath(UpgradeInfo.UpdateSQLFile) then
191         UpgradeInfo.UpdateSQLFile := ExtractFilePath(FConfFileName) + UpgradeInfo.UpdateSQLFile;
192       UpgradeInfo.BackupDB := CompareText(FUpgradeInfo.ReadString(FCurrentVersion,'BackupDatabase','no'),'yes') = 0;
193 <     Result := FileExists(UpgradeInfo.UpdateSQLFile);
193 >     if not FileExists(UpgradeInfo.UpdateSQLFile) then
194 >       IBError(ibxePatchFileNotFound,[FUpgradeInfo.FileName,UpgradeInfo.UpdateSQLFile, FCurrentVersion])
195 >     else
196 >       Result := true;
197     end;
198   end;
199  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines