mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 16:59:20 +02:00
Packager: Use new FilenameExtIn(). Fix an error with extensions not having a dot.
git-svn-id: trunk@64584 -
This commit is contained in:
parent
3f78f0d62d
commit
8ddb160a15
@ -1182,7 +1182,8 @@ begin
|
|||||||
if ExtractFileExt(NewFilename)='' then begin
|
if ExtractFileExt(NewFilename)='' then begin
|
||||||
// append extension
|
// append extension
|
||||||
NewFileName:=NewFileName+'.lpk';
|
NewFileName:=NewFileName+'.lpk';
|
||||||
end else if ExtractFileExt(NewFilename)<>'.lpk' then begin
|
end
|
||||||
|
else if not FilenameExtIs(NewFilename,'.lpk',true) then begin
|
||||||
Result:=IDEMessageDialog(lisPkgMangInvalidPackageFileExtension,
|
Result:=IDEMessageDialog(lisPkgMangInvalidPackageFileExtension,
|
||||||
lisPkgMangPackagesMustHaveTheExtensionLpk,
|
lisPkgMangPackagesMustHaveTheExtensionLpk,
|
||||||
mtInformation,[mbRetry,mbAbort]);
|
mtInformation,[mbRetry,mbAbort]);
|
||||||
@ -2268,9 +2269,9 @@ var
|
|||||||
continue;
|
continue;
|
||||||
// output filename and source have same unitname
|
// output filename and source have same unitname
|
||||||
SeparateOutDir:=CompareFilenames(ChompPathDelim(ExtractFilePath(OldFilename)),OutDir)<>0;
|
SeparateOutDir:=CompareFilenames(ChompPathDelim(ExtractFilePath(OldFilename)),OutDir)<>0;
|
||||||
Ext:=lowercase(ExtractFileExt(OutFilename));
|
if FilenameExtIn(OutFilename,['ppu','o','ppl','rst','lrt'])
|
||||||
if (Ext='ppu') or (Ext='o') or (Ext='ppl') or (Ext='rst') or (Ext='lrt')
|
or (SeparateOutDir and FilenameExtIn(OutFilename,['lrs','lfm'])) then
|
||||||
or (SeparateOutDir and ((Ext='lrs') or (Ext='lfm'))) then begin
|
begin
|
||||||
// automatically created file found => delete
|
// automatically created file found => delete
|
||||||
r:=DeleteFileInteractive(OutFilename,[mbCancel,mbIgnore]);
|
r:=DeleteFileInteractive(OutFilename,[mbCancel,mbIgnore]);
|
||||||
if not (r in [mrOk,mrIgnore]) then exit;
|
if not (r in [mrOk,mrIgnore]) then exit;
|
||||||
@ -3534,8 +3535,7 @@ begin
|
|||||||
AFilename:=GetPhysicalFilenameCached(CleanAndExpandFilename(AFilename),false);
|
AFilename:=GetPhysicalFilenameCached(CleanAndExpandFilename(AFilename),false);
|
||||||
|
|
||||||
// check file extension
|
// check file extension
|
||||||
if (CompareFileExt(AFilename,'lpk',true)<>0)
|
if not ( FilenameExtIs(AFilename,'lpk',true) or (pofRevert in Flags) ) then begin
|
||||||
and (not (pofRevert in Flags)) then begin
|
|
||||||
DoQuestionDlg(lisPkgMangInvalidFileExtension,
|
DoQuestionDlg(lisPkgMangInvalidFileExtension,
|
||||||
Format(lisPkgMangTheFileIsNotALazarusPackage, [AFilename]));
|
Format(lisPkgMangTheFileIsNotALazarusPackage, [AFilename]));
|
||||||
RemoveFromRecentList(AFilename,EnvironmentOptions.RecentPackageFiles,rltFile);
|
RemoveFromRecentList(AFilename,EnvironmentOptions.RecentPackageFiles,rltFile);
|
||||||
|
Loading…
Reference in New Issue
Block a user