mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-01 05:17:24 +01:00
Create pascal program to convert svn info output
git-svn-id: trunk@23960 -
This commit is contained in:
parent
ab54fee4d8
commit
dd7d1e2cfe
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -14162,6 +14162,7 @@ utils/fpcm/fpcmpkg.pp svneol=native#text/plain
|
|||||||
utils/fpcm/fpcmwr.pp svneol=native#text/plain
|
utils/fpcm/fpcmwr.pp svneol=native#text/plain
|
||||||
utils/fpcm/fpmake.pp svneol=native#text/plain
|
utils/fpcm/fpmake.pp svneol=native#text/plain
|
||||||
utils/fpcm/get_revision.sh svneol=native#text/plain
|
utils/fpcm/get_revision.sh svneol=native#text/plain
|
||||||
|
utils/fpcm/getrev.pp svneol=native#text/pascal
|
||||||
utils/fpcm/makefile.exm -text
|
utils/fpcm/makefile.exm -text
|
||||||
utils/fpcm/printmakefilefpcrequirements.sh svneol=native#text/plain
|
utils/fpcm/printmakefilefpcrequirements.sh svneol=native#text/plain
|
||||||
utils/fpcm/readme.txt svneol=native#text/plain
|
utils/fpcm/readme.txt svneol=native#text/plain
|
||||||
|
|||||||
@ -1574,7 +1574,11 @@ AS=$(ASPROG)
|
|||||||
LD=$(LDPROG)
|
LD=$(LDPROG)
|
||||||
RC=$(RCPROG)
|
RC=$(RCPROG)
|
||||||
AR=$(ARPROG)
|
AR=$(ARPROG)
|
||||||
|
ifdef inUnix
|
||||||
|
PPAS=./ppas$(SRCBATCHEXT)
|
||||||
|
else
|
||||||
PPAS=ppas$(SRCBATCHEXT)
|
PPAS=ppas$(SRCBATCHEXT)
|
||||||
|
endif
|
||||||
ifdef inUnix
|
ifdef inUnix
|
||||||
LDCONFIG=ldconfig
|
LDCONFIG=ldconfig
|
||||||
else
|
else
|
||||||
@ -3063,12 +3067,10 @@ endif
|
|||||||
revision :
|
revision :
|
||||||
$(DEL) revision.inc
|
$(DEL) revision.inc
|
||||||
$(MAKE) revision.inc
|
$(MAKE) revision.inc
|
||||||
|
fpcmwr$(PPUEXT): fpcmake.inc
|
||||||
|
fpcmmain$(PPUEXT): $(REVINC)
|
||||||
fpcmake$(EXEEXT): $(wildcard fpcm*.pp) fpcmake.inc $(REVINC)
|
fpcmake$(EXEEXT): $(wildcard fpcm*.pp) fpcmake.inc $(REVINC)
|
||||||
ifneq (,$(REVINC))
|
fpcmake$(EXEEXT): fpcmwr$(PPUEXT) fpcmmain$(PPUEXT)
|
||||||
$(MAKE) fpcmmain$(PPUEXT)
|
|
||||||
$(COMPILER) fpcmake.pp
|
|
||||||
$(EXECPPAS)
|
|
||||||
endif
|
|
||||||
ifndef inCygWin
|
ifndef inCygWin
|
||||||
$(BS_UNITDIR):
|
$(BS_UNITDIR):
|
||||||
$(MKDIRTREE) $(BS_UNITDIR)
|
$(MKDIRTREE) $(BS_UNITDIR)
|
||||||
|
|||||||
@ -67,12 +67,13 @@ revision :
|
|||||||
$(MAKE) revision.inc
|
$(MAKE) revision.inc
|
||||||
|
|
||||||
|
|
||||||
|
fpcmwr$(PPUEXT): fpcmake.inc
|
||||||
|
|
||||||
|
fpcmmain$(PPUEXT): $(REVINC)
|
||||||
|
|
||||||
fpcmake$(EXEEXT): $(wildcard fpcm*.pp) fpcmake.inc $(REVINC)
|
fpcmake$(EXEEXT): $(wildcard fpcm*.pp) fpcmake.inc $(REVINC)
|
||||||
ifneq (,$(REVINC))
|
|
||||||
$(MAKE) fpcmmain$(PPUEXT)
|
fpcmake$(EXEEXT): fpcmwr$(PPUEXT) fpcmmain$(PPUEXT)
|
||||||
$(COMPILER) fpcmake.pp
|
|
||||||
$(EXECPPAS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Cygwin doesn't like c:/path/
|
# Cygwin doesn't like c:/path/
|
||||||
ifndef inCygWin
|
ifndef inCygWin
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
76
utils/fpcm/getrev.pp
Normal file
76
utils/fpcm/getrev.pp
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
|
||||||
|
program getrev;
|
||||||
|
|
||||||
|
{ The purpose of this program is to
|
||||||
|
parse the output of svn info several files
|
||||||
|
and to extract the lastest date and revision
|
||||||
|
|
||||||
|
The program expects a single parameter,
|
||||||
|
being the name of the text file }
|
||||||
|
|
||||||
|
procedure Usage;
|
||||||
|
begin
|
||||||
|
Writeln(paramstr(0),' requires exactly one parameter');
|
||||||
|
Writeln('This paramaeter must be the name of the file');
|
||||||
|
Writeln('Generated by svn info files > filename');
|
||||||
|
halt(1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
filename, line, date, lastdate, revision : string;
|
||||||
|
f : text;
|
||||||
|
p : longint;
|
||||||
|
rev,lastrev : longint;
|
||||||
|
|
||||||
|
begin
|
||||||
|
if paramcount<>1 then
|
||||||
|
Usage;
|
||||||
|
filename:=paramstr(1);
|
||||||
|
{$i-}
|
||||||
|
assign(f,filename);
|
||||||
|
reset(f);
|
||||||
|
if ioresult<>0 then
|
||||||
|
begin
|
||||||
|
Writeln('Unable to open ',filename,' for reading');
|
||||||
|
halt(2);
|
||||||
|
end;
|
||||||
|
lastrev:=0;
|
||||||
|
lastdate:='0';
|
||||||
|
while not eof(f) do
|
||||||
|
begin
|
||||||
|
readln(f,line);
|
||||||
|
p:=pos('Last Changed Date: ',line);
|
||||||
|
if p>0 then
|
||||||
|
begin
|
||||||
|
date:=copy(line,p+length('Last Changed Date: '),length(line));
|
||||||
|
p:=pos(' ',date);
|
||||||
|
if p>0 then
|
||||||
|
date:=copy(date,1,p-1);
|
||||||
|
writeln('date=',date);
|
||||||
|
if date>lastdate then
|
||||||
|
lastdate:=date;
|
||||||
|
end;
|
||||||
|
p:=pos('Last Changed Rev: ',line);
|
||||||
|
if p>0 then
|
||||||
|
begin
|
||||||
|
revision:=copy(line,p+length('Last Changed Rev: '),length(line));
|
||||||
|
writeln('rev=',revision);
|
||||||
|
val(revision,rev);
|
||||||
|
if rev>lastrev then
|
||||||
|
lastrev:=rev;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
close(f);
|
||||||
|
assign(f,'revision.inc');
|
||||||
|
rewrite(f);
|
||||||
|
Writeln('revision.inc set to ''',lastdate,' rev ',lastrev,'''');
|
||||||
|
if ioresult <> 0 then
|
||||||
|
begin
|
||||||
|
Writeln('Error opening revision.inc for writing');
|
||||||
|
halt(3);
|
||||||
|
end;
|
||||||
|
Writeln(f,'''',lastdate,' rev ',lastrev,'''');
|
||||||
|
close(f);
|
||||||
|
end.
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user