increased package version to 0.8.5.3

git-svn-id: trunk@4030 -
This commit is contained in:
mattias 2003-04-09 14:46:12 +00:00
parent 49fa9c4074
commit a7ca5dc013
7 changed files with 104 additions and 44 deletions

View File

@ -393,7 +393,7 @@ begin
end;
// check ancestor type is not unitname
PkgFile:=PackageGraph.FindUnit(LazPackage,Params.AncestorType,true);
PkgFile:=PackageGraph.FindUnit(LazPackage,Params.AncestorType,true,true);
if PkgFile<>nil then begin
if MessageDlg('Ambigious Ancestor Type',
'The ancestor type "'+Params.AncestorType+'" has the same name as'#13
@ -402,9 +402,9 @@ begin
then
exit;
end;
// check classname does not interfere with an existing unitname
PkgFile:=PackageGraph.FindUnit(LazPackage,Params.ClassName,true);
PkgFile:=PackageGraph.FindUnit(LazPackage,Params.ClassName,true,true);
if PkgFile<>nil then begin
if MessageDlg('Ambigious Class Name',
'The class name "'+Params.AncestorType+'" has the same name as'#13
@ -1001,7 +1001,7 @@ begin
end;
// check if unitname already exists in package
PkgFile:=PackageGraph.FindUnit(LazPackage,AnUnitName,true);
PkgFile:=PackageGraph.FindUnit(LazPackage,AnUnitName,true,true);
if PkgFile<>nil then begin
if PkgFile.LazPackage=LazPackage then begin
MessageDlg('Unitname already exists',
@ -1027,7 +1027,7 @@ begin
end;
// check if file already exists in package
PkgFile:=LazPackage.FindPkgFile(AFilename,true);
PkgFile:=LazPackage.FindPkgFile(AFilename,true,true);
if PkgFile<>nil then begin
Msg:='File "'+AFilename+'" already exists in the project.';
if PkgFile.Filename<>AFilename then

View File

@ -258,6 +258,7 @@ type
FAutoInstall: TPackageInstallType;
FCompilerOptions: TPkgCompilerOptions;
FComponents: TList; // TList of TPkgComponent
FDeletedFiles: TList; // TList of TPkgFile
FDependingPkgs: TList; // TList of TLazPackage
FDescription: string;
FDirectory: string;
@ -280,6 +281,8 @@ type
function GetAutoUpdate: boolean;
function GetComponentCount: integer;
function GetComponents(Index: integer): TPkgComponent;
function GetDeletedCount: integer;
function GetDeletedFiles(Index: integer): TPkgFile;
function GetDependingPkgCount: integer;
function GetDependingPkgs(Index: integer): TLazPackage;
function GetFileCount: integer;
@ -326,12 +329,13 @@ type
procedure ConsistencyCheck;
function IndexOfPkgComponent(PkgComponent: TPkgComponent): integer;
function FindPkgFile(const AFilename: string;
ResolveLinks: boolean): TPkgFile;
function FindUnit(const TheUnitName: string): TPkgFile;
ResolveLinks, IgnoreDeleted: boolean): TPkgFile;
function FindUnit(const TheUnitName: string; IgnoreDeleted: boolean): TPkgFile;
function NameAndVersion: string;
function AddFile(const NewFilename, NewUnitName: string;
NewFileType: TPkgFileType; NewFlags: TPkgFileFlags;
CompPriorityCat: TComponentPriorityCategory): TPkgFile;
procedure DeleteFile(PkgFile: TPkgFile);
procedure AddRequiredDependency(Dependency: TPkgDependency);
function CreateDependencyForThisPkg: TPkgDependency;
function AddComponent(PkgFile: TPkgFile; const Page: string;
@ -350,6 +354,8 @@ type
read FCompilerOptions;
property ComponentCount: integer read GetComponentCount;
property Components[Index: integer]: TPkgComponent read GetComponents;
property DeletedCount: integer read GetDeletedCount;
property DeletedFiles[Index: integer]: TPkgFile read GetDeletedFiles;
property DependingPkgCount: integer read GetDependingPkgCount;
property DependingPkgs[Index: integer]: TLazPackage read GetDependingPkgs;
property Description: string read FDescription write SetDescription;
@ -903,6 +909,16 @@ begin
Result:=TPkgComponent(FComponents[Index]);
end;
function TLazPackage.GetDeletedCount: integer;
begin
Result:=FDeletedFiles.Count;
end;
function TLazPackage.GetDeletedFiles(Index: integer): TPkgFile;
begin
Result:=TPkgFile(FDeletedFiles[Index]);
end;
function TLazPackage.GetDependingPkgCount: integer;
begin
Result:=FDependingPkgs.Count;
@ -1090,6 +1106,7 @@ begin
FDependingPkgs:=Tlist.Create;
FRequiredPkgs:=TList.Create;
FFiles:=TList.Create;
FDeletedFiles:=TList.Create;
FCompilerOptions:=TPkgCompilerOptions.Create;
FUsageOptions:=TAdditionalCompilerOptions.Create;
FUsedPkgs:=TList.Create;
@ -1101,6 +1118,7 @@ end;
destructor TLazPackage.Destroy;
begin
Clear;
FreeAndNil(FDeletedFiles);
FreeAndNil(FFiles);
FreeAndNil(FComponents);
FreeAndNil(FCompilerOptions);
@ -1125,6 +1143,8 @@ begin
FDirectory:='';
FVersion.Clear;
FFilename:='';
for i:=FDeletedFiles.Count-1 downto 0 do DeletedFiles[i].Free;
FDeletedFiles.Clear;
for i:=FFiles.Count-1 downto 0 do Files[i].Free;
FFiles.Clear;
FFlags:=[lpfAutoIncrementVersionOnBuild,lpfAutoUpdate];
@ -1339,6 +1359,7 @@ begin
CheckList(FUsedPkgs,true,true,true);
CheckList(FDependingPkgs,true,true,true);
CheckList(FRequiredPkgs,true,true,true);
CheckList(FDeletedFiles,true,true,true);
CheckList(FFiles,true,true,true);
CheckList(FComponents,true,true,true);
CheckEmptyListCut(FDependingPkgs,FUsedPkgs);
@ -1349,8 +1370,8 @@ begin
Result:=FComponents.IndexOf(PkgComponent);
end;
function TLazPackage.FindPkgFile(const AFilename: string; ResolveLinks: boolean
): TPkgFile;
function TLazPackage.FindPkgFile(const AFilename: string;
ResolveLinks, IgnoreDeleted: boolean): TPkgFile;
var
TheFilename: String;
Cnt: Integer;
@ -1364,18 +1385,33 @@ begin
end;
Cnt:=FileCount;
for i:=0 to Cnt-1 do begin
Result:=Files[i];
if ResolveLinks then begin
if CompareFilenames(Files[i].GetResolvedFilename,TheFilename)=0 then begin
Result:=Files[i];
end;
if CompareFilenames(Result.GetResolvedFilename,TheFilename)=0 then
exit;
end else begin
if CompareFilenames(Files[i].Filename,TheFilename)=0 then
Result:=Files[i];
if CompareFilenames(Result.Filename,TheFilename)=0 then
exit;
end;
end;
if not IgnoreDeleted then begin
Cnt:=DeletedCount;
for i:=0 to Cnt-1 do begin
Result:=DeletedFiles[i];
if ResolveLinks then begin
if CompareFilenames(Result.GetResolvedFilename,TheFilename)=0 then
exit;
end else begin
if CompareFilenames(Result.Filename,TheFilename)=0 then
exit;
end;
end;
end;
Result:=nil;
end;
function TLazPackage.FindUnit(const TheUnitName: string): TPkgFile;
function TLazPackage.FindUnit(const TheUnitName: string;
IgnoreDeleted: boolean): TPkgFile;
var
Cnt: Integer;
i: Integer;
@ -1386,6 +1422,13 @@ begin
Result:=Files[i];
if AnsiCompareText(Result.UnitName,TheUnitName)=0 then exit;
end;
if not IgnoreDeleted then begin
Cnt:=DeletedCount;
for i:=0 to Cnt-1 do begin
Result:=DeletedFiles[i];
if AnsiCompareText(Result.UnitName,TheUnitName)=0 then exit;
end;
end;
end;
Result:=nil;
end;
@ -1411,6 +1454,13 @@ begin
FFiles.Add(Result);
end;
procedure TLazPackage.DeleteFile(PkgFile: TPkgFile);
begin
FFiles.Remove(PkgFile);
FDeletedFiles.Add(PkgFile);
PkgFile.Deleted:=true;
end;
procedure TLazPackage.AddRequiredDependency(Dependency: TPkgDependency);
begin
FRequiredPkgs.Add(Dependency);

View File

@ -311,16 +311,17 @@ begin
if ANode.Parent=FilesNode then begin
// get current package file
CurFile:=LazPackage.Files[NodeIndex];
if CurFile=nil then exit;
if MessageDlg('Remove file?',
'Remove file "'+CurFile.Filename+'"'#13
+'from package "'+LazPackage.IDAsString+'"?',
mtConfirmation,[mbYes,mbNo],0)=mrNo
then
exit;
// ToDo
if CurFile<>nil then begin
// confirm deletion
if MessageDlg('Remove file?',
'Remove file "'+CurFile.Filename+'"'#13
+'from package "'+LazPackage.IDAsString+'"?',
mtConfirmation,[mbYes,mbNo],0)=mrNo
then
exit;
LazPackage.DeleteFile(CurFile);
end;
UpdateFiles;
end else if ANode.Parent=RequiredPackagesNode then begin
end;

View File

@ -99,11 +99,12 @@ type
Flags: TFindPackageFlags): TAVLTreeNode;
function FindAPackageWithName(const PkgName: string;
IgnorePackage: TLazPackage): TLazPackage;
function FindUnit(StartPackage: TLazPackage;
const TheUnitName: string; WithRequiredPackages: boolean): TPkgFile;
function FindUnitInAllPackages(const TheUnitName: string): TPkgFile;
function FindUnit(StartPackage: TLazPackage; const TheUnitName: string;
WithRequiredPackages, IgnoreDeleted: boolean): TPkgFile;
function FindUnitInAllPackages(const TheUnitName: string;
IgnoreDeleted: boolean): TPkgFile;
function FindFileInAllPackages(const TheFilename: string;
ResolveLinks: boolean): TPkgFile;
ResolveLinks, IgnoreDeleted: boolean): TPkgFile;
function FindPackageWithFilename(const TheFilename: string;
ResolveLinks: boolean): TLazPackage;
function CreateUniqueUnitName(const Prefix: string): string;
@ -298,14 +299,15 @@ begin
end;
function TLazPackageGraph.FindUnit(StartPackage: TLazPackage;
const TheUnitName: string; WithRequiredPackages: boolean): TPkgFile;
const TheUnitName: string;
WithRequiredPackages, IgnoreDeleted: boolean): TPkgFile;
var
Cnt: Integer;
i: Integer;
ADependency: TPkgDependency;
ARequiredPackage: TLazPackage;
begin
Result:=StartPackage.FindUnit(TheUnitName);
Result:=StartPackage.FindUnit(TheUnitName,IgnoreDeleted);
if Result<>nil then exit;
// search also in all required packages
if WithRequiredPackages then begin
@ -315,7 +317,7 @@ begin
if OpenDependency(ADependency,[fpfSearchInInstalledPckgs],ARequiredPackage)
=lprSuccess
then begin
Result:=ARequiredPackage.FindUnit(TheUnitName);
Result:=ARequiredPackage.FindUnit(TheUnitName,IgnoreDeleted);
if Result<>nil then exit;
end;
end;
@ -323,28 +325,28 @@ begin
end;
function TLazPackageGraph.FindUnitInAllPackages(
const TheUnitName: string): TPkgFile;
const TheUnitName: string; IgnoreDeleted: boolean): TPkgFile;
var
Cnt: Integer;
i: Integer;
begin
Cnt:=Count;
for i:=0 to Cnt-1 do begin
Result:=FindUnit(Packages[i],TheUnitName,false);
Result:=FindUnit(Packages[i],TheUnitName,false,IgnoreDeleted);
if Result<>nil then exit;
end;
Result:=nil;
end;
function TLazPackageGraph.FindFileInAllPackages(const TheFilename: string;
ResolveLinks: boolean): TPkgFile;
ResolveLinks, IgnoreDeleted: boolean): TPkgFile;
var
Cnt: Integer;
i: Integer;
begin
Cnt:=Count;
for i:=0 to Cnt-1 do begin
Result:=Packages[i].FindPkgFile(TheFilename,ResolveLinks);
Result:=Packages[i].FindPkgFile(TheFilename,ResolveLinks,IgnoreDeleted);
if Result<>nil then exit;
end;
Result:=nil;
@ -381,13 +383,13 @@ function TLazPackageGraph.CreateUniqueUnitName(const Prefix: string): string;
var
i: Integer;
begin
if FindUnitInAllPackages(Prefix)=nil then
if FindUnitInAllPackages(Prefix,false)=nil then
Result:=Prefix
else begin
i:=1;
repeat
Result:=Prefix+IntToStr(i);
until FindUnitInAllPackages(Result)=nil;
until FindUnitInAllPackages(Result,false)=nil;
end;
end;
@ -456,9 +458,16 @@ begin
exit;
end;
// check unit file
FRegistrationFile:=FRegistrationPackage.FindUnit(FRegistrationUnitName);
FRegistrationFile:=FRegistrationPackage.FindUnit(FRegistrationUnitName,true);
if FRegistrationFile=nil then begin
RegistrationError('Unit not found: '+FRegistrationUnitName);
FRegistrationFile:=
FRegistrationPackage.FindUnit(FRegistrationUnitName,false);
if FRegistrationFile=nil then begin
RegistrationError('Unit not found: "'+FRegistrationUnitName+'"');
end else begin
RegistrationError(
'Unit "'+FRegistrationUnitName+'" was deleted from package');
end;
exit;
end;
// check registration procedure

