summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2015-07-22 10:23:37 +0200
committerErich Eckner <git@eckner.net>2015-07-22 10:23:37 +0200
commit45f858310064390226db71676706b0004667bee9 (patch)
treed91667d138a625718371dffdbf0e994fa6e7bdb3
parent27e82200895cdfd716f6a6e692af3209b22cceec (diff)
downloadMake-45f858310064390226db71676706b0004667bee9.tar.xz
Bug aus Lokalitaetspruefung entfernt
-rwxr-xr-xMakebin1548952 -> 1549552 bytes
-rw-r--r--Make.lpr76
-rw-r--r--Make.lps115
-rw-r--r--tools.pas2
4 files changed, 109 insertions, 84 deletions
diff --git a/Make b/Make
index 4c8db89..d186f18 100755
--- a/Make
+++ b/Make
Binary files differ
diff --git a/Make.lpr b/Make.lpr
index 7e7f042..c69a64a 100644
--- a/Make.lpr
+++ b/Make.lpr
@@ -108,24 +108,31 @@ begin
until s<>'';
end;
-procedure sammleDateien(wo: string; rekursiv: boolean; var dats: TDateienMitDaten);
-var sr: TSearchRec;
- err: integer;
+procedure sammleDateien(wo: string; rekursiv: boolean; ignoriere: array of tRegExpr; var dats: TDateienMitDaten);
+var
+ sr: TSearchRec;
+ err,i: integer;
+ weglassen: boolean;
begin
err:=FindFirst(wo,faReadOnly or faHidden or faSysFile or (byte(rekursiv)*faDirectory),sr);
while err=0 do begin
- if sr.Attr and faDirectory <> 0 then begin
- if rekursiv and
- (sr.Name<>'.') and
- (sr.Name<>'..') then
- sammleDateien(extractfilepath(wo)+sr.Name+'/'+extractfilename(wo),rekursiv,dats);
- end
- else begin
- setlength(dats,length(dats)+1);
- getmem(dats[length(dats)-1],sizeof(TDateiMitDatum));
- fillchar(dats[length(dats)-1]^,sizeof(TDateiMitDatum),0);
- dats[length(dats)-1]^.Name:=extractfilepath(wo)+sr.name;
- dats[length(dats)-1]^.Datum:=FileDateTodateTime(FileAge(dats[length(dats)-1]^.Name));
+ weglassen:=false;
+ for i:=0 to length(ignoriere)-1 do
+ weglassen:=weglassen or ignoriere[i].Exec(extractfilepath(wo)+sr.name);
+ if not weglassen then begin
+ if sr.Attr and faDirectory <> 0 then begin
+ if rekursiv and
+ (sr.Name<>'.') and
+ (sr.Name<>'..') then
+ sammleDateien(extractfilepath(wo)+sr.Name+'/'+extractfilename(wo),rekursiv,ignoriere,dats);
+ end
+ else begin
+ setlength(dats,length(dats)+1);
+ getmem(dats[length(dats)-1],sizeof(TDateiMitDatum));
+ fillchar(dats[length(dats)-1]^,sizeof(TDateiMitDatum),0);
+ dats[length(dats)-1]^.Name:=extractfilepath(wo)+sr.name;
+ dats[length(dats)-1]^.Datum:=FileDateTodateTime(FileAge(dats[length(dats)-1]^.Name));
+ end;
end;
err:=FindNext(sr);
end;
@@ -136,14 +143,16 @@ function liesMakeFile(datNam: string; out Abh: TAbhaengigkeiten; out dats: TDate
var f: textfile;
s,t: string;
NA: TAbhaengigkeit;
+ ignoriere: array of tRegExpr;
beg,fin,rek: boolean;
- wo,num: integer;
+ wo,num,i: integer;
begin
result:=false;
NA:=TAbhaengigkeit.create;
setlength(dats,0);
setlength(Abh,0);
+ setlength(ignoriere,0);
wo:=0;
num:=0;
assignfile(f,datNam);
@@ -151,17 +160,31 @@ begin
while liesZeile(f,s) do begin
if wo=0 then begin
if notQuotedPos(':',s)=0 then begin
- while (length(s)>0) and (s[1] in [' ',#9]) do delete(s,1,1);
+ s:=trim(s);
if length(s)=0 then continue;
- s:=s+' ';
- rek:=pos('-r',s)=1;
- if rek then delete(s,1,pos(' ',s));
- while pos(' ',s)>0 do begin
- sammleDateien(copy(s,1,pos(' ',s)-1),rek,dats);
- delete(s,1,pos(' ',s));
+ if pos('!',s)=1 then begin
+ delete(s,1,1);
+ s:=trim(s);
+ setlength(ignoriere,length(ignoriere)+1);
+ ignoriere[length(ignoriere)-1]:=tRegExpr.create;
+ ignoriere[length(ignoriere)-1].Expression:=s;
+ end
+ else begin
+ s:=s+' ';
+ rek:=pos('-r',s)=1;
+ if rek then delete(s,1,pos(' ',s));
+ while pos(' ',s)>0 do begin
+ sammleDateien(copy(s,1,pos(' ',s)-1),rek,ignoriere,dats);
+ delete(s,1,pos(' ',s));
+ end;
end;
end
- else wo:=1;
+ else begin
+ for i:=0 to length(ignoriere)-1 do
+ ignoriere[i].free;
+ setlength(ignoriere,0);
+ wo:=1;
+ end;
end;
if wo=1 then begin
fin:=s[length(s)]=';';
@@ -219,6 +242,9 @@ begin
end;
closefile(f);
NA.free;
+ for i:=0 to length(ignoriere)-1 do
+ ignoriere[i].free;
+ setlength(ignoriere,0);
result:=true;
end;
@@ -662,7 +688,7 @@ begin
if geaenderteDateien.count>0 then
Befehle.Add('echo -ne "Sha512summen erneuern ..."');
for i:=0 to geaenderteDateien.count-1 do
- Befehle.Add('/usr/bin/sha512sum '+geaenderteDateien[i]+' >> '+Summendatei);
+ Befehle.Add('/usr/bin/sha512sum "'+geaenderteDateien[i]+'" >> '+Summendatei);
if geaenderteDateien.count>0 then
Befehle.Add('echo " fertig"');
if not nurAnzeigen then begin
diff --git a/Make.lps b/Make.lps
index ece4c64..ea7ea27 100644
--- a/Make.lps
+++ b/Make.lps
@@ -7,36 +7,35 @@
<Unit0>
<Filename Value="Make.lpr"/>
<IsPartOfProject Value="True"/>
- <TopLine Value="617"/>
- <CursorPos X="29" Y="643"/>
- <UsageCount Value="46"/>
+ <IsVisibleTab Value="True"/>
+ <TopLine Value="663"/>
+ <CursorPos X="65" Y="691"/>
+ <FoldState Value=" T3i70C5 pl5lT0p3 pjLkb0B4132"/>
+ <UsageCount Value="47"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
<Filename Value="Machdatei.txt"/>
<IsPartOfProject Value="True"/>
- <UsageCount Value="46"/>
+ <UsageCount Value="47"/>
<DefaultSyntaxHighlighter Value="None"/>
</Unit1>
<Unit2>
<Filename Value="tools.pas"/>
<IsPartOfProject Value="True"/>
- <UnitName Value="tools"/>
<EditorIndex Value="1"/>
- <CursorPos X="47" Y="8"/>
+ <TopLine Value="24"/>
+ <CursorPos Y="74"/>
<FoldState Value=" T3T073 pjbk90D2x"/>
- <UsageCount Value="25"/>
+ <UsageCount Value="26"/>
<Loaded Value="True"/>
</Unit2>
<Unit3>
<Filename Value="../units/mystringlistunit.pas"/>
<IsPartOfProject Value="True"/>
- <UnitName Value="mystringlistunit"/>
- <IsVisibleTab Value="True"/>
- <EditorIndex Value="2"/>
+ <EditorIndex Value="-1"/>
<CursorPos X="44" Y="8"/>
- <UsageCount Value="22"/>
- <Loaded Value="True"/>
+ <UsageCount Value="23"/>
</Unit3>
<Unit4>
<Filename Value="Machdatei"/>
@@ -60,123 +59,123 @@
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="tools.pas"/>
- <Caret Line="73" Column="41" TopLine="14"/>
+ <Caret Line="8" Column="35"/>
</Position1>
<Position2>
- <Filename Value="tools.pas"/>
- <Caret Line="78" Column="72" TopLine="52"/>
+ <Filename Value="Make.lpr"/>
+ <Caret Line="641" Column="64" TopLine="606"/>
</Position2>
<Position3>
<Filename Value="tools.pas"/>
- <Caret Line="86" Column="18" TopLine="52"/>
+ <Caret Line="134" Column="14" TopLine="100"/>
</Position3>
<Position4>
<Filename Value="tools.pas"/>
- <Caret Line="89" Column="41" TopLine="52"/>
+ <Caret Line="125" Column="3" TopLine="105"/>
</Position4>
<Position5>
<Filename Value="tools.pas"/>
- <Caret Line="106" Column="14" TopLine="76"/>
+ <Caret Line="126" Column="33" TopLine="102"/>
</Position5>
<Position6>
<Filename Value="tools.pas"/>
- <Caret Line="95" Column="12" TopLine="75"/>
+ <Caret Line="153" Column="21" TopLine="19"/>
</Position6>
<Position7>
- <Filename Value="Make.lpr"/>
- <Caret Line="135" TopLine="48"/>
+ <Filename Value="tools.pas"/>
+ <Caret Line="79" Column="24" TopLine="53"/>
</Position7>
<Position8>
<Filename Value="tools.pas"/>
- <Caret Line="8" Column="43"/>
+ <Caret Line="8" Column="52"/>
</Position8>
<Position9>
<Filename Value="tools.pas"/>
- <Caret Line="8" Column="35"/>
+ <Caret Line="163" Column="21" TopLine="136"/>
</Position9>
<Position10>
- <Filename Value="Make.lpr"/>
- <Caret Line="641" Column="64" TopLine="606"/>
+ <Filename Value="tools.pas"/>
+ <Caret Line="79" Column="26" TopLine="20"/>
</Position10>
<Position11>
<Filename Value="tools.pas"/>
- <Caret Line="134" Column="14" TopLine="100"/>
+ <Caret Line="20" Column="51"/>
</Position11>
<Position12>
- <Filename Value="tools.pas"/>
- <Caret Line="125" Column="3" TopLine="105"/>
+ <Filename Value="Make.lpr"/>
+ <Caret Line="11" Column="23"/>
</Position12>
<Position13>
- <Filename Value="tools.pas"/>
- <Caret Line="126" Column="33" TopLine="102"/>
+ <Filename Value="Make.lpr"/>
+ <Caret Line="641" Column="73" TopLine="621"/>
</Position13>
<Position14>
- <Filename Value="tools.pas"/>
- <Caret Line="153" Column="21" TopLine="19"/>
+ <Filename Value="Make.lpr"/>
+ <Caret Line="111" Column="21" TopLine="65"/>
</Position14>
<Position15>
- <Filename Value="tools.pas"/>
- <Caret Line="79" Column="24" TopLine="53"/>
+ <Filename Value="Make.lpr"/>
+ <Caret Line="590" Column="16" TopLine="51"/>
</Position15>
<Position16>
- <Filename Value="tools.pas"/>
- <Caret Line="8" Column="52"/>
+ <Filename Value="Make.lpr"/>
+ <Caret Line="111" Column="24" TopLine="51"/>
</Position16>
<Position17>
- <Filename Value="tools.pas"/>
- <Caret Line="163" Column="21" TopLine="136"/>
+ <Filename Value="Make.lpr"/>
+ <Caret Line="134" Column="6" TopLine="51"/>
</Position17>
<Position18>
- <Filename Value="tools.pas"/>
- <Caret Line="79" Column="26" TopLine="20"/>
+ <Filename Value="Make.lpr"/>
+ <Caret Line="642" Column="91" TopLine="615"/>
</Position18>
<Position19>
<Filename Value="tools.pas"/>
- <Caret Line="20" Column="51"/>
+ <Caret Line="83" Column="44" TopLine="52"/>
</Position19>
<Position20>
- <Filename Value="Make.lpr"/>
- <Caret Line="11" Column="23"/>
+ <Filename Value="tools.pas"/>
+ <Caret Line="8" Column="36"/>
</Position20>
<Position21>
- <Filename Value="Make.lpr"/>
- <Caret Line="641" Column="73" TopLine="621"/>
+ <Filename Value="tools.pas"/>
+ <Caret Line="13" Column="66"/>
</Position21>
<Position22>
<Filename Value="Make.lpr"/>
- <Caret Line="111" Column="21" TopLine="65"/>
+ <Caret Line="643" Column="29" TopLine="593"/>
</Position22>
<Position23>
<Filename Value="Make.lpr"/>
- <Caret Line="590" Column="16" TopLine="51"/>
+ <Caret Line="763" Column="4" TopLine="730"/>
</Position23>
<Position24>
<Filename Value="Make.lpr"/>
- <Caret Line="111" Column="24" TopLine="51"/>
+ <Caret Line="111" Column="17" TopLine="43"/>
</Position24>
<Position25>
<Filename Value="Make.lpr"/>
- <Caret Line="134" Column="6" TopLine="51"/>
+ <Caret Line="135" Column="24" TopLine="43"/>
</Position25>
<Position26>
<Filename Value="Make.lpr"/>
- <Caret Line="642" Column="91" TopLine="615"/>
+ <Caret Line="179" TopLine="143"/>
</Position26>
<Position27>
- <Filename Value="tools.pas"/>
- <Caret Line="83" Column="44" TopLine="52"/>
+ <Filename Value="Make.lpr"/>
+ <Caret Line="141" Column="14" TopLine="87"/>
</Position27>
<Position28>
- <Filename Value="tools.pas"/>
- <Caret Line="8" Column="36"/>
+ <Filename Value="Make.lpr"/>
+ <Caret Line="170" Column="13" TopLine="151"/>
</Position28>
<Position29>
- <Filename Value="tools.pas"/>
- <Caret Line="13" Column="66"/>
+ <Filename Value="Make.lpr"/>
+ <Caret TopLine="19"/>
</Position29>
<Position30>
- <Filename Value="../units/mystringlistunit.pas"/>
- <Caret Line="11" Column="10"/>
+ <Filename Value="Make.lpr"/>
+ <Caret Line="111" Column="85" TopLine="88"/>
</Position30>
</JumpHistory>
</ProjectSession>
diff --git a/tools.pas b/tools.pas
index 0d23ff1..49a9251 100644
--- a/tools.pas
+++ b/tools.pas
@@ -81,7 +81,7 @@ begin
oBef:=bef;
while notQuotedPos(';',bef)>0 do begin
- testeObBefehlLokal(trim(leftStr(bef,notQuotedPos(';',bef))),ordner,lokTest);
+ testeObBefehlLokal(trim(leftStr(bef,notQuotedPos(';',bef)-1)),ordner,lokTest);
delete(bef,1,notQuotedPos(';',bef));
bef:=trim(bef);
end;