Mon, 28 Jan 2013 17:37:18 +0100
Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.
1 ##
2 ## lsync.pod -- Access Layer Synchronization Tool (Manual Page)
3 ## Copyright (c) 2000-2012 OpenPKG GmbH <http://openpkg.com/>
4 ##
5 ## This software is property of the OpenPKG GmbH, DE MUC HRB 160208.
6 ## All rights reserved. Licenses which grant limited permission to use,
7 ## copy, modify and distribute this software are available from the
8 ## OpenPKG GmbH.
9 ##
10 ## THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21 ## SUCH DAMAGE.
22 ##
24 =pod
26 =head1 NAME
28 B<openpkg lsync> - Access Layer Synchronization Tool
30 =head1 SYNOPSIS
32 B<openpkg lsync>
33 [B<--version>|B<-v>]
34 [B<--help>|B<-h>]
35 [B<--init>|B<-i>]
36 [B<--nop>|B<-n>]
37 [B<--quiet>|B<-q>]
38 [B<--trace>|B<-t>]
39 [B<--local>|B<-l>]
40 [B<--uninstall>|B<-u>]
41 [B<--root=>I<root>]
42 [B<--pkgdir=>I<pkgdir>]
43 [B<--subdirs=>I<subdir>[,I<subdir>,...]]
45 =head1 DESCRIPTION
47 This program activates software packages which were locally
48 installed in a sub-directory of a package hierarchy (located under
49 I<root>/I<pkgdir>/) by managing symbolic links in an access layer
50 (located under I<root>/) corresponding to package installation
51 files (found in I<root>/I<pkgdir>/pkgname/subdir/) which need to be
52 collected in global directories (located under I<root>/subdir/).
54 The purpose of this is that individual packages can be installed and
55 deinstalled seperately without interfering with other packages while
56 all packages as a whole still can be treated like a single package
57 (installed into the access layer).
59 The
60 actual creation of symbolic links is as following ("foo" indicating an
61 arbitrary file; "bar" indicating an arbitrary package name):
63 =over 4
65 =item I<root>B</bin/>foo -> B<../>I<pkgdir>B</>barB</bin/>foo
67 This activates the user executeable
68 I<root>B</>I<pkgdir>B</>barB</bin>/foo as I<root>B</bin/>foo. It can
69 be found by the shell by placing I<root>B</bin> into the environment
70 variable C<PATH> (B<PATH="..:>I<root>B</bin:..">).
72 =item I<root>B</sbin/>foo -> B<../>I<pkgdir>B</>barB</sbin/>foo
74 This activates the system executeable
75 I<root>B</>I<pkgdir>B</>barB</sbin>/foo as I<root>B</sbin/>foo. It can
76 be found by the shell by placing I<root>B</sbin> into the environment
77 variable C<PATH> (B<PATH="..:>I<root>B</sbin:..">).
79 =item I<root>B</man/man>I<N>B</>foo -> B<../>I<pkgdir>B</>barB</man/man>I<N>B</>foo
81 This activates the Unix manual page
82 I<root>B</>I<pkgdir>B</>barB</man/man>I<N>B</>foo as
83 I<root>B</man/man>I<N>B</>foo. It can be found by the man(1) tool
84 by placing I<root>B</man> into the environment variable C<MANPATH>
85 (B<MANPATH="..:>I<root>B</man:..">). Keep in mind that B<openpkg lsync>
86 activates any files found in the B<man/manI<N>> sub-directory of the
87 package, but the man(1) tool usually requires the filename scheme
88 fooB<.>I<N> before it can find the file.
90 =item I<root>B</info/>foo -> B<../>I<pkgdir>B</>barB</info/>foo
92 This activates the GNU info page I<root>B</>I<pkgdir>B</>barB</info/>foo
93 as I<root>B</info/>foo. It can be found by the info(1) and pinfo(1)
94 tools by placing I<root>B</info> into the environment variable
95 C<INFOPATH> (B<INFOPATH="..:>I<root>B</info:..">). Keep in mind that
96 B<openpkg lsync> activates any files found in the B<info/> sub-directory of the
97 package, but the info(1) and pinfo(1) tools usually require the filename
98 scheme fooB<.info> before it can find the file.
100 =item I<root>B</include/>foo -> B<../>I<pkgdir>B</>barB</include/>foo
102 This activates the C header I<root>B</>I<pkgdir>B</>barB</include>/foo
103 as I<root>B</include/>foo. It can be found by the C/C++ compilers
104 by adding I<root>B</include> to their include search path (B<cc ..
105 -I>I<root>B</include> B<...>). Keep in mind that B<openpkg lsync> activates any
106 files found in the B<include/> sub-directory of the package, but the
107 C/C++ compiler usually by convention use the filename scheme fooB<.h>.
109 =item I<root>B</lib/>foo -> B<../>I<pkgdir>B</>barB</lib/>foo
111 This activates the C library I<root>B</>I<pkgdir>B</>barB</lib>/foo
112 as I<root>B</lib/>foo. It can be found by the C/C++ compilers (and
113 the linker they use) by adding I<root>B</lib> to their library search
114 path (B<cc .. -L>I<root>B</lib> B<...>). It can be found by the Unix
115 Dynamic Loader by adding I<root>B</lib> to the environment variable
116 C<LD_LIBRARY_PATH> (B<LD_LIBRARY_PATH="..:>I<root>B</lib:..">).
117 Keep in mind that B<openpkg lsync> activates any files found in the B<lib/>
118 sub-directory of the package, but the C/C++ compiler usually require the
119 filename scheme B<lib>fooB<.a> and the Unix Dynamic Loader the filename
120 scheme B<lib>fooB<.so> before they actually can use the file.
122 =back
124 It is obvious that more sub-directories in a package installation
125 might exist -- for instance B<share/>, B<var/>, B<libexec/>, etc. But
126 B<openpkg lsync> intentionally does not link files in those directories into
127 corresponding directories of the access layer, because those files do
128 not require that they are located in a global area in order to be used.
129 So B<openpkg lsync> only creates the access layer for files where a common area
130 is required for (easy) use.
132 =head1 SPECIAL FEATURES
134 There are two special features supported by B<openpkg lsync>:
136 =over 4
138 =item B<Run-Command Files>
140 B<openpkg lsync> on startup implicitly reads command line options from
141 C<.lsyncrc> files. They are searched in all parent directories and in
142 the callers home directory. Their contents is prepended to the list of
143 given command line options.
145 =item B<Multiple Package Versions>
147 B<openpkg lsync> skips all directories under I<root>/I<pkgdir>/ which contain
148 the pattern "-[0-9]" in their directory name. On the other hand,
149 B<openpkg lsync> follows also symbolic links under I<root>/I<pkgdir>/.
150 This can be used for installing multiple versions of a package and
151 switching between them. For instance, if version 1.0 of package
152 "foo" is installed into directory I<root>/I<pkgdir>/foo-1.0,
153 version 1.1 into I<root>/I<pkgdir>/foo-1.1 and version 1.2 into
154 I<root>/I<pkgdir>/foo-1.2, B<openpkg lsync> does skip all three. To enable
155 version 1.1 one just creates a symbolic link I<root>/I<pkgdir>/foo
156 pointing to foo-1.1. Then B<openpkg lsync> picks up the files in
157 I<root>/I<pkgdir>/foo-1.1. If you want to temporarily upgrade to
158 foo-1.2, all you have to do is to change the symlink pointing from
159 foo-1.1 to foo-1.2.
161 =item B<Temporarily Deactivated Package>
163 One can deactivate a package "foo" by going to I<root>/I<pkgdir>/foo/
164 and running "openpkg lsync --local --uninstall", of course. Alternatively
165 one can set the sticky bit on the directory I<root>/I<pkgdir>/foo.
166 Then B<openpkg lsync> also skips the package. Alternatively, assume
167 package "foo" as a whole should not be deactivated, but its
168 I<root>/I<pkgdir>/foo/lib directory (usually because this directory
169 unfortunately contains non-library files), one just sets the sticky bit
170 on I<root>/I<pkgdir>/foo/lib.
172 =back
174 =head1 OPTIONS
176 =over 4
178 =item B<--version>, B<-v>
180 Display program version information only.
182 =item B<--help>, B<-h>
184 Display program usage information only.
186 =item B<--init>, B<-i>
188 Create an initial access layer hierarchy under I<root>.
190 =item B<--nop>, B<-n>
192 No Operation -- causes B<openpkg lsync> to not perform any filesystem
193 operations. In conjunction with B<--trace> you can at least see what
194 would be executed.
196 =item B<--quiet>, B<-q>
198 Forces B<openpkg lsync> to perform the operations quietly, i.e., without any
199 verbose messages.
201 =item B<--trace>, B<-t>
203 Forces B<openpkg lsync> to show what filesystem operations are performed.
205 =item B<--local>, B<-l>
207 This restricts the operations to a local package area. This option can
208 only be used if you are physically staying below a package sub-directory
209 under I<root>/I<pkgdir>/. For instance, when you are staying in
210 I<root>/I<pkgdir>/bar or I<root>/I<pkgdir>/bar/bin and use B<--local>,
211 all operations are restricted to the package "bar".
213 =item B<--uninstall>, B<-u>
215 This performs only package uninstallation operations, i.e., only
216 symbolic links are removed. This can be used to completely empty the
217 access layer. Additionally it is very useful in combination with
218 B<--local> in order to uninstall a particular package without having to
219 remove its files.
221 =item B<--root=>I<root>
223 Sets the root directory where the access layer and package subdirectory
224 is located. The default can be determined by running C<openpkg lsync --help>
225 (see section "Current configuration").
227 =item B<--pkgdir=>I<pkgdir>
229 Sets the sub-directory under the root directory where packages are
230 located. The default can be determined by running C<openpkg lsync --help> (see
231 section "Current configuration").
233 =item B<--subdirs=>I<subdirs>[,I<subdir>,...]
235 Sets one or more sub-directories of the access layer on which B<openpkg lsync>
236 should act. The default can be determined by running C<openpkg lsync --help>
237 (see section "Current configuration").
239 =back
241 =head1 RESULTS
243 This program uses the following return codes on exit: 0 (operation
244 successful), 1 (system error), 2 (command line error) and 3 (other user
245 error).
247 =head1 HISTORY
249 The idea of filesystem access layers consisting of symbolic links
250 pointing to actual package installation areas is a rather old one. It
251 dates back to the early days of Unix and was implemented many times over
252 the last decades. One of many implementation was B<GenOPT>, written by
253 Ralf S. Engelschall for sd&m GmbH & Co KG, Munich in 1992. The name
254 indicates the programs purpose: to generate symbolic links in an access
255 layer which was located under C</opt>. B<GenOPT> was very flexible, but
256 hence also very complex. Because of lack of documentation it was never
257 released and so only used at sd&m and on all machines which were under
258 control of Ralf S. Engelschall.
260 For Cable & Wireless, Munich, the old B<GenOPT> principle was again
261 needed to manage the C</cw/local> area on their servers. For this in
262 November 2000 the functionality of B<GenOPT> was revised, heavily
263 stripped down and finally implemented from scratch. The result is the
264 current B<openpkg lsync>.
266 =head1 AUTHOR
268 Ralf S. Engelschall
269 rse@engelschall.com
270 www.engelschall.com
272 =cut