mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 22:49:31 +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
|
||||
// append extension
|
||||
NewFileName:=NewFileName+'.lpk';
|
||||
end else if ExtractFileExt(NewFilename)<>'.lpk' then begin
|
||||
end
|
||||
else if not FilenameExtIs(NewFilename,'.lpk',true) then begin
|
||||
Result:=IDEMessageDialog(lisPkgMangInvalidPackageFileExtension,
|
||||
lisPkgMangPackagesMustHaveTheExtensionLpk,
|
||||
mtInformation,[mbRetry,mbAbort]);
|
||||
@ -2268,9 +2269,9 @@ var
|
||||
continue;
|
||||
// output filename and source have same unitname
|
||||
SeparateOutDir:=CompareFilenames(ChompPathDelim(ExtractFilePath(OldFilename)),OutDir)<>0;
|
||||
Ext:=lowercase(ExtractFileExt(OutFilename));
|
||||
if (Ext='ppu') or (Ext='o') or (Ext='ppl') or (Ext='rst') or (Ext='lrt')
|
||||
or (SeparateOutDir and ((Ext='lrs') or (Ext='lfm'))) then begin
|
||||
if FilenameExtIn(OutFilename,['ppu','o','ppl','rst','lrt'])
|
||||
or (SeparateOutDir and FilenameExtIn(OutFilename,['lrs','lfm'])) then
|
||||
begin
|
||||
// automatically created file found => delete
|
||||
r:=DeleteFileInteractive(OutFilename,[mbCancel,mbIgnore]);
|
||||
if not (r in [mrOk,mrIgnore]) then exit;
|
||||
@ -3534,8 +3535,7 @@ begin
|
||||
AFilename:=GetPhysicalFilenameCached(CleanAndExpandFilename(AFilename),false);
|
||||
|
||||
// check file extension
|
||||
if (CompareFileExt(AFilename,'lpk',true)<>0)
|
||||
and (not (pofRevert in Flags)) then begin
|
||||
if not ( FilenameExtIs(AFilename,'lpk',true) or (pofRevert in Flags) ) then begin
|
||||
DoQuestionDlg(lisPkgMangInvalidFileExtension,
|
||||
Format(lisPkgMangTheFileIsNotALazarusPackage, [AFilename]));
|
||||
RemoveFromRecentList(AFilename,EnvironmentOptions.RecentPackageFiles,rltFile);
|
||||
|
Loading…
Reference in New Issue
Block a user