[patch] Packager: re-generating packages change case of registration unit
Original Reporter info from Mantis: etrusco
-
Reporter name: Flávio Etrusco
Original Reporter info from Mantis: etrusco
- Reporter name: Flávio Etrusco
Description:
Current code uses lowercase unit names (because they're borrowed from the file names). This patch adds a work-around to keep the capitalization in the common case. It will avoid spurious changes against the svn versions when re-generating packages (with Build Lazarus).
=== (+6,-3) packager/packagesystem.pas === @@ -3383,6 +3383,7 @@ function TLazPackageGraph.SavePackageMainSource(APackage: TLazPackage; Flags: TPkgCompileFlags; ShowAbort: boolean): TModalResult; var + PkgUnitName: String; SrcFilename: String; UsedUnits: String; Src: String; @@ -3492,13 +3493,15 @@ // create source BeautifyCodeOptions:=CodeToolBoss.SourceChangeCache.BeautifyCodeOptions; - HeaderSrc:=lisPkgMangThisSourceIsOnlyUsedToCompileAndInstallThePackage; HeaderSrc:= '{ ' +lisPkgMangThisFileWasAutomaticallyCreatedByLazarusDoNotEdit+e +' '+lisPkgMangThisSourceIsOnlyUsedToCompileAndInstallThePackage+e +' }'+e+e; + PkgUnitName := ExtractFileNameOnly(SrcFilename); + if AnsiSameText(APackage.Name, PkgUnitName) then + PkgUnitName := APackage.Name; Src:=HeaderSrc - +'unit '+ExtractFileNameOnly(SrcFilename)+';'+e + +'unit '+PkgUnitName+';'+e +e +'interface'+e +e;
Mantis conversion info:
- Mantis ID: 16211
- Version: 0.9.29 (SVN)
- Fixed in version: 0.9.30
- Fixed in revision: 26611 (#d1c36edf)
- Target version: 0.9.30