1IO::FILE=IO(0X81D9F0)(1U)ser Contributed Perl DocumentatiIoOn::FILE=IO(0X81D9F0)(1)
2
3
4

NAME

6       stow - software package installation manager
7

SYNOPSIS

9       stow [ options ] package ...
10

DESCRIPTION

12       This manual page describes GNU Stow 2.2.2, a program for managing the
13       installation of software packages. This is not the definitive
14       documentation for stow; for that, see the info manual.
15
16       Stow is a tool for managing the installation of multiple software
17       packages in the same run-time directory tree. One historical difficulty
18       of this task has been the need to administer, upgrade, install, and
19       remove files in independent packages without confusing them with other
20       files sharing the same filesystem space. For instance, it is common to
21       install Perl and Emacs in /usr/local.  When one does so, one winds up
22       (as of Perl 4.036 and Emacs 19.22) with the following files in
23       /usr/local/man/man1: a2p.1; ctags.1; emacs.1; etags.1; h2ph.1; perl.1;
24       and s2p.1.  Now suppose it's time to uninstall Perl. Which man pages
25       get removed?  Obviously perl.1 is one of them, but it should not be the
26       administrator's responsibility to memorize the ownership of individual
27       files by separate packages.
28
29       The approach used by Stow is to install each package into its own tree,
30       then use symbolic links to make it appear as though the files are
31       installed in the common tree. Administration can be performed in the
32       package's private tree in isolation from clutter from other packages.
33       Stow can then be used to update the symbolic links. The structure of
34       each private tree should reflect the desired structure in the common
35       tree; i.e. (in the typical case) there should be a bin directory
36       containing executables, a man/man1 directory containing section 1 man
37       pages, and so on.
38
39       Stow was inspired by Carnegie Mellon's Depot program, but is
40       substantially simpler and safer. Whereas Depot required database files
41       to keep things in sync, Stow stores no extra state between runs, so
42       there's no danger (as there was in Depot) of mangling directories when
43       file hierarchies don't match the database. Also unlike Depot, Stow will
44       never delete any files, directories, or links that appear in a Stow
45       directory (e.g., /usr/local/stow/emacs), so it's always possible to
46       rebuild the target tree (e.g., /usr/local).
47

TERMINOLOGY

49       A "package" is a related collection of files and directories that you
50       wish to administer as a unit -- e.g., Perl or Emacs -- and that needs
51       to be installed in a particular directory structure -- e.g., with bin,
52       lib, and man subdirectories.
53
54       A "target directory" is the root of a tree in which one or more
55       packages wish to appear to be installed. A common, but by no means the
56       only such location is /usr/local.  The examples in this manual page
57       will use /usr/local as the target directory.
58
59       A "stow directory" is the root of a tree containing separate packages
60       in private subtrees. When Stow runs, it uses the current directory as
61       the default stow directory. The examples in this manual page will use
62       /usr/local/stow as the stow directory, so that individual packages will
63       be, for example, /usr/local/stow/perl and /usr/local/stow/emacs.
64
65       An "installation image" is the layout of files and directories required
66       by a package, relative to the target directory. Thus, the installation
67       image for Perl includes: a bin directory containing perl and a2p (among
68       others); an info directory containing Texinfo documentation; a lib/perl
69       directory containing Perl libraries; and a man/man1 directory
70       containing man pages.
71
72       A "package directory" is the root of a tree containing the installation
73       image for a particular package. Each package directory must reside in a
74       stow directory -- e.g., the package directory /usr/local/stow/perl must
75       reside in the stow directory /usr/local/stow.  The "name" of a package
76       is the name of its directory within the stow directory -- e.g., perl.
77
78       Thus, the Perl executable might reside in
79       /usr/local/stow/perl/bin/perl, where /usr/local is the target
80       directory, /usr/local/stow is the stow directory, /usr/local/stow/perl
81       is the package directory, and bin/perl within is part of the
82       installation image.
83
84       A "symlink" is a symbolic link. A symlink can be "relative" or
85       "absolute". An absolute symlink names a full path; that is, one
86       starting from /.  A relative symlink names a relative path; that is,
87       one not starting from /.  The target of a relative symlink is computed
88       starting from the symlink's own directory.  Stow only creates relative
89       symlinks.
90

OPTIONS

