View Issue Details

IDProjectCategoryView StatusLast Update
0016211LazarusIDEpublic2011-04-09 07:52
ReporterFlávio Etrusco (notifications not working)Assigned ToMattias Gaertner 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.29 (SVN)Product Build 
Target VersionFixed in Version0.9.30 
Summary0016211: [patch] Packager: re-generating packages change case of registration unit
DescriptionCurrent 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;
TagsNo tags attached.
Fixed in Revision26611
LazTarget0.9.30
WidgetsetGTK, GTK 2, Win32/Win64, WinCE, Carbon, QT, fpGUI
Attached Files

Relationships

related to 0016209 closedMattias Gaertner [patch] CodeTools/SourceChanger: avoid change of text/identifiers/kewords in comments 

Activities

Mattias Gaertner

2010-04-18 20:38

manager   ~0036796

Can you give an example?
> Can you give an example?
The chmhelp package (install it and rebuild).
What's the desired behavior? Maxim recently commited a some updated/regenerated files to avoid the dummy diffs, but there are still some others - besides chmhelp - missing.
BTW the first assignment to HeaderSrc (removed in the patch) has no use.

Paul Ishenin

2010-07-13 05:31

manager   ~0039294

Thanks for the patch. Package units looks prettier after the IDE rebuild.

Issue History

Date Modified Username Field Change
2010-04-06 10:12 Flávio Etrusco (notifications not working) New Issue
2010-04-06 10:12 Flávio Etrusco (notifications not working) LazTarget => -
2010-04-06 10:12 Flávio Etrusco (notifications not working) Widgetset => GTK, GTK 2, Win32/Win64, WinCE, Carbon, QT, fpGUI
2010-04-06 10:13 Flávio Etrusco (notifications not working) LazTarget - => 0.9.30
2010-04-06 10:13 Flávio Etrusco (notifications not working) Status new => acknowledged
2010-04-06 10:13 Flávio Etrusco (notifications not working) Relationship added related to 0016209
2010-04-18 20:38 Mattias Gaertner Note Added: 0036796
2010-04-18 20:38 Mattias Gaertner Assigned To => Mattias Gaertner
2010-04-18 20:38 Mattias Gaertner Status acknowledged => feedback
2010-04-19 07:05 Flávio Etrusco (notifications not working) Note Added: 0036803
2010-04-19 07:06 Flávio Etrusco (notifications not working) Description Updated
2010-04-19 07:07 Flávio Etrusco (notifications not working) Note Added: 0036804
2010-04-28 23:13 Flávio Etrusco (notifications not working) Status feedback => assigned
2010-07-13 05:31 Paul Ishenin Fixed in Revision => 26611
2010-07-13 05:31 Paul Ishenin Status assigned => resolved
2010-07-13 05:31 Paul Ishenin Fixed in Version => 0.9.29 (SVN)
2010-07-13 05:31 Paul Ishenin Resolution open => fixed
2010-07-13 05:31 Paul Ishenin Note Added: 0039294
2011-04-09 07:52 Flávio Etrusco (notifications not working) Status resolved => closed
2011-04-09 07:52 Flávio Etrusco (notifications not working) Fixed in Version 0.9.29 (SVN) => 0.9.30