blob: abbfb582beb979b12797d32823036ffd3c42f550 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
This patch adds an utility for computing relative path according to a given
base directory. This is useful for libraries that are to install .lpk in
order to be used with lazarus. As these libraries may be compiled without
need to build depend on Lazarus, we add it in fp-utils package which is likely
to be used by any big project which build depends on fp-compiler.
--- /dev/null 2013-04-25 22:57:42.765358414 +0200
+++ fpc-2.6.2/fpcsrc/utils/relpath.pas 2013-05-07 16:21:46.000000000 +0200
@@ -0,0 +1,16 @@
+program relpath;
+uses
+ SysUtils;
+
+var
+ BaseDir: string;
+ TargetDir: string;
+begin
+ TargetDir := ParamStr(1);
+ BaseDir := ParamStr(2);
+ if BaseDir = ''
+ then begin
+ BaseDir := GetCurrentDir;
+ end;
+ WriteLn(ExtractRelativePath(IncludeTrailingPathDelimiter(BaseDir), TargetDir));
+end.
--- /dev/null 2013-04-25 22:57:42.765358414 +0200
+++ fpc-2.6.2/install/man/man1/relpath.1 2013-05-07 16:21:46.000000000 +0200
@@ -0,0 +1,32 @@
+.TH relpath 1 "7 May 2013" "Free Pascal" "Relative path computing tool"
+.SH NAME
+relpath \- The Free Pascal file deletion tool.
+
+.SH SYNOPSIS
+
+.B relpath
+[\fIfile or directory\fR] [\fIbase directory\fR]
+
+.SH DESCRIPTION
+
+.B relpath
+This is an utility for computing relative path according to a given base
+directory. This is useful for libraries that are to install .lpk in order to be
+used with lazarus. As these libraries may be compiled without need to build
+depend on Lazarus, we add it in fp-utils package which is likely to be used by
+any big project which build depends on fp-compiler.
+
+.SH USAGE
+
+.B relpath
+takes the following arguments:
+.TP
+.B file or directory
+The target file or directory for which relative path should be computed.
+.TP
+.B base directory
+The base directory according to which the relative patch should be computed.
+
+.SH SEE ALSO
+.IP
+.BR readlink (1)
--- fpc-2.6.2/fpcsrc/utils/Makefile.fpc 2013-01-29 11:19:19.000000000 +0100
+++ fpc-2.6.2/fpcsrc/utils/Makefile.fpc 2013-05-08 12:15:40.000000000 +0200
@@ -8,7 +8,7 @@
[target]
dirs=fppkg fpcm tply h2pas fprcp dxegen fpdoc fpcmkcfg pas2ut pas2fpm
-programs=ppdep ptop rstconv data2inc delp bin2obj postw32 rmcvsdir
+programs=ppdep ptop rstconv data2inc delp bin2obj postw32 rmcvsdir relpath
programs_linux=grab_vcsa
dirs_win32=fpmc fpcres rmwait instantfpc importtl
dirs_win64=fpmc fpcres rmwait instantfpc importtl
|