Create pascal program to convert svn info output

git-svn-id: trunk@23960 -
This commit is contained in:
pierre 2013-03-22 22:19:26 +00:00
parent ab54fee4d8
commit dd7d1e2cfe
5 changed files with 2364 additions and 2210 deletions

1
.gitattributes vendored
View File

@ -14162,6 +14162,7 @@ utils/fpcm/fpcmpkg.pp svneol=native#text/plain
utils/fpcm/fpcmwr.pp svneol=native#text/plain
utils/fpcm/fpmake.pp 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/printmakefilefpcrequirements.sh svneol=native#text/plain
utils/fpcm/readme.txt svneol=native#text/plain

View File

@ -4,7 +4,7 @@
default: all
MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim i386-android m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux jvm-java jvm-android
BSDs = freebsd netbsd openbsd darwin
UNIXs = linux $(BSDs) solaris qnx haiku aix
UNIXs = linux $(BSDs) solaris qnx haiku aix
LIMIT83fs = go32v2 os2 emx watcom
OSNeedsComspecToRunBatch = go32v2 watcom
FORCE:
@ -1574,7 +1574,11 @@ AS=$(ASPROG)
LD=$(LDPROG)
RC=$(RCPROG)
AR=$(ARPROG)
ifdef inUnix
PPAS=./ppas$(SRCBATCHEXT)
else
PPAS=ppas$(SRCBATCHEXT)
endif
ifdef inUnix
LDCONFIG=ldconfig
else
@ -3063,12 +3067,10 @@ endif
revision :
$(DEL) revision.inc
$(MAKE) revision.inc
fpcmwr$(PPUEXT): fpcmake.inc
fpcmmain$(PPUEXT): $(REVINC)
fpcmake$(EXEEXT): $(wildcard fpcm*.pp) fpcmake.inc $(REVINC)
ifneq (,$(REVINC))
$(MAKE) fpcmmain$(PPUEXT)
$(COMPILER) fpcmake.pp
$(EXECPPAS)
endif
fpcmake$(EXEEXT): fpcmwr$(PPUEXT) fpcmmain$(PPUEXT)
ifndef inCygWin
$(BS_UNITDIR):
$(MKDIRTREE) $(BS_UNITDIR)

View File

@ -67,14 +67,15 @@ revision :
$(MAKE) revision.inc
fpcmake$(EXEEXT): $(wildcard fpcm*.pp) fpcmake.inc $(REVINC)
ifneq (,$(REVINC))
$(MAKE) fpcmmain$(PPUEXT)
$(COMPILER) fpcmake.pp
$(EXECPPAS)
endif
fpcmwr$(PPUEXT): fpcmake.inc
# Cygwin doesn't like c:/path/
fpcmmain$(PPUEXT): $(REVINC)
fpcmake$(EXEEXT): $(wildcard fpcm*.pp) fpcmake.inc $(REVINC)
fpcmake$(EXEEXT): fpcmwr$(PPUEXT) fpcmmain$(PPUEXT)
# Cygwin doesn't like c:/path/
ifndef inCygWin
$(BS_UNITDIR):
$(MKDIRTREE) $(BS_UNITDIR)

File diff suppressed because it is too large Load Diff

76
utils/fpcm/getrev.pp Normal file
View 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.