View File

@ -335,8 +335,8 @@ begin
continue; // try again
end;
// check file name conflict with other packages
PkgFile:=PackageGraph.FindFileInAllPackages(NewFilename,true);
// check file name conflicts with other packages
PkgFile:=PackageGraph.FindFileInAllPackages(NewFilename,true,true);
if PkgFile<>nil then begin
Result:=MessageDlg('Filename is used by other package',
'The file name "'+NewFilename+'" is used by'#13

View File

@ -16,7 +16,7 @@ Month=`date +%m`
Day=`date +%d`
Date=20$Year$Month$Day
LazVersion=0.8.5.2
LazVersion=0.8.5.3
LazRelease=`dpkg -s fp-compiler | grep '^Version' | sed -e 's/Version: //'`
LazRelease=`echo $LazRelease | sed -e 's/-/_/g'`
SrcTGZ=lazarus-$Date.tgz

View File

@ -16,7 +16,7 @@ if [ "x$FPCRPM" = "x" ]; then
fi
Date=20$Year$Month$Day
LazVersion=0.8.5.2
LazVersion=0.8.5.3
LazRelease=`echo $FPCRPM | sed -e 's/-/_/g'`
SrcTGZ=lazarus-$Date.tgz
TmpDir=/tmp/lazarus$LazVersion