92       The stow directory is assumed to be the value of the "STOW_DIR"
93       environment variable or if unset the current directory, and the target
94       directory is assumed to be the parent of the current directory (so it
95       is typical to execute stow from the directory /usr/local/stow).  Each
96       package given on the command line is the name of a package in the stow
97       directory (e.g., perl).  By default, they are installed into the target
98       directory (but they can be deleted instead using "-D").
99
100       -n
101       --no
102           Do not perform any operations that modify the filesystem; merely
103           show what would happen.
104
105       -d DIR
106       --dir=DIR
107           Set the stow directory to "DIR" instead of the current directory.
108           This also has the effect of making the default target directory be
109           the parent of "DIR".
110
111       -t DIR
112       --target=DIR
113           Set the target directory to "DIR" instead of the parent of the stow
114           directory.
115
116       -v
117       --verbose[=N]
118           Send verbose output to standard error describing what Stow is
119           doing. Verbosity levels are 0, 1, 2, 3, and 4; 0 is the default.
120           Using "-v" or "--verbose" increases the verbosity by one; using
121           `--verbose=N' sets it to N.
122
123       -S
124       --stow
125           Stow the packages that follow this option into the target
126           directory.  This is the default action and so can be omitted if you
127           are only stowing packages rather than performing a mixture of
128           stow/delete/restow actions.
129
130       -D
131       --delete
132           Unstow the packages that follow this option from the target
133           directory rather than installing them.
134
135       -R
136       --restow
137           Restow packages (first unstow, then stow again). This is useful for
138           pruning obsolete symlinks from the target tree after updating the
139           software in a package.
140
141       --adopt
142           Warning!  This behaviour is specifically intended to alter the
143           contents of your stow directory.  If you do not want that, this
144           option is not for you.
145
146           When stowing, if a target is encountered which already exists but
147           is a plain file (and hence not owned by any existing stow package),
148           then normally Stow will register this as a conflict and refuse to
149           proceed.  This option changes that behaviour so that the file is
150           moved to the same relative place within the package's installation
151           image within the stow directory, and then stowing proceeds as
152           before.  So effectively, the file becomes adopted by the stow
153           package, without its contents changing.
154
155       --no-folding
156           Disable folding of newly stowed directories when stowing, and
157           refolding of newly foldable directories when unstowing.
158
159       --ignore=REGEX
160           Ignore files ending in this Perl regex.
161
162       --defer=REGEX
163           Don't stow files beginning with this Perl regex if the file is
164           already stowed to another package.
165
166       --override=REGEX
167           Force stowing files beginning with this Perl regex if the file is
168           already stowed to another package.
169
170       -V
171       --version
172           Show Stow version number, and exit.
173
174       -h
175       --help
176           Show Stow command syntax, and exit.
177

INSTALLING PACKAGES

179       The default action of Stow is to install a package. This means creating
180       symlinks in the target tree that point into the package tree.  Stow
181       attempts to do this with as few symlinks as possible; in other words,
182       if Stow can create a single symlink that points to an entire subtree
183       within the package tree, it will choose to do that rather than create a
184       directory in the target tree and populate it with symlinks.
185
186       For example, suppose that no packages have yet been installed in
187       /usr/local; it's completely empty (except for the stow subdirectory, of
188       course). Now suppose the Perl package is installed.  Recall that it
189       includes the following directories in its installation image: bin;
190       info; lib/perl; man/man1.  Rather than creating the directory
191       /usr/local/bin and populating it with symlinks to ../stow/perl/bin/perl
192       and ../stow/perl/bin/a2p (and so on), Stow will create a single
193       symlink, /usr/local/bin, which points to stow/perl/bin.  In this way,
194       it still works to refer to /usr/local/bin/perl and /usr/local/bin/a2p,
195       and fewer symlinks have been created. This is called "tree folding",
196       since an entire subtree is "folded" into a single symlink.
197
198       To complete this example, Stow will also create the symlink
199       /usr/local/info pointing to stow/perl/info; the symlink /usr/local/lib
200       pointing to stow/perl/lib; and the symlink /usr/local/man pointing to
201       stow/perl/man.
202
203       Now suppose that instead of installing the Perl package into an empty
204       target tree, the target tree is not empty to begin with. Instead, it
205       contains several files and directories installed under a different
206       system-administration philosophy. In particular, /usr/local/bin already
207       exists and is a directory, as are /usr/local/lib and
208       /usr/local/man/man1.  In this case, Stow will descend into
209       /usr/local/bin and create symlinks to ../stow/perl/bin/perl and
210       ../stow/perl/bin/a2p (etc.), and it will descend into /usr/local/lib
211       and create the tree-folding symlink perl pointing to
212       ../stow/perl/lib/perl, and so on. As a rule, Stow only descends as far
213       as necessary into the target tree when it can create a tree-folding
214       symlink.
215
216       The time often comes when a tree-folding symlink has to be undone
217       because another package uses one or more of the folded subdirectories
218       in its installation image. This operation is called "splitting open" a
219       folded tree. It involves removing the original symlink from the target
220       tree, creating a true directory in its place, and then populating the
221       new directory with symlinks to the newly-installed package and to the
222       old package that used the old symlink. For example, suppose that after
223       installing Perl into an empty /usr/local, we wish to install Emacs.
224       Emacs's installation image includes a bin directory containing the
225       emacs and etags executables, among others. Stow must make these files
226       appear to be installed in /usr/local/bin, but presently /usr/local/bin
227       is a symlink to stow/perl/bin.  Stow therefore takes the following
228       steps: the symlink /usr/local/bin is deleted; the directory
229       /usr/local/bin is created; links are made from /usr/local/bin to
230       ../stow/emacs/bin/emacs and ../stow/emacs/bin/etags; and links are made
231       from /usr/local/bin to ../stow/perl/bin/perl and ../stow/perl/bin/a2p.
232
233       When splitting open a folded tree, Stow makes sure that the symlink it
234       is about to remove points inside a valid package in the current stow
235       directory.
236
237   Stow will never delete anything that it doesn't own.
238       Stow "owns" everything living in the target tree that points into a
239       package in the stow directory. Anything Stow owns, it can recompute if
240       lost. Note that by this definition, Stow doesn't "own" anything in the
241       stow directory or in any of the packages.
242
243       If Stow needs to create a directory or a symlink in the target tree and
244       it cannot because that name is already in use and is not owned by Stow,
245       then a conflict has arisen. See the "Conflicts" section in the info
246       manual.
247

DELETING PACKAGES

249       When the "-D" option is given, the action of Stow is to delete a
250       package from the target tree. Note that Stow will not delete anything
251       it doesn't "own". Deleting a package does not mean removing it from the
252       stow directory or discarding the package tree.
253
254       To delete a package, Stow recursively scans the target tree, skipping
255       over the stow directory (since that is usually a subdirectory of the
256       target tree) and any other stow directories it encounters (see
257       "Multiple stow directories" in the info manual). Any symlink it finds
258       that points into the package being deleted is removed. Any directory
259       that contained only symlinks to the package being deleted is removed.
260       Any directory that, after removing symlinks and empty subdirectories,
261       contains only symlinks to a single other package, is considered to be a
262       previously "folded" tree that was "split open."  Stow will re-fold the
263       tree by removing the symlinks to the surviving package, removing the
264       directory, then linking the directory back to the surviving package.
265

SEE ALSO

267       The full documentation for stow is maintained as a Texinfo manual.  If
268       the info and stow programs are properly installed at your site, the
269       command
270
271           info stow
272
273       should give you access to the complete manual.
274

BUGS

276       Please report bugs in Stow using the Debian bug tracking system.
277
278       Currently known bugs include:
279
280       ·   The empty-directory problem.
281
282           If package foo includes an empty directory -- say, foo/bar -- then
283           if no other package has a bar subdirectory, everything's fine.  If
284           another stowed package quux, has a bar subdirectory, then when
285           stowing, targetdir/bar will be "split open" and the contents of
286           quux/bar will be individually stowed.  So far, so good. But when
287           unstowing quux, targetdir/bar will be removed, even though foo/bar
288           needs it to remain.  A workaround for this problem is to create a
289           file in foo/bar as a placeholder. If you name that file
290           .placeholder, it will be easy to find and remove such files when
291           this bug is fixed.
292
293       ·   When using multiple stow directories (see "Multiple stow
294           directories" in the info manual), Stow fails to "split open" tree-
295           folding symlinks (see "Installing packages" in the info manual)
296           that point into a stow directory which is not the one in use by the
297           current Stow command. Before failing, it should search the target
298           of the link to see whether any element of the path contains a .stow
299           file. If it finds one, it can "learn" about the cooperating stow
300           directory to short-circuit the .stow search the next time it
301           encounters a tree-folding symlink.
302

AUTHOR

304       This man page was originally constructed by Charles Briscoe-Smith from
305       parts of Stow's info manual, and then converted to POD format by Adam
306       Spiers.  The info manual contains the following notice, which, as it
307       says, applies to this manual page, too.  The text of the section
308       entitled "GNU General Public License" can be found in the file
309       /usr/share/common-licenses/GPL on any Debian GNU/Linux system.  If you
310       don't have access to a Debian system, or the GPL is not there, write to
311       the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
312       MA, 02111-1307, USA.
313
315       Copyright (C) 1993, 1994, 1995, 1996 by Bob Glickstein
316       <bobg+stow@zanshin.com>; 2000, 2001 by Guillaume Morin; 2007 by Kahlil
317       Hodgson; 2011 by Adam Spiers; and others.
318
319       Permission is granted to make and distribute verbatim copies of this
320       manual provided the copyright notice and this permission notice are
321       preserved on all copies.
322
323       Permission is granted to copy and distribute modified versions of this
324       manual under the conditions for verbatim copying, provided also that
325       the section entitled "GNU General Public License" is included with the
326       modified manual, and provided that the entire resulting derived work is
327       distributed under the terms of a permission notice identical to this
328       one.
329
330       Permission is granted to copy and distribute translations of this
331       manual into another language, under the above conditions for modified
332       versions, except that this permission notice may be stated in a
333       translation approved by the Free Software Foundation.
334
335
336
337perl v5.20.1                      2015-11-09          IO::FILE=IO(0X81D9F0)(1)
Impressum