1 \input texinfo @c -*- texinfo -*-
7 @c @setchapternewpage odd
8 @c @footnotestyle separate
17 This manual describes GNU Stow version @value{VERSION}
18 (@value{UPDATED}), a program for managing farms of symbolic links.
20 Software and documentation is copyrighted by the following:
22 @copyright{} 1993, 1994, 1995, 1996 Bob Glickstein @email{bobg+stow@@zanshin.com}
24 @copyright{} 2000, 2001 Guillaume Morin @email{gmorin@@gnu.org}
26 @copyright{} 2007 Kahlil (Kal) Hodgson @email{kahlil@@internode.on.net}
28 @copyright{} 2011 Adam Spiers @email{stow@@adamspiers.org}
31 Permission is granted to make and distribute verbatim copies of this
32 manual provided the copyright notice and this permission notice are
33 preserved on all copies.
36 Permission is granted to process this file through TeX and print the
37 results, provided the printed document carries a copying permission
38 notice identical to this one except for the removal of this paragraph
39 (this paragraph not being relevant to the printed manual).
42 Permission is granted to copy and distribute modified versions of this
43 manual under the conditions for verbatim copying, provided also that the
44 section entitled ``GNU General Public License'' is included with the
45 modified manual, and provided that the entire resulting derived work is
46 distributed under the terms of a permission notice identical to this
49 Permission is granted to copy and distribute translations of this manual
50 into another language, under the above conditions for modified versions,
51 except that this permission notice may be stated in a translation
52 approved by the Free Software Foundation.
56 @dircategory System administration
58 * Stow: (stow). GNU Stow.
61 @c ===========================================================================
63 @title Stow @value{VERSION}
64 @subtitle Managing the installation of software packages
65 @author Bob Glickstein, Zanshin Software, Inc.
66 @author Kahlil Hodgson, RMIT University, Australia.
67 @author Guillaume Morin
70 @vskip 0pt plus 1filll
74 @c FIXME: How to include the TOC in the TOC?
75 @c @node Table of Contents, Top, (dir), (dir)
76 @c @unnumbered Table of Contents
79 @c ==========================================================================
84 This manual describes GNU Stow @value{VERSION} (@value{UPDATED}), a
85 symlink farm manager which takes distinct sets of software and/or data
86 located in separate directories on the filesystem, and makes them
87 appear to be installed in a single directory tree.
91 * Introduction:: Description of Stow.
92 * Terminology:: Terms used by this manual.
93 * Invoking Stow:: Option summary.
94 * Ignore Lists:: Controlling what gets stowed.
95 * Installing Packages:: Using Stow to install.
96 * Deleting Packages:: Using Stow to uninstall.
97 * Conflicts:: When Stow can't stow.
98 * Mixing Operations:: Multiple actions per invocation.
99 * Multiple Stow Directories:: Further segregating software.
100 * Target Maintenance:: Cleaning up mistakes.
101 * Resource Files:: Setting default command line options.
102 * Compile-time vs. Install-time:: Faking out `make install'.
103 * Bootstrapping:: When stow and perl are not yet stowed.
104 * Reporting Bugs:: How, what, where, and when to report.
105 * Known Bugs:: Don't report any of these.
106 * GNU General Public License:: Copying terms.
107 * Index:: Index of concepts.
110 --- The Detailed Node Listing ---
114 * Motivation For Ignore Lists::
115 * Types And Syntax Of Ignore Lists::
116 * Justification For Yet Another Set Of Ignore Files::
118 Advice on changing compilation and installation parameters
121 * Other FSF Software::
123 * Perl and Perl 5 Modules::
128 @c ===========================================================================
129 @node Introduction, Terminology, Top, Top
130 @chapter Introduction
132 GNU Stow is a symlink farm manager which takes distinct sets of
133 software and/or data located in separate directories on the
134 filesystem, and makes them all appear to be installed in a single
137 Originally Stow was born to address the need to administer, upgrade,
138 install, and remove files in independent software packages without
139 confusing them with other files sharing the same file system space.
140 For instance, many years ago it used to be common to compile programs
141 such as Perl and Emacs from source and install them in
142 @file{/usr/local}. When one does so, one winds up with the following
143 files@footnote{As of Perl 4.036 and Emacs 19.22. These are now
144 ancient releases but the example still holds valid.} in
145 @file{/usr/local/man/man1}:
158 Now suppose it's time to uninstall Perl. Which man pages
159 get removed? Obviously @file{perl.1} is one of them, but it should not
160 be the administrator's responsibility to memorize the ownership of
161 individual files by separate packages.
163 The approach used by Stow is to install each package into its own
164 tree, then use symbolic links to make it appear as though the files are
165 installed in the common tree. Administration can be performed in the
166 package's private tree in isolation from clutter from other packages.
167 Stow can then be used to update the symbolic links. The structure
168 of each private tree should reflect the desired structure in the common
169 tree; i.e. (in the typical case) there should be a @file{bin} directory
170 containing executables, a @file{man/man1} directory containing section 1
171 man pages, and so on.
173 While this is useful for keeping track of system-wide and per-user
174 installations of software built from source, in more recent times
175 software packages are often managed by more sophisticated package
176 management software such as
177 @uref{https://en.wikipedia.org/wiki/Rpm_(software), @command{rpm}},
178 @uref{https://en.wikipedia.org/wiki/Dpkg, @command{dpkg}}, and
179 @uref{https://en.wikipedia.org/wiki/Nix_package_manager, Nix} /
180 @uref{https://en.wikipedia.org/wiki/GNU_Guix, GNU Guix}, or
181 language-native package managers such as
182 @uref{https://en.wikipedia.org/wiki/RubyGems, Ruby's @command{gem}},
183 @uref{https://en.wikipedia.org/wiki/Pip_(package_manager), Python's
184 @command{pip}}, @uref{https://en.wikipedia.org/wiki/Npm_(software),
185 Javascript's @command{npm}}, and so on.
187 However Stow is still used not only for software package management,
188 but also for other purposes, such as facilitating a more controlled
189 approach to management of configuration files in the user's home
190 directory@footnote{@uref{http://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to-manage-your-dotfiles.html}},
191 especially when coupled with version control
192 systems@footnote{@uref{http://lists.gnu.org/archive/html/info-stow/2011-12/msg00000.html}}.
194 Stow was inspired by Carnegie Mellon's Depot program, but is
195 substantially simpler and safer. Whereas Depot required database
196 files to keep things in sync, Stow stores no extra state between runs,
197 so there's no danger (as there was in Depot) of mangling directories
198 when file hierarchies don't match the database. Also unlike Depot,
199 Stow will never delete any files, directories, or links that appear in
200 a Stow directory (e.g., @file{/usr/local/stow/emacs}), so it's always
201 possible to rebuild the target tree (e.g., @file{/usr/local}).
203 Stow is implemented as a combination of a Perl script providing a CLI
204 interface, and a backend Perl module which does most of the work.
206 For information about the latest version of Stow, you can refer to
207 @uref{http://www.gnu.org/software/stow/}.
210 @c ===========================================================================
211 @node Terminology, Invoking Stow, Introduction, Top
216 A @dfn{package} is a related collection of files and directories that
217 you wish to administer as a unit --- e.g., Perl or Emacs --- and that needs
218 to be installed in a particular directory structure --- e.g., with
219 @file{bin}, @file{lib}, and @file{man} subdirectories.
221 @cindex target directory
222 A @dfn{target directory} is the root of a tree in which one or more
223 packages wish to @emph{appear} to be installed. @file{/usr/local} is a
224 common choice for this, but by no means the only such location. Another
225 common choice is @file{~} (i.e.@: the user's @code{$HOME} directory) in
226 the case where Stow is being used to manage the user's configuration
227 (``dotfiles'') and other files in their @code{$HOME}. The examples in
228 this manual will use @file{/usr/local} as the target directory.
230 @cindex stow directory
231 A @dfn{stow directory} is the root of a tree containing separate
232 packages in private subtrees. When Stow runs, it uses the current
233 directory as the default stow directory. The examples in this manual
234 will use @file{/usr/local/stow} as the stow directory, so that
235 individual packages will be, for example, @file{/usr/local/stow/perl}
236 and @file{/usr/local/stow/emacs}.
238 @cindex installation image
239 An @dfn{installation image} is the layout of files and directories
240 required by a package, relative to the target directory. Thus, the
241 installation image for Perl includes: a @file{bin} directory containing
242 @file{perl} and @file{a2p} (among others); an @file{info} directory
243 containing Texinfo documentation; a @file{lib/perl} directory containing
244 Perl libraries; and a @file{man/man1} directory containing man pages.
247 This is a @emph{pre-}installation image which exists even before Stow
248 has installed any symlinks into the target directory which point to it.
251 @cindex package directory
253 A @dfn{package directory} is the root of a tree containing the
254 installation image for a particular package. Each package directory
255 must reside in a stow directory --- e.g., the package directory
256 @file{/usr/local/stow/perl} must reside in the stow directory
257 @file{/usr/local/stow}. The @dfn{name} of a package is the name of its
258 directory within the stow directory --- e.g., @file{perl}.
260 Thus, the Perl executable might reside in
261 @file{/usr/local/stow/perl/bin/perl}, where @file{/usr/local} is the
262 target directory, @file{/usr/local/stow} is the stow directory,
263 @file{/usr/local/stow/perl} is the package directory, and
264 @file{bin/perl} within is part of the installation image.
268 @cindex symlink source
269 @cindex symlink destination
270 @cindex relative symlink
271 @cindex absolute symlink
272 A @dfn{symlink} is a symbolic link, i.e.@: an entry on the filesystem
273 whose path is sometimes called the @dfn{symlink source}, which points to
274 another location on the filesystem called the @dfn{symlink destination}.
275 There is no guarantee that the destination actually exists.
277 In general, symlinks can be @dfn{relative} or @dfn{absolute}. A symlink
278 is absolute when the destination names a full path; that is, one
279 starting from @file{/}. A symlink is relative when the destination
280 names a relative path; that is, one not starting from @file{/}. The
281 destination of a relative symlink is computed starting from the
282 symlink's own directory, i.e.@: the directory containing the symlink
286 Stow only creates symlinks within the target directory which point to
287 locations @emph{outside} the target directory and inside the stow
290 Consequently, we avoid referring to symlink destinations as symlink
291 @emph{targets}, since this would result in the word ``target'' having
292 two different meanings:
297 the target directory, i.e.@: the directory into which Stow targets
298 installation, where symlinks are managed by Stow, and
301 the destinations of those symlinks.
305 If we did not avoid the second meaning of ``target'', then it would lead
306 to confusing language, such as describing Stow as installing symlinks
307 into the target directory which point to targets @emph{outside} the
310 Similarly, the word ``source'' can have two different meanings in this
316 the installation image, or some of its contents, and
319 the location of symlinks (the ``source'' of the link, vs.@: its
324 Therefore it should also be avoided, or at least care taken to ensure
325 that the meaning is not ambiguous.
329 @c ===========================================================================
330 @node Invoking Stow, Ignore Lists, Terminology, Top
331 @chapter Invoking Stow
333 The syntax of the @command{stow} command is:
336 stow [@var{options}] [@var{action flag}] @var{package @dots{}}
340 Each @var{package} is the name of a package (e.g., @samp{perl}) in the stow
341 directory that we wish to install into (or delete from) the target directory.
342 The default action is to install the given packages, although alternate actions
343 may be specified by preceding the package name(s) with an @var{action flag}.
346 The following options are supported:
351 @itemx --dir=@var{dir}
352 Set the stow directory to @var{dir}. Defaults to the value of the environment
353 variable @env{STOW_DIR} if set, or the current directory otherwise.
356 @itemx --target=@var{dir}
357 Set the target directory to @var{dir} instead of the parent of the stow
358 directory. Defaults to the parent of the stow directory, so it is typical to
359 execute @command{stow} from the directory @file{/usr/local/stow}.
361 @item --ignore=@var{regexp}
362 This (repeatable) option lets you suppress acting on files that match the
363 given Perl regular expression. For example, using the options
366 --ignore='.*\.orig' --ignore='.*\.dist'
370 will cause stow to ignore files ending in @file{.orig} or @file{.dist}.
372 Note that the regular expression is anchored to the end of the filename,
373 because this is what you will want to do most of the time.
375 Also note that by default Stow automatically ignores a ``sensible''
376 built-in list of files and directories such as @file{CVS}, editor
377 backup files, and so on. @xref{Ignore Lists}, for more details.
379 @item --defer=@var{regexp}
380 This (repeatable) option avoids stowing a file matching the given
381 regular expression, if that file is already stowed by another package.
382 This is effectively the opposite of @option{--override}.
384 (N.B. the name @option{--defer} was chosen in the sense that the package
385 currently being stowed is treated with lower precedence than any
386 already installed package, not in the sense that the operation is
387 being postponed to be run at a later point in time; do not confuse
388 this nomenclature with the wording used in @ref{Deferred Operation}.)
390 For example, the following options
393 --defer=man --defer=info
397 will cause stow to skip over pre-existing man and info pages.
399 Equivalently, you could use @samp{--defer='man|info'} since the
400 argument is just a Perl regular expression.
402 Note that the regular expression is anchored to the beginning of the path
403 relative to the target directory, because this is what you will want to do most
406 @item --override=@var{regexp}
407 This (repeatable) option forces any file matching the regular expression to be
408 stowed, even if the file is already stowed to another package. For example,
409 the following options
412 --override=man --override=info
416 will permit stow to overwrite links that point to pre-existing man and info
417 pages that are owned by stow and would otherwise cause a conflict.
419 The regular expression is anchored to the beginning of the path relative to
420 the target directory, because this is what you will want to do most of the time.
425 Enable special handling for @emph{dotfiles} (files or folders whose
426 name begins with a period) in the package directory. If this option is
427 enabled, Stow will add a preprocessing step for each file or folder
428 whose name begins with @samp{dot-}, and replace the @samp{dot-} prefix
429 in the name by a period @samp{.}. This is useful when Stow is used to
430 manage collections of dotfiles, to avoid having a package directory
431 full of hidden files.
433 For example, suppose we have a package containing two files,
434 @file{stow/dot-bashrc} and @file{stow/dot-emacs.d/init.el}. With this
435 option, Stow will create symlinks from @file{.bashrc} to
436 @file{stow/dot-bashrc} and from @file{.emacs.d/init.el} to
437 @file{stow/dot-emacs.d/init.el}. Any other files, whose name does not
438 begin with @samp{dot-}, will be processed as usual.
442 This disables any further tree folding (@pxref{tree folding}) or
443 refolding (@pxref{tree refolding}). If a new subdirectory is
444 encountered whilst stowing a new package, the subdirectory is created
445 within the target, and its contents are symlinked, rather than just
446 creating a symlink for the directory. If removal of symlinks whilst
447 unstowing a package causes a subtree to be foldable (i.e.@: only
448 containing symlinks to a single package), that subtree will not be
449 removed and replaced with a symlink.
451 @cindex adopting existing files
453 @strong{Warning!} This behaviour is specifically intended to alter the
454 contents of your stow directory. If you do not want that, this option
457 When stowing, if a target is encountered which already exists but is a
458 plain file (and hence not owned by any existing stow package), then
459 normally Stow will register this as a conflict and refuse to proceed.
460 This option changes that behaviour so that the file is moved to the
461 same relative place within the package's installation image within the
462 stow directory, and then stowing proceeds as before. So effectively,
463 the file becomes adopted by the stow package, without its contents
466 This is particularly useful when the stow package is under the control
467 of a version control system, because it allows files in the target
468 tree, with potentially different contents to the equivalent versions
469 in the stow package's installation image, to be adopted into the
470 package, then compared by running something like @samp{git diff ...}
471 inside the stow package, and finally either kept (e.g. via @samp{git
472 commit ...}) or discarded (@samp{git checkout HEAD ...}).
475 @cindex simulated run
479 Do not perform any operations that modify the file system; in combination with
480 @option{-v} can be used to merely show what would happen.
482 @cindex verbosity levels
484 @itemx --verbose[=@var{n}]
485 Send verbose output to standard error describing what Stow is
486 doing. Verbosity levels are from 0 to 5; 0 is the default. Using
487 @option{-v} or @option{--verbose} increases the verbosity by one; using
488 @samp{--verbose=@var{n}} sets it to @var{n}.
492 Scan the whole target tree when unstowing. By default, only directories
493 specified in the @dfn{installation image} are scanned during an unstow
494 operation. Previously Stow scanned the whole tree, which can be
495 prohibitive if your target tree is very large, but on the other hand has
496 the advantage of unstowing previously stowed links which are no longer
497 present in the installation image and therefore orphaned. This option
498 restores the legacy behaviour; however, the @option{--badlinks} option
499 to the @command{chkstow} utility may be a better way of ensuring that
500 your installation does not have any dangling symlinks (@pxref{Target
505 Show Stow version number, and exit.
509 Show Stow command syntax, and exit.
512 The following @var{action flags} are supported:
517 Delete (unstow) the package name(s) that follow this option from the @dfn{target
518 directory}. This option may be repeated any number of times.
522 Restow (first unstow, then stow again) the package names that follow this
523 option. This is useful for pruning obsolete symlinks from the target tree
524 after updating the software in a package. This option may be repeated any
529 explictly stow the package name(s) that follow this option. May be
530 omitted if you are not using the @option{-D} or @option{-R} options in the
531 same invocation. @xref{Mixing Operations}, for details of when you
532 might like to use this feature. This option may be repeated any number
537 @c ===========================================================================
538 @node Ignore Lists, Installing Packages, Invoking Stow, Top
539 @chapter Ignore Lists
542 @cindex ignoring files and directories
545 * Motivation For Ignore Lists::
546 * Types And Syntax Of Ignore Lists::
547 * Justification For Yet Another Set Of Ignore Files::
550 @c ===========================================================================
551 @node Motivation For Ignore Lists, Types And Syntax Of Ignore Lists, Ignore Lists, Ignore Lists
552 @section Motivation For Ignore Lists
554 In many situations, there will exist files under the package
555 directories which it would be undesirable to stow into the target
556 directory. For example, files related version control such as
557 @file{.gitignore}, @file{CVS}, @file{*,v} (RCS files) should typically
558 not have symlinks from the target tree pointing to them. Also there
559 may be files or directories relating to the build of the package which
560 are not needed at run-time.
562 In these cases, it can be rather cumbersome to specify a
563 @option{--ignore} parameter for each file or directory to be ignored.
564 This could be worked around by ensuring the existence of
565 @file{~/.stowrc} containing multiple @option{--ignore} lines, or if a
566 different set of files/directories should be ignored depending on
567 which stow package is involved, a @file{.stowrc} file for each stow
568 package, but this would require the user to ensure that they were in
569 the correct directory before invoking stow, which would be tedious and
570 error-prone. Furthermore, since Stow shifts parameters from
571 @file{.stowrc} onto ARGV at run-time, it could clutter up the process
572 table with excessively long parameter lists, or even worse, exceed the
573 operating system's limit for process arguments.
576 Therefore in addition to @option{--ignore} parameters, Stow provides a
577 way to specify lists of files and directories to ignore.
579 @c ===========================================================================
580 @node Types And Syntax Of Ignore Lists, Justification For Yet Another Set Of Ignore Files, Motivation For Ignore Lists, Ignore Lists
581 @section Types And Syntax Of Ignore Lists
583 If you put Perl regular expressions, one per line, in a
584 @file{.stow-local-ignore} file within any top level package directory,
585 in which case any file or directory within that package matching any
586 of these regular expressions will be ignored. In the absence of this
587 package-specific ignore list, Stow will instead use the contents of
588 @file{~/.stow-global-ignore}, if it exists. If neither the
589 package-local or global ignore list exist, Stow will use its own
590 built-in default ignore list, which serves as a useful example of the
591 format of these ignore list files:
594 @verbatiminclude default-ignore-list
597 Stow first iterates through the chosen ignore list (built-in, global,
598 or package-local) as per above, stripping out comments (if you want to
599 include the @samp{#} symbol in a regular expression, escape it with a
600 blackslash) and blank lines, placing each regular expressions into one
601 of two sets depending on whether it contains the @samp{/} forward
604 Then in order to determine whether a file or directory should be
609 Stow calculates its path relative to the top-level package directory,
610 prefixing that with @samp{/}. If any of the regular expressions
611 containing a @samp{/} @emph{exactly}@footnote{Exact matching means the
612 regular expression is anchored at the beginning and end, in contrast
613 to unanchored regular expressions which will match a substring.} match
614 a subpath@footnote{In this context, ``subpath'' means a contiguous
615 subset of path segments; e.g for the relative path
616 @file{one/two/three}, there are six valid subpaths: @file{one},
617 @file{two}, @file{three}, @file{one/two}, @file{two/three},
618 @file{one/two/three}.} of this relative path, then the file or
619 directory will be ignored.
622 If none of the regular expressions containing a @samp{/} match in the
623 manner described above, Stow checks whether the
624 @emph{basename}@footnote{The ``basename'' is the name of the file or
625 directory itself, excluding any directory path prefix - as returned by
626 the @command{basename} command.} of the file or directory matches
627 @emph{exactly} against the remaining regular expressions which do not
628 contain a @samp{/}, and if so, ignores the file or directory.
631 Otherwise, the file or directory is not ignored.
634 @c N.B. if you change the examples below, please also consider
635 @c updating test_examples_in_manual() in t/ignore.t.
637 For example, if a file @file{bazqux} is in the @file{foo/bar}
638 subdirectory of the package directory, Stow would use
639 @samp{/foo/bar/bazqux} as the text for matching against regular
640 expressions which contain @samp{/}, and @samp{bazqux} as the text for
641 matching against regular expressions which don't contain @samp{/}.
642 Then regular expressions @samp{bazqux}, @samp{baz.*}, @samp{.*qux},
643 @samp{bar/.*x}, and @samp{^/foo/.*qux} would all match (causing the
644 file to be ignored), whereas @samp{bar}, @samp{baz}, @samp{qux}, and
645 @samp{o/bar/b} would not (although @samp{bar} would cause its parent
646 directory to be ignored and prevent Stow from recursing into that
647 anyway, in which case the file @file{bazqux} would not even be
648 considered for stowing).
650 As a special exception to the above algorithm, any
651 @file{.stow-local-ignore} present in the top-level package directory
652 is @emph{always} ignored, regardless of the contents of any ignore
653 list, because this file serves no purpose outside the stow directory.
655 @c ===========================================================================
656 @node Justification For Yet Another Set Of Ignore Files, , Types And Syntax Of Ignore Lists, Ignore Lists
657 @section Justification For Yet Another Set Of Ignore Files
659 The reader may note that this format is very similar to existing
660 ignore list file formats, such as those for @command{cvs}, @command{git},
661 @command{rsync} etc., and wonder if another set of ignore lists is
662 justified. However there are good reasons why Stow does not simply
663 check for the presence of say, @file{.cvsignore}, and use that if it
664 exists. Firstly, there is no guarantee that a stow package would
665 contain any version control meta-data, or permit introducing this if
666 it didn't already exist.
668 Secondly even if it did, version control system ignore lists generally
669 reflect @emph{build-time} ignores rather than @emph{install-time}, and
670 there may be some intermediate or temporary files on those ignore
671 lists generated during development or at build-time which it would be
672 inappropriate to stow, even though many files generated at build-time
673 (binaries, libraries, documentation etc.) certainly do need to be
674 stowed. Similarly, if a file is @emph{not} in the version control
675 system's ignore list, there is no way of knowing whether the file is
676 intended for end use, let alone whether the version control system is
679 Therefore it seems clear that ignore lists provided by version control
680 systems do not provide sufficient information for Stow to determine
681 which files and directories to stow, and so it makes sense for Stow to
682 support independent ignore lists.
684 @c ===========================================================================
685 @node Installing Packages, Deleting Packages, Ignore Lists, Top
686 @chapter Installing Packages
689 The default action of Stow is to install a package. This means creating
690 symlinks in the target tree that point into the package tree. Stow
691 attempts to do this with as few symlinks as possible; in other words, if
692 Stow can create a single symlink that points to an entire subtree within
693 the package tree, it will choose to do that rather than create a
694 directory in the target tree and populate it with symlinks.
696 @anchor{tree folding}
697 @section Tree folding
699 @cindex directory folding
700 @cindex folding trees
701 For example, suppose that no packages have yet been installed in
702 @file{/usr/local}; it's completely empty (except for the @file{stow}
703 subdirectory, of course). Now suppose the Perl package is installed.
704 Recall that it includes the following directories in its installation
705 image: @file{bin}; @file{info}; @file{lib/perl}; @file{man/man1}.
706 Rather than creating the directory @file{/usr/local/bin} and populating
707 it with symlinks to @file{../stow/perl/bin/perl} and
708 @file{../stow/perl/bin/a2p} (and so on), Stow will create a
709 single symlink, @file{/usr/local/bin}, which points to
710 @file{stow/perl/bin}. In this way, it still works to refer to
711 @file{/usr/local/bin/perl} and @file{/usr/local/bin/a2p}, and fewer
712 symlinks have been created. This is called @dfn{tree folding}, since an
713 entire subtree is ``folded'' into a single symlink.
715 To complete this example, Stow will also create the symlink
716 @file{/usr/local/info} pointing to @file{stow/perl/info}; the symlink
717 @file{/usr/local/lib} pointing to @file{stow/perl/lib}; and the symlink
718 @file{/usr/local/man} pointing to @file{stow/perl/man}.
720 Now suppose that instead of installing the Perl package into an empty
721 target tree, the target tree is not empty to begin with. Instead, it
722 contains several files and directories installed under a different
723 system-administration philosophy. In particular, @file{/usr/local/bin}
724 already exists and is a directory, as are @file{/usr/local/lib} and
725 @file{/usr/local/man/man1}. In this case, Stow will descend into
726 @file{/usr/local/bin} and create symlinks to
727 @file{../stow/perl/bin/perl} and @file{../stow/perl/bin/a2p} (etc.),
728 and it will descend into @file{/usr/local/lib} and create the
729 tree-folding symlink @file{perl} pointing to
730 @file{../stow/perl/lib/perl}, and so on. As a rule, Stow only
731 descends as far as necessary into the target tree when it can create a
732 tree-folding symlink. However, this behaviour can be changed via
733 the @option{--no-folding} option; @pxref{Invoking Stow}.
735 @anchor{Tree unfolding}
736 @section Tree unfolding
737 @cindex splitting open folded trees
738 @cindex unfolding trees
739 @cindex tree unfolding
740 @cindex tree unsplitting
741 The time often comes when a tree-folding symlink has to be undone
742 because another package uses one or more of the folded subdirectories in
743 its installation image. This operation is called @dfn{splitting open} or
744 @dfn{unfolding} a folded tree. It involves removing the original symlink from
745 the target tree, creating a true directory in its place, and then populating the
746 new directory with symlinks to the newly-installed package @emph{and} to
747 the old package that used the old symlink. For example, suppose that
748 after installing Perl into an empty @file{/usr/local}, we wish to
749 install Emacs. Emacs's installation image includes a @file{bin}
750 directory containing the @file{emacs} and @file{etags} executables,
751 among others. Stow must make these files appear to be installed
752 in @file{/usr/local/bin}, but presently @file{/usr/local/bin} is a
753 symlink to @file{stow/perl/bin}. Stow therefore takes the
754 following steps: the symlink @file{/usr/local/bin} is deleted; the
755 directory @file{/usr/local/bin} is created; links are made from
756 @file{/usr/local/bin} to @file{../stow/emacs/bin/emacs} and
757 @file{../stow/emacs/bin/etags}; and links are made from
758 @file{/usr/local/bin} to @file{../stow/perl/bin/perl} and
759 @file{../stow/perl/bin/a2p}.
763 When splitting open a folded tree, Stow makes sure that the
764 symlink it is about to remove points inside a valid package in the
765 current stow directory. @emph{Stow will never delete anything
766 that it doesn't own}. Stow ``owns'' everything living in the
767 target tree that points into a package in the stow directory. Anything
768 Stow owns, it can recompute if lost: symlinks that point into a package in
769 the stow directory, or directories that only contain symlinks that stow
770 ``owns''. Note that by this definition, Stow doesn't ``own'' anything
771 @emph{in} the stow directory or in any of the packages.
773 @section Conflicts during installation
775 @cindex installation conflicts
776 If Stow needs to create a directory or a symlink in the target
777 tree and it cannot because that name is already in use and is not owned
778 by Stow, then a @dfn{conflict} has arisen. @xref{Conflicts}.
781 @c ===========================================================================
782 @node Deleting Packages, Conflicts, Installing Packages, Top
783 @chapter Deleting Packages
786 When the @option{-D} option is given, the action of Stow is to
787 delete a package from the target tree. Note that Stow will not
788 delete anything it doesn't ``own''. Deleting a package does @emph{not}
789 mean removing it from the stow directory or discarding the package
792 To delete a package, Stow recursively scans the target tree, skipping over any
793 directory that is not included in the installation image.@footnote{This
794 approach was introduced in version 2 of GNU Stow. Previously, the whole
795 target tree was scanned and stow directories were explicitly omitted. This
796 became problematic when dealing with very large installations. The only
797 situation where this is useful is if you accidentally delete a directory in
798 the package tree, leaving you with a whole bunch of dangling links. Note that
799 you can enable the old approach with the @option{-p} option. Alternatively, you can
800 use the @option{--badlinks} option get stow to search for dangling links in your target tree and remove the offenders manually.}
801 For example, if the target directory is @file{/usr/local} and the
802 installation image for the package being deleted has only a @file{bin}
803 directory and a @file{man} directory at the top level, then we only scan
804 @file{/usr/local/bin} and @file{/usr/local/man}, and not
805 @file{/usr/local/lib} or @file{/usr/local/share}, or for that matter
806 @file{/usr/local/stow}. Any symlink it finds that points into the package
807 being deleted is removed. Any directory that contained only symlinks to the
808 package being deleted is removed.
810 @anchor{tree refolding}
811 @section Refolding ``foldable'' trees.
812 @cindex refolding trees
813 @cindex tree refolding
815 After removing symlinks and empty subdirectories, any directory that
816 contains only symlinks to a single other package is considered to be a
817 previously ``folded'' tree that was ``split open.'' Stow will refold
818 the tree by removing the symlinks to the surviving package, removing
819 the directory, then linking the directory back to the surviving
820 package. However, this behaviour can be prevented via the
821 @option{--no-folding} option; @pxref{Invoking Stow}.
823 @c ===========================================================================
824 @node Conflicts, Mixing Operations, Deleting Packages, Top
828 If, during installation, a file or symlink exists in the target tree and
829 has the same name as something Stow needs to create, and if the
830 existing name is not a folded tree that can be split open, then a
831 @dfn{conflict} has arisen. A conflict also occurs if a directory exists
832 where Stow needs to place a symlink to a non-directory. On the
833 other hand, if the existing name is merely a symlink that already points
834 where Stow needs it to, then no conflict has occurred. (Thus it
835 is harmless to install a package that has already been installed.)
837 For complex packages, scanning the stow and target trees in tandem,
838 and deciding whether to make directories or links, split-open or fold
839 directories, can actually take a long time (a number of seconds).
840 Moreover, an accurate analysis of potential conflicts requires us to
841 take into account all of these operations.
843 @anchor{Deferred Operation}
844 @section Deferred Operation
845 @cindex deferred operation
847 Since version 2.0, Stow now adopts a two-phase algorithm, first
848 scanning for any potential conflicts before any stowing or unstowing
849 operations are performed. If any conflicts are found, they are
850 displayed and then Stow terminates without making any modifications to
851 the filesystem. This means that there is much less risk of a package
852 being partially stowed or unstowed due to conflicts.
854 Prior to version 2.0, if a conflict was discovered, the stow or unstow
855 operation could be aborted mid-flow, leaving the target tree in an
858 @c ===========================================================================
859 @node Mixing Operations, Multiple Stow Directories, Conflicts, Top
860 @chapter Mixing Operations
861 @cindex mixing operations
863 Since version 2.0, multiple distinct actions can be specified in a single
864 invocation of GNU Stow. For example, to update an installation of Emacs from
865 version 21.3 to 21.4a you can now do the following:
868 stow -D emacs-21.3 -S emacs-21.4a
872 which will replace emacs-21.3 with emacs-21.4a using a single invocation.
874 @cindex deferred operation
875 This is much faster and cleaner than performing two separate
876 invocations of stow, because redundant folding/unfolding operations
877 can be factored out. In addition, all the operations are calculated
878 and merged before being executed (@pxref{Deferred Operation}), so the
879 amount of time in which GNU Emacs is unavailable is minimised.
881 You can mix and match any number of actions, for example,
884 stow -S pkg1 pkg2 -D pkg3 pkg4 -S pkg5 -R pkg6
888 will unstow pkg3, pkg4 and pkg6, then stow pkg1, pkg2, pkg5 and pkg6.
890 @c ===========================================================================
891 @node Multiple Stow Directories, Target Maintenance, Mixing Operations, Top
892 @chapter Multiple Stow Directories
894 If there are two or more system administrators who wish to maintain
895 software separately, or if there is any other reason to want two or more
896 stow directories, it can be done by creating a file named @file{.stow}
897 in each stow directory. The presence of @file{/usr/local/foo/.stow}
898 informs Stow that, though @file{foo} is not the current stow
899 directory, even if it is a subdirectory of the target directory,
900 nevertheless it is @emph{a} stow directory and as such Stow
901 doesn't ``own'' anything in it (@pxref{Installing Packages}). This will
902 protect the contents of @file{foo} from a @samp{stow -D}, for instance.
904 @c There is a test for the following case in t/examples.t:
906 When multiple stow directories share a target tree, if a tree-folding
907 symlink is encountered and needs to be split open during an
908 installation, as long as the top-level stow directory into which the
909 existing symlink points contains @file{.stow}, Stow knows how to split
910 open the tree in the correct manner.
912 @c ===========================================================================
913 @node Target Maintenance, Resource Files, Multiple Stow Directories, Top
914 @chapter Target Maintenance
917 From time to time you will need to clean up your target tree. Since
918 version 2, Stow provides a new utility @command{chkstow} to help with
919 this. It includes three operational modes which performs checks that
920 would generally be too expensive to be performed during normal stow
923 The syntax of the @command{chkstow} command is:
926 chkstow [@var{options}]
930 The following options are supported:
935 @itemx --target=@var{dir}
936 Set the target directory to @var{dir} instead of the parent of the stow
937 directory. Defaults to the parent of the stow directory, so it is typical to
938 execute @command{stow} from the directory @file{/usr/local/stow}.
942 Checks target directory for bogus symbolic links. That is, links that point to
947 Checks for files in the target directory that are not symbolic links. The
948 target directory should be managed by stow alone, except for directories that
949 contain a @file{.stow} file.
953 Will display the target package for every symbolic link in the stow target
958 @c ===========================================================================
959 @node Resource Files, Compile-time vs. Install-time, Target Maintenance, Top
960 @chapter Resource Files
961 @cindex resource files
962 @cindex configuration files
964 Default command line options may be set in @file{.stowrc} (current
965 directory) or @file{~/.stowrc} (home directory). These are parsed in
966 that order, and are appended together if they both exist. The effect of
967 the options in the resource file is similar to simply prepending the
968 options to the command line. This feature can be used for some
971 For example, suppose your site uses more than one stow directory, perhaps in
972 order to share around responsibilities with a number of systems
973 administrators. One of the administrators might have the following in their
974 @file{~/.stowrc} file:
977 --dir=/usr/local/stow2
983 so that the @command{stow} command will default to operating on the
984 @file{/usr/local/stow2} directory, with @file{/usr/local} as the
985 target, and ignoring vi backup files and CVS directories.
987 If you had a stow directory @file{/usr/local/stow/perl-extras} that
988 was only used for Perl modules, then you might place the following in
989 @file{/usr/local/stow/perl-extras/.stowrc}:
992 --dir=/usr/local/stow/perl-extras
996 --ignore='perllocal\.pod'
997 --ignore='\.packlist'
1001 so that when you are in the @file{/usr/local/stow/perl-extras}
1002 directory, @command{stow} will regard any subdirectories as stow
1003 packages, with @file{/usr/local} as the target (rather than the
1004 immediate parent directory @file{/usr/local/stow}), overriding any
1005 pre-existing links to bin files or man pages, and ignoring some cruft
1006 that gets installed by default.
1008 If an option is provided both on the command line and in a resource file,
1009 the command line option takes precedence. For options that provide a single
1010 value, such as @command{--target} or @command{--dir}, the command line
1011 option will overwrite any options in the resource file. For options that can
1012 be given more than once, @command{--ignore} for example, command line
1013 options and resource options are appended together.
1015 For options that take a file path, environment variables and the tilde
1016 character (@command{~}) are expanded. An environment variable can be
1017 given in either the @command{$VAR} or @command{$@{VAR@}} form. To
1018 prevent expansion, escape the @command{$} or @command{~} with a
1019 backslash. Since these values are first subject to standard shell
1020 quoting rules, if you want special characters such as @command{\b} or
1021 @command{$} to be treated as regular expression assertions then they
1022 will need extra escaping, i.e. @command{\\b} and @command{\\\$}
1025 The options @command{-D}, @command{-S}, and @command{-R} are ignored in
1026 resource files. This is also true of any package names given in the
1029 @c ===========================================================================
1030 @node Compile-time vs. Install-time, Bootstrapping, Resource Files, Top
1031 @chapter Compile-time vs. Install-time
1033 Software whose installation is managed with Stow needs to be installed
1034 in one place (the package directory, e.g. @file{/usr/local/stow/perl})
1035 but needs to appear to run in another place (the target tree, e.g.,
1036 @file{/usr/local}). Why is this important? What's wrong with Perl, for
1037 instance, looking for its files in @file{/usr/local/stow/perl} instead
1038 of in @file{/usr/local}?
1040 The answer is that there may be another package, e.g.,
1041 @file{/usr/local/stow/perl-extras}, stowed under @file{/usr/local}. If
1042 Perl is configured to find its files in @file{/usr/local/stow/perl}, it
1043 will never find the extra files in the @samp{perl-extras} package, even
1044 though they're intended to be found by Perl. On the other hand, if Perl
1045 looks for its files in @file{/usr/local}, then it will find the
1046 intermingled Perl and @samp{perl-extras} files.
1048 This means that when you compile a package, you must tell it the
1049 location of the run-time, or target tree; but when you install it, you
1050 must place it in the stow tree.
1052 @section Advice on changing compilation and installation parameters
1053 Some software packages allow you to specify, at compile-time, separate
1054 locations for installation and for run-time. Perl is one such package;
1055 see @ref{Perl and Perl 5 Modules}. Others allow you to compile the
1056 package, then give a different destination in the @samp{make install}
1057 step without causing the binaries or other files to get rebuilt. Most
1058 GNU software falls into this category; Emacs is a notable exception.
1059 @xref{GNU Emacs}, and @ref{Other FSF Software}.
1061 Still other software packages cannot abide the idea of separate
1062 installation and run-time locations at all. If you try to @samp{make
1063 install prefix=/usr/local/stow/@var{foo}}, then first the whole package
1064 will be recompiled to hardwire the @file{/usr/local/stow/@var{foo}}
1065 path. With these packages, it is best to compile normally, then run
1066 @samp{make -n install}, which should report all the steps needed to
1067 install the just-built software. Place this output into a file, edit
1068 the commands in the file to remove recompilation steps and to reflect
1069 the Stow-based installation location, and execute the edited file as a
1070 shell script in place of @samp{make install}. Be sure to execute the
1071 script using the same shell that @samp{make install} would have used.
1073 (If you use GNU Make and a shell [such as GNU bash] that understands
1074 @command{pushd} and @command{popd}, you can do the following:
1078 Replace all lines matching @samp{make[@var{n}]: Entering directory
1079 @var{dir}} with @samp{pushd @var{dir}}.
1081 Replace all lines matching @samp{make[@var{n}]: Leaving directory
1082 @var{dir}} with @samp{popd}.
1084 Delete all lines matching @samp{make[@var{n}]: Nothing to be done for
1088 Then find other lines in the output containing @command{cd} or @command{make}
1089 commands and rewrite or delete them. In particular, you should be able
1090 to delete sections of the script that resemble this:
1093 for i in @var{dir_1} @var{dir_2} @r{@dots{}}; do \
1094 (cd $i; make @var{args} @r{@dots{}}) \
1099 Note, that's ``should be able to,'' not ``can.'' Be sure to modulate
1100 these guidelines with plenty of your own intelligence.
1102 The details of stowing some specific packages are described in the
1107 * Other FSF Software::
1109 * Perl and Perl 5 Modules::
1112 @c ---------------------------------------------------------------------------
1113 @node GNU Emacs, Other FSF Software, Compile-time vs. Install-time, Compile-time vs. Install-time
1116 Although the Free Software Foundation has many enlightened practices
1117 regarding Makefiles and software installation (see @pxref{Other FSF
1118 Software}), Emacs, its flagship program, doesn't quite follow the
1119 rules. In particular, most GNU software allows you to write:
1123 make install prefix=/usr/local/stow/@var{package}
1127 If you try this with Emacs, then the new value for @var{prefix} in the
1128 @samp{make install} step will cause some files to get recompiled with
1129 the new value of @var{prefix} wired into them. In Emacs 19.23 and
1130 later,@footnote{As I write this, the current version of Emacs is 19.31.}
1131 the way to work around this problem is:
1135 make install-arch-dep install-arch-indep prefix=/usr/local/stow/emacs
1138 In 19.22 and some prior versions of Emacs, the workaround was:
1142 make do-install prefix=/usr/local/stow/emacs
1145 @c ---------------------------------------------------------------------------
1146 @node Other FSF Software, Cygnus Software, GNU Emacs, Compile-time vs. Install-time
1147 @section Other FSF Software
1149 The Free Software Foundation, the organization behind the GNU project,
1150 has been unifying the build procedure for its tools for some time.
1151 Thanks to its tools @samp{autoconf} and @samp{automake}, most packages
1152 now respond well to these simple steps, with no other intervention
1156 ./configure @var{options}
1158 make install prefix=/usr/local/stow/@var{package}
1161 Hopefully, these tools can evolve to be aware of Stow-managed packages,
1162 such that providing an option to @samp{configure} can allow @samp{make}
1163 and @samp{make install} steps to work correctly without needing to
1164 ``fool'' the build process.
1166 @c ---------------------------------------------------------------------------
1167 @node Cygnus Software, Perl and Perl 5 Modules, Other FSF Software, Compile-time vs. Install-time
1168 @section Cygnus Software
1170 Cygnus is a commercial supplier and supporter of GNU software. It has
1171 also written several of its own packages, released under the terms of
1172 the GNU General Public License; and it has taken over the maintenance of
1173 other packages. Among the packages released by Cygnus are @samp{gdb},
1174 @samp{gnats}, and @samp{dejagnu}.
1176 Cygnus packages have the peculiarity that each one unpacks into a
1177 directory tree with a generic top-level Makefile, which is set up to
1178 compile @emph{all} of Cygnus' packages, any number of which may reside
1179 under the top-level directory. In other words, even if you're only
1180 building @samp{gnats}, the top-level Makefile will look for, and try to
1181 build, @file{gdb} and @file{dejagnu} subdirectories, among many others.
1183 The result is that if you try @samp{make -n install
1184 prefix=/usr/local/stow/@var{package}} at the top level of a Cygnus
1185 package, you'll get a bewildering amount of output. It will then be
1186 very difficult to visually scan the output to see whether the install
1187 will proceed correctly. Unfortunately, it's not always clear how to
1188 invoke an install from the subdirectory of interest.
1190 In cases like this, the best approach is to run your @samp{make install
1191 prefix=@r{@dots{}}}, but be ready to interrupt it if you detect that it
1192 is recompiling files. Usually it will work just fine; otherwise,
1195 @c ---------------------------------------------------------------------------
1196 @node Perl and Perl 5 Modules, , Cygnus Software, Compile-time vs. Install-time
1197 @section Perl and Perl 5 Modules
1199 Perl 4.036 allows you to specify different locations for installation
1200 and for run-time. It is the only widely-used package in this author's
1201 experience that allows this, though hopefully more packages will adopt
1204 Unfortunately, the authors of Perl believed that only AFS sites need
1205 this ability. The configuration instructions for Perl 4 misleadingly
1206 state that some occult means are used under AFS to transport files from
1207 their installation tree to their run-time tree. In fact, that confusion
1208 arises from the fact that Depot, Stow's predecessor, originated at
1209 Carnegie Mellon University, which was also the birthplace of AFS. CMU's
1210 need to separate install-time and run-time trees stemmed from its use of
1211 Depot, not from AFS.
1213 The result of this confusion is that Perl 5's configuration script
1214 doesn't even offer the option of separating install-time and run-time
1215 trees @emph{unless} you're running AFS. Fortunately, after you've
1216 entered all the configuration settings, Perl's setup script gives you
1217 the opportunity to edit those settings in a file called
1218 @file{config.sh}. When prompted, you should edit this file and replace
1222 inst@r{@dots{}}/usr/local@r{@dots{}}
1229 inst@r{@dots{}}/usr/local/stow/perl@r{@dots{}}
1233 You can do this with the following Unix command:
1236 sed 's,^\(inst.*/usr/local\),\1/stow/perl,' config.sh > config.sh.new
1237 mv config.sh.new config.sh
1240 Hopefully, the Perl authors will correct this deficiency in Perl 5's
1241 configuration mechanism.
1243 Perl 5 modules---i.e., extensions to Perl 5---generally conform to a set
1244 of standards for building and installing them. The standard says that
1245 the package comes with a top-level @file{Makefile.PL}, which is a Perl
1246 script. When it runs, it generates a @file{Makefile}.
1248 If you followed the instructions above for editing @file{config.sh} when
1249 Perl was built, then when you create a @file{Makefile} from a
1250 @file{Makefile.PL}, it will contain separate locations for run-time
1251 (@file{/usr/local}) and install-time (@file{/usr/local/stow/perl}).
1261 and the files will be installed into @file{/usr/local/stow/perl}.
1262 However, you might prefer each Perl module to be stowed separately. In
1263 that case, you must edit the resulting Makefile, replacing
1264 @file{/usr/local/stow/perl} with @file{/usr/local/stow/@var{module}}.
1265 The best way to do this is:
1269 find . -name Makefile -print | \
1270 xargs perl -pi~ -e 's,^(INST.*/stow)/perl,$1/@var{module},;'
1276 (The use of @samp{find} and @samp{xargs} ensures that all Makefiles in
1277 the module's source tree, even those in subdirectories, get edited.) A
1278 good convention to follow is to name the stow directory for a Perl
1279 @var{module} @file{cpan.@var{module}}, where @samp{cpan} stands for
1280 Comprehensive Perl Archive Network, a collection of FTP sites that is
1281 the source of most Perl 5 extensions. This way, it's easy to tell at a
1282 glance which of the subdirectories of @file{/usr/local/stow} are Perl 5
1285 When you stow separate Perl 5 modules separately, you are likely to
1286 encounter conflicts (@pxref{Conflicts}) with files named @file{.exists}
1287 and @file{perllocal.pod}. One way to work around this is to remove
1288 those files before stowing the module. If you use the
1289 @file{cpan.@var{module}} naming convention, you can simply do this:
1293 find cpan.* \( -name .exists -o -name perllocal.pod \) -print | \
1298 @c ---------------------------------------------------------------------------
1299 @node Bootstrapping, Reporting Bugs, Compile-time vs. Install-time, Top
1300 @chapter Bootstrapping
1302 Suppose you have a stow directory all set up and ready to go:
1303 @file{/usr/local/stow/perl} contains the Perl installation,
1304 @file{/usr/local/stow/stow} contains Stow itself, and perhaps you have
1305 other packages waiting to be stowed. You'd like to be able to do this:
1313 but @command{stow} is not yet in your @env{PATH}. Nor can you do this:
1321 because the @samp{#!} line at the beginning of @command{stow} tries to
1322 locate Perl (usually in @file{/usr/local/bin/perl}), and that won't be
1323 found. The solution you must use is:
1327 perl/bin/perl stow/bin/stow -vv *
1330 @c ===========================================================================
1331 @node Reporting Bugs, Known Bugs, Bootstrapping, Top
1332 @chapter Reporting Bugs
1334 You can report bugs to the current maintainers in one of three ways:
1338 Send e-mail to @email{bug-stow@@gnu.org}.
1341 File an issue in @uref{https://savannah.gnu.org/bugs/?group=stow,
1342 the Savannah bug tracker}.
1346 @uref{https://github.com/aspiers/stow/issues/, the GitHub project}.
1349 While GitHub is arguably the most convenient of these three options, it
1350 @uref{https://www.gnu.org/software/repo-criteria-evaluation.html#GitHub,
1351 is not the most ethical or freedom-preserving way to host software
1352 projects}. Therefore the GitHub project may be
1353 @uref{https://github.com/aspiers/stow/issues/43, moved to a more ethical
1354 hosting service} in the future.
1356 Before reporting a bug, it is recommended to check whether it is already
1357 known, so please first @pxref{Known Bugs}.
1359 When reporting a new bug, please include:
1363 the version number of Stow (@samp{stow --version});
1366 the version number of Perl (@samp{perl -v});
1369 the system information, which can often be obtained with @samp{uname
1373 a description of the bug;
1376 the precise command you gave;
1379 the output from the command (preferably verbose output, obtained by
1380 adding @samp{--verbose=5} to the Stow command line).
1383 If you are really keen, consider developing a minimal test case and
1384 creating a new test. See the @file{t/} directory in the source for lots
1385 of examples, and the @file{CONTRIBUTING.md} file for a guide on how to
1388 Before reporting a bug, please read the manual carefully, especially
1389 @ref{Known Bugs}, to see whether you're encountering
1390 something that doesn't need reporting.
1391 (@pxref{Conflicts}).
1393 @c ===========================================================================
1394 @node Known Bugs, GNU General Public License, Reporting Bugs, Top
1397 Known bugs can be found in the following locations:
1401 @uref{https://github.com/aspiers/stow/issues/, the GitHub issue tracker}
1404 @uref{https://savannah.gnu.org/bugs/?group=stow, the Savannah bug
1408 the @uref{https://lists.gnu.org/archive/html/bug-stow/, bug-stow list
1412 If you think you have found a new bug, please @pxref{Reporting Bugs}.
1414 @c ===========================================================================
1415 @node GNU General Public License, Index, Known Bugs, Top
1416 @unnumbered GNU General Public License
1418 @center Version 3, 29 June 2007
1420 @c This file is intended to be included within another document,
1421 @c hence no sectioning command or @node.
1424 Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{https://fsf.org/}
1426 Everyone is permitted to copy and distribute verbatim copies of this
1427 license document, but changing it is not allowed.
1432 The GNU General Public License is a free, copyleft license for
1433 software and other kinds of works.
1435 The licenses for most software and other practical works are designed
1436 to take away your freedom to share and change the works. By contrast,
1437 the GNU General Public License is intended to guarantee your freedom
1438 to share and change all versions of a program---to make sure it remains
1439 free software for all its users. We, the Free Software Foundation,
1440 use the GNU General Public License for most of our software; it
1441 applies also to any other work released this way by its authors. You
1442 can apply it to your programs, too.
1444 When we speak of free software, we are referring to freedom, not
1445 price. Our General Public Licenses are designed to make sure that you
1446 have the freedom to distribute copies of free software (and charge for
1447 them if you wish), that you receive source code or can get it if you
1448 want it, that you can change the software or use pieces of it in new
1449 free programs, and that you know you can do these things.
1451 To protect your rights, we need to prevent others from denying you
1452 these rights or asking you to surrender the rights. Therefore, you
1453 have certain responsibilities if you distribute copies of the
1454 software, or if you modify it: responsibilities to respect the freedom
1457 For example, if you distribute copies of such a program, whether
1458 gratis or for a fee, you must pass on to the recipients the same
1459 freedoms that you received. You must make sure that they, too,
1460 receive or can get the source code. And you must show them these
1461 terms so they know their rights.
1463 Developers that use the GNU GPL protect your rights with two steps:
1464 (1) assert copyright on the software, and (2) offer you this License
1465 giving you legal permission to copy, distribute and/or modify it.
1467 For the developers' and authors' protection, the GPL clearly explains
1468 that there is no warranty for this free software. For both users' and
1469 authors' sake, the GPL requires that modified versions be marked as
1470 changed, so that their problems will not be attributed erroneously to
1471 authors of previous versions.
1473 Some devices are designed to deny users access to install or run
1474 modified versions of the software inside them, although the
1475 manufacturer can do so. This is fundamentally incompatible with the
1476 aim of protecting users' freedom to change the software. The
1477 systematic pattern of such abuse occurs in the area of products for
1478 individuals to use, which is precisely where it is most unacceptable.
1479 Therefore, we have designed this version of the GPL to prohibit the
1480 practice for those products. If such problems arise substantially in
1481 other domains, we stand ready to extend this provision to those
1482 domains in future versions of the GPL, as needed to protect the
1485 Finally, every program is threatened constantly by software patents.
1486 States should not allow patents to restrict development and use of
1487 software on general-purpose computers, but in those that do, we wish
1488 to avoid the special danger that patents applied to a free program
1489 could make it effectively proprietary. To prevent this, the GPL
1490 assures that patents cannot be used to render the program non-free.
1492 The precise terms and conditions for copying, distribution and
1493 modification follow.
1495 @heading TERMS AND CONDITIONS
1500 ``This License'' refers to version 3 of the GNU General Public License.
1502 ``Copyright'' also means copyright-like laws that apply to other kinds
1503 of works, such as semiconductor masks.
1505 ``The Program'' refers to any copyrightable work licensed under this
1506 License. Each licensee is addressed as ``you''. ``Licensees'' and
1507 ``recipients'' may be individuals or organizations.
1509 To ``modify'' a work means to copy from or adapt all or part of the work
1510 in a fashion requiring copyright permission, other than the making of
1511 an exact copy. The resulting work is called a ``modified version'' of
1512 the earlier work or a work ``based on'' the earlier work.
1514 A ``covered work'' means either the unmodified Program or a work based
1517 To ``propagate'' a work means to do anything with it that, without
1518 permission, would make you directly or secondarily liable for
1519 infringement under applicable copyright law, except executing it on a
1520 computer or modifying a private copy. Propagation includes copying,
1521 distribution (with or without modification), making available to the
1522 public, and in some countries other activities as well.
1524 To ``convey'' a work means any kind of propagation that enables other
1525 parties to make or receive copies. Mere interaction with a user
1526 through a computer network, with no transfer of a copy, is not
1529 An interactive user interface displays ``Appropriate Legal Notices'' to
1530 the extent that it includes a convenient and prominently visible
1531 feature that (1) displays an appropriate copyright notice, and (2)
1532 tells the user that there is no warranty for the work (except to the
1533 extent that warranties are provided), that licensees may convey the
1534 work under this License, and how to view a copy of this License. If
1535 the interface presents a list of user commands or options, such as a
1536 menu, a prominent item in the list meets this criterion.
1540 The ``source code'' for a work means the preferred form of the work for
1541 making modifications to it. ``Object code'' means any non-source form
1544 A ``Standard Interface'' means an interface that either is an official
1545 standard defined by a recognized standards body, or, in the case of
1546 interfaces specified for a particular programming language, one that
1547 is widely used among developers working in that language.
1549 The ``System Libraries'' of an executable work include anything, other
1550 than the work as a whole, that (a) is included in the normal form of
1551 packaging a Major Component, but which is not part of that Major
1552 Component, and (b) serves only to enable use of the work with that
1553 Major Component, or to implement a Standard Interface for which an
1554 implementation is available to the public in source code form. A
1555 ``Major Component'', in this context, means a major essential component
1556 (kernel, window system, and so on) of the specific operating system
1557 (if any) on which the executable work runs, or a compiler used to
1558 produce the work, or an object code interpreter used to run it.
1560 The ``Corresponding Source'' for a work in object code form means all
1561 the source code needed to generate, install, and (for an executable
1562 work) run the object code and to modify the work, including scripts to
1563 control those activities. However, it does not include the work's
1564 System Libraries, or general-purpose tools or generally available free
1565 programs which are used unmodified in performing those activities but
1566 which are not part of the work. For example, Corresponding Source
1567 includes interface definition files associated with source files for
1568 the work, and the source code for shared libraries and dynamically
1569 linked subprograms that the work is specifically designed to require,
1570 such as by intimate data communication or control flow between those
1571 subprograms and other parts of the work.
1573 The Corresponding Source need not include anything that users can
1574 regenerate automatically from other parts of the Corresponding Source.
1576 The Corresponding Source for a work in source code form is that same
1579 @item Basic Permissions.
1581 All rights granted under this License are granted for the term of
1582 copyright on the Program, and are irrevocable provided the stated
1583 conditions are met. This License explicitly affirms your unlimited
1584 permission to run the unmodified Program. The output from running a
1585 covered work is covered by this License only if the output, given its
1586 content, constitutes a covered work. This License acknowledges your
1587 rights of fair use or other equivalent, as provided by copyright law.
1589 You may make, run and propagate covered works that you do not convey,
1590 without conditions so long as your license otherwise remains in force.
1591 You may convey covered works to others for the sole purpose of having
1592 them make modifications exclusively for you, or provide you with
1593 facilities for running those works, provided that you comply with the
1594 terms of this License in conveying all material for which you do not
1595 control copyright. Those thus making or running the covered works for
1596 you must do so exclusively on your behalf, under your direction and
1597 control, on terms that prohibit them from making any copies of your
1598 copyrighted material outside their relationship with you.
1600 Conveying under any other circumstances is permitted solely under the
1601 conditions stated below. Sublicensing is not allowed; section 10
1602 makes it unnecessary.
1604 @item Protecting Users' Legal Rights From Anti-Circumvention Law.
1606 No covered work shall be deemed part of an effective technological
1607 measure under any applicable law fulfilling obligations under article
1608 11 of the WIPO copyright treaty adopted on 20 December 1996, or
1609 similar laws prohibiting or restricting circumvention of such
1612 When you convey a covered work, you waive any legal power to forbid
1613 circumvention of technological measures to the extent such
1614 circumvention is effected by exercising rights under this License with
1615 respect to the covered work, and you disclaim any intention to limit
1616 operation or modification of the work as a means of enforcing, against
1617 the work's users, your or third parties' legal rights to forbid
1618 circumvention of technological measures.
1620 @item Conveying Verbatim Copies.
1622 You may convey verbatim copies of the Program's source code as you
1623 receive it, in any medium, provided that you conspicuously and
1624 appropriately publish on each copy an appropriate copyright notice;
1625 keep intact all notices stating that this License and any
1626 non-permissive terms added in accord with section 7 apply to the code;
1627 keep intact all notices of the absence of any warranty; and give all
1628 recipients a copy of this License along with the Program.
1630 You may charge any price or no price for each copy that you convey,
1631 and you may offer support or warranty protection for a fee.
1633 @item Conveying Modified Source Versions.
1635 You may convey a work based on the Program, or the modifications to
1636 produce it from the Program, in the form of source code under the
1637 terms of section 4, provided that you also meet all of these
1642 The work must carry prominent notices stating that you modified it,
1643 and giving a relevant date.
1646 The work must carry prominent notices stating that it is released
1647 under this License and any conditions added under section 7. This
1648 requirement modifies the requirement in section 4 to ``keep intact all
1652 You must license the entire work, as a whole, under this License to
1653 anyone who comes into possession of a copy. This License will
1654 therefore apply, along with any applicable section 7 additional terms,
1655 to the whole of the work, and all its parts, regardless of how they
1656 are packaged. This License gives no permission to license the work in
1657 any other way, but it does not invalidate such permission if you have
1658 separately received it.
1661 If the work has interactive user interfaces, each must display
1662 Appropriate Legal Notices; however, if the Program has interactive
1663 interfaces that do not display Appropriate Legal Notices, your work
1664 need not make them do so.
1667 A compilation of a covered work with other separate and independent
1668 works, which are not by their nature extensions of the covered work,
1669 and which are not combined with it such as to form a larger program,
1670 in or on a volume of a storage or distribution medium, is called an
1671 ``aggregate'' if the compilation and its resulting copyright are not
1672 used to limit the access or legal rights of the compilation's users
1673 beyond what the individual works permit. Inclusion of a covered work
1674 in an aggregate does not cause this License to apply to the other
1675 parts of the aggregate.
1677 @item Conveying Non-Source Forms.
1679 You may convey a covered work in object code form under the terms of
1680 sections 4 and 5, provided that you also convey the machine-readable
1681 Corresponding Source under the terms of this License, in one of these
1686 Convey the object code in, or embodied in, a physical product
1687 (including a physical distribution medium), accompanied by the
1688 Corresponding Source fixed on a durable physical medium customarily
1689 used for software interchange.
1692 Convey the object code in, or embodied in, a physical product
1693 (including a physical distribution medium), accompanied by a written
1694 offer, valid for at least three years and valid for as long as you
1695 offer spare parts or customer support for that product model, to give
1696 anyone who possesses the object code either (1) a copy of the
1697 Corresponding Source for all the software in the product that is
1698 covered by this License, on a durable physical medium customarily used
1699 for software interchange, for a price no more than your reasonable
1700 cost of physically performing this conveying of source, or (2) access
1701 to copy the Corresponding Source from a network server at no charge.
1704 Convey individual copies of the object code with a copy of the written
1705 offer to provide the Corresponding Source. This alternative is
1706 allowed only occasionally and noncommercially, and only if you
1707 received the object code with such an offer, in accord with subsection
1711 Convey the object code by offering access from a designated place
1712 (gratis or for a charge), and offer equivalent access to the
1713 Corresponding Source in the same way through the same place at no
1714 further charge. You need not require recipients to copy the
1715 Corresponding Source along with the object code. If the place to copy
1716 the object code is a network server, the Corresponding Source may be
1717 on a different server (operated by you or a third party) that supports
1718 equivalent copying facilities, provided you maintain clear directions
1719 next to the object code saying where to find the Corresponding Source.
1720 Regardless of what server hosts the Corresponding Source, you remain
1721 obligated to ensure that it is available for as long as needed to
1722 satisfy these requirements.
1725 Convey the object code using peer-to-peer transmission, provided you
1726 inform other peers where the object code and Corresponding Source of
1727 the work are being offered to the general public at no charge under
1732 A separable portion of the object code, whose source code is excluded
1733 from the Corresponding Source as a System Library, need not be
1734 included in conveying the object code work.
1736 A ``User Product'' is either (1) a ``consumer product'', which means any
1737 tangible personal property which is normally used for personal,
1738 family, or household purposes, or (2) anything designed or sold for
1739 incorporation into a dwelling. In determining whether a product is a
1740 consumer product, doubtful cases shall be resolved in favor of
1741 coverage. For a particular product received by a particular user,
1742 ``normally used'' refers to a typical or common use of that class of
1743 product, regardless of the status of the particular user or of the way
1744 in which the particular user actually uses, or expects or is expected
1745 to use, the product. A product is a consumer product regardless of
1746 whether the product has substantial commercial, industrial or
1747 non-consumer uses, unless such uses represent the only significant
1748 mode of use of the product.
1750 ``Installation Information'' for a User Product means any methods,
1751 procedures, authorization keys, or other information required to
1752 install and execute modified versions of a covered work in that User
1753 Product from a modified version of its Corresponding Source. The
1754 information must suffice to ensure that the continued functioning of
1755 the modified object code is in no case prevented or interfered with
1756 solely because modification has been made.
1758 If you convey an object code work under this section in, or with, or
1759 specifically for use in, a User Product, and the conveying occurs as
1760 part of a transaction in which the right of possession and use of the
1761 User Product is transferred to the recipient in perpetuity or for a
1762 fixed term (regardless of how the transaction is characterized), the
1763 Corresponding Source conveyed under this section must be accompanied
1764 by the Installation Information. But this requirement does not apply
1765 if neither you nor any third party retains the ability to install
1766 modified object code on the User Product (for example, the work has
1767 been installed in ROM).
1769 The requirement to provide Installation Information does not include a
1770 requirement to continue to provide support service, warranty, or
1771 updates for a work that has been modified or installed by the
1772 recipient, or for the User Product in which it has been modified or
1773 installed. Access to a network may be denied when the modification
1774 itself materially and adversely affects the operation of the network
1775 or violates the rules and protocols for communication across the
1778 Corresponding Source conveyed, and Installation Information provided,
1779 in accord with this section must be in a format that is publicly
1780 documented (and with an implementation available to the public in
1781 source code form), and must require no special password or key for
1782 unpacking, reading or copying.
1784 @item Additional Terms.
1786 ``Additional permissions'' are terms that supplement the terms of this
1787 License by making exceptions from one or more of its conditions.
1788 Additional permissions that are applicable to the entire Program shall
1789 be treated as though they were included in this License, to the extent
1790 that they are valid under applicable law. If additional permissions
1791 apply only to part of the Program, that part may be used separately
1792 under those permissions, but the entire Program remains governed by
1793 this License without regard to the additional permissions.
1795 When you convey a copy of a covered work, you may at your option
1796 remove any additional permissions from that copy, or from any part of
1797 it. (Additional permissions may be written to require their own
1798 removal in certain cases when you modify the work.) You may place
1799 additional permissions on material, added by you to a covered work,
1800 for which you have or can give appropriate copyright permission.
1802 Notwithstanding any other provision of this License, for material you
1803 add to a covered work, you may (if authorized by the copyright holders
1804 of that material) supplement the terms of this License with terms:
1808 Disclaiming warranty or limiting liability differently from the terms
1809 of sections 15 and 16 of this License; or
1812 Requiring preservation of specified reasonable legal notices or author
1813 attributions in that material or in the Appropriate Legal Notices
1814 displayed by works containing it; or
1817 Prohibiting misrepresentation of the origin of that material, or
1818 requiring that modified versions of such material be marked in
1819 reasonable ways as different from the original version; or
1822 Limiting the use for publicity purposes of names of licensors or
1823 authors of the material; or
1826 Declining to grant rights under trademark law for use of some trade
1827 names, trademarks, or service marks; or
1830 Requiring indemnification of licensors and authors of that material by
1831 anyone who conveys the material (or modified versions of it) with
1832 contractual assumptions of liability to the recipient, for any
1833 liability that these contractual assumptions directly impose on those
1834 licensors and authors.
1837 All other non-permissive additional terms are considered ``further
1838 restrictions'' within the meaning of section 10. If the Program as you
1839 received it, or any part of it, contains a notice stating that it is
1840 governed by this License along with a term that is a further
1841 restriction, you may remove that term. If a license document contains
1842 a further restriction but permits relicensing or conveying under this
1843 License, you may add to a covered work material governed by the terms
1844 of that license document, provided that the further restriction does
1845 not survive such relicensing or conveying.
1847 If you add terms to a covered work in accord with this section, you
1848 must place, in the relevant source files, a statement of the
1849 additional terms that apply to those files, or a notice indicating
1850 where to find the applicable terms.
1852 Additional terms, permissive or non-permissive, may be stated in the
1853 form of a separately written license, or stated as exceptions; the
1854 above requirements apply either way.
1858 You may not propagate or modify a covered work except as expressly
1859 provided under this License. Any attempt otherwise to propagate or
1860 modify it is void, and will automatically terminate your rights under
1861 this License (including any patent licenses granted under the third
1862 paragraph of section 11).
1864 However, if you cease all violation of this License, then your license
1865 from a particular copyright holder is reinstated (a) provisionally,
1866 unless and until the copyright holder explicitly and finally
1867 terminates your license, and (b) permanently, if the copyright holder
1868 fails to notify you of the violation by some reasonable means prior to
1869 60 days after the cessation.
1871 Moreover, your license from a particular copyright holder is
1872 reinstated permanently if the copyright holder notifies you of the
1873 violation by some reasonable means, this is the first time you have
1874 received notice of violation of this License (for any work) from that
1875 copyright holder, and you cure the violation prior to 30 days after
1876 your receipt of the notice.
1878 Termination of your rights under this section does not terminate the
1879 licenses of parties who have received copies or rights from you under
1880 this License. If your rights have been terminated and not permanently
1881 reinstated, you do not qualify to receive new licenses for the same
1882 material under section 10.
1884 @item Acceptance Not Required for Having Copies.
1886 You are not required to accept this License in order to receive or run
1887 a copy of the Program. Ancillary propagation of a covered work
1888 occurring solely as a consequence of using peer-to-peer transmission
1889 to receive a copy likewise does not require acceptance. However,
1890 nothing other than this License grants you permission to propagate or
1891 modify any covered work. These actions infringe copyright if you do
1892 not accept this License. Therefore, by modifying or propagating a
1893 covered work, you indicate your acceptance of this License to do so.
1895 @item Automatic Licensing of Downstream Recipients.
1897 Each time you convey a covered work, the recipient automatically
1898 receives a license from the original licensors, to run, modify and
1899 propagate that work, subject to this License. You are not responsible
1900 for enforcing compliance by third parties with this License.
1902 An ``entity transaction'' is a transaction transferring control of an
1903 organization, or substantially all assets of one, or subdividing an
1904 organization, or merging organizations. If propagation of a covered
1905 work results from an entity transaction, each party to that
1906 transaction who receives a copy of the work also receives whatever
1907 licenses to the work the party's predecessor in interest had or could
1908 give under the previous paragraph, plus a right to possession of the
1909 Corresponding Source of the work from the predecessor in interest, if
1910 the predecessor has it or can get it with reasonable efforts.
1912 You may not impose any further restrictions on the exercise of the
1913 rights granted or affirmed under this License. For example, you may
1914 not impose a license fee, royalty, or other charge for exercise of
1915 rights granted under this License, and you may not initiate litigation
1916 (including a cross-claim or counterclaim in a lawsuit) alleging that
1917 any patent claim is infringed by making, using, selling, offering for
1918 sale, or importing the Program or any portion of it.
1922 A ``contributor'' is a copyright holder who authorizes use under this
1923 License of the Program or a work on which the Program is based. The
1924 work thus licensed is called the contributor's ``contributor version''.
1926 A contributor's ``essential patent claims'' are all patent claims owned
1927 or controlled by the contributor, whether already acquired or
1928 hereafter acquired, that would be infringed by some manner, permitted
1929 by this License, of making, using, or selling its contributor version,
1930 but do not include claims that would be infringed only as a
1931 consequence of further modification of the contributor version. For
1932 purposes of this definition, ``control'' includes the right to grant
1933 patent sublicenses in a manner consistent with the requirements of
1936 Each contributor grants you a non-exclusive, worldwide, royalty-free
1937 patent license under the contributor's essential patent claims, to
1938 make, use, sell, offer for sale, import and otherwise run, modify and
1939 propagate the contents of its contributor version.
1941 In the following three paragraphs, a ``patent license'' is any express
1942 agreement or commitment, however denominated, not to enforce a patent
1943 (such as an express permission to practice a patent or covenant not to
1944 sue for patent infringement). To ``grant'' such a patent license to a
1945 party means to make such an agreement or commitment not to enforce a
1946 patent against the party.
1948 If you convey a covered work, knowingly relying on a patent license,
1949 and the Corresponding Source of the work is not available for anyone
1950 to copy, free of charge and under the terms of this License, through a
1951 publicly available network server or other readily accessible means,
1952 then you must either (1) cause the Corresponding Source to be so
1953 available, or (2) arrange to deprive yourself of the benefit of the
1954 patent license for this particular work, or (3) arrange, in a manner
1955 consistent with the requirements of this License, to extend the patent
1956 license to downstream recipients. ``Knowingly relying'' means you have
1957 actual knowledge that, but for the patent license, your conveying the
1958 covered work in a country, or your recipient's use of the covered work
1959 in a country, would infringe one or more identifiable patents in that
1960 country that you have reason to believe are valid.
1962 If, pursuant to or in connection with a single transaction or
1963 arrangement, you convey, or propagate by procuring conveyance of, a
1964 covered work, and grant a patent license to some of the parties
1965 receiving the covered work authorizing them to use, propagate, modify
1966 or convey a specific copy of the covered work, then the patent license
1967 you grant is automatically extended to all recipients of the covered
1968 work and works based on it.
1970 A patent license is ``discriminatory'' if it does not include within the
1971 scope of its coverage, prohibits the exercise of, or is conditioned on
1972 the non-exercise of one or more of the rights that are specifically
1973 granted under this License. You may not convey a covered work if you
1974 are a party to an arrangement with a third party that is in the
1975 business of distributing software, under which you make payment to the
1976 third party based on the extent of your activity of conveying the
1977 work, and under which the third party grants, to any of the parties
1978 who would receive the covered work from you, a discriminatory patent
1979 license (a) in connection with copies of the covered work conveyed by
1980 you (or copies made from those copies), or (b) primarily for and in
1981 connection with specific products or compilations that contain the
1982 covered work, unless you entered into that arrangement, or that patent
1983 license was granted, prior to 28 March 2007.
1985 Nothing in this License shall be construed as excluding or limiting
1986 any implied license or other defenses to infringement that may
1987 otherwise be available to you under applicable patent law.
1989 @item No Surrender of Others' Freedom.
1991 If conditions are imposed on you (whether by court order, agreement or
1992 otherwise) that contradict the conditions of this License, they do not
1993 excuse you from the conditions of this License. If you cannot convey
1994 a covered work so as to satisfy simultaneously your obligations under
1995 this License and any other pertinent obligations, then as a
1996 consequence you may not convey it at all. For example, if you agree
1997 to terms that obligate you to collect a royalty for further conveying
1998 from those to whom you convey the Program, the only way you could
1999 satisfy both those terms and this License would be to refrain entirely
2000 from conveying the Program.
2002 @item Use with the GNU Affero General Public License.
2004 Notwithstanding any other provision of this License, you have
2005 permission to link or combine any covered work with a work licensed
2006 under version 3 of the GNU Affero General Public License into a single
2007 combined work, and to convey the resulting work. The terms of this
2008 License will continue to apply to the part which is the covered work,
2009 but the special requirements of the GNU Affero General Public License,
2010 section 13, concerning interaction through a network will apply to the
2011 combination as such.
2013 @item Revised Versions of this License.
2015 The Free Software Foundation may publish revised and/or new versions
2016 of the GNU General Public License from time to time. Such new
2017 versions will be similar in spirit to the present version, but may
2018 differ in detail to address new problems or concerns.
2020 Each version is given a distinguishing version number. If the Program
2021 specifies that a certain numbered version of the GNU General Public
2022 License ``or any later version'' applies to it, you have the option of
2023 following the terms and conditions either of that numbered version or
2024 of any later version published by the Free Software Foundation. If
2025 the Program does not specify a version number of the GNU General
2026 Public License, you may choose any version ever published by the Free
2027 Software Foundation.
2029 If the Program specifies that a proxy can decide which future versions
2030 of the GNU General Public License can be used, that proxy's public
2031 statement of acceptance of a version permanently authorizes you to
2032 choose that version for the Program.
2034 Later license versions may give you additional or different
2035 permissions. However, no additional obligations are imposed on any
2036 author or copyright holder as a result of your choosing to follow a
2039 @item Disclaimer of Warranty.
2041 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
2042 APPLICABLE LAW@. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
2043 HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT
2044 WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
2045 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2046 A PARTICULAR PURPOSE@. THE ENTIRE RISK AS TO THE QUALITY AND
2047 PERFORMANCE OF THE PROGRAM IS WITH YOU@. SHOULD THE PROGRAM PROVE
2048 DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
2051 @item Limitation of Liability.
2053 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
2054 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
2055 CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
2056 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
2057 ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
2058 NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
2059 LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
2060 TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
2061 PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
2063 @item Interpretation of Sections 15 and 16.
2065 If the disclaimer of warranty and limitation of liability provided
2066 above cannot be given local legal effect according to their terms,
2067 reviewing courts shall apply local law that most closely approximates
2068 an absolute waiver of all civil liability in connection with the
2069 Program, unless a warranty or assumption of liability accompanies a
2070 copy of the Program in return for a fee.
2074 @heading END OF TERMS AND CONDITIONS
2076 @heading How to Apply These Terms to Your New Programs
2078 If you develop a new program, and you want it to be of the greatest
2079 possible use to the public, the best way to achieve this is to make it
2080 free software which everyone can redistribute and change under these
2083 To do so, attach the following notices to the program. It is safest
2084 to attach them to the start of each source file to most effectively
2085 state the exclusion of warranty; and each file should have at least
2086 the ``copyright'' line and a pointer to where the full notice is found.
2089 @var{one line to give the program's name and a brief idea of what it does.}
2090 Copyright (C) @var{year} @var{name of author}
2092 This program is free software: you can redistribute it and/or modify
2093 it under the terms of the GNU General Public License as published by
2094 the Free Software Foundation, either version 3 of the License, or (at
2095 your option) any later version.
2097 This program is distributed in the hope that it will be useful, but
2098 WITHOUT ANY WARRANTY; without even the implied warranty of
2099 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE@. See the GNU
2100 General Public License for more details.
2102 You should have received a copy of the GNU General Public License
2103 along with this program. If not, see @url{https://www.gnu.org/licenses/}.
2106 Also add information on how to contact you by electronic and paper mail.
2108 If the program does terminal interaction, make it output a short
2109 notice like this when it starts in an interactive mode:
2112 @var{program} Copyright (C) @var{year} @var{name of author}
2113 This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}.
2114 This is free software, and you are welcome to redistribute it
2115 under certain conditions; type @samp{show c} for details.
2118 The hypothetical commands @samp{show w} and @samp{show c} should show
2119 the appropriate parts of the General Public License. Of course, your
2120 program's commands might be different; for a GUI interface, you would
2121 use an ``about box''.
2123 You should also get your employer (if you work as a programmer) or school,
2124 if any, to sign a ``copyright disclaimer'' for the program, if necessary.
2125 For more information on this, and how to apply and follow the GNU GPL, see
2126 @url{https://www.gnu.org/licenses/}.
2128 The GNU General Public License does not permit incorporating your
2129 program into proprietary programs. If your program is a subroutine
2130 library, you may consider it more useful to permit linking proprietary
2131 applications with the library. If this is what you want to do, use
2132 the GNU Lesser General Public License instead of this License. But
2133 first, please read @url{https://www.gnu.org/licenses/why-not-lgpl.html}.
2135 @node Index, , GNU General Public License, Top