Package: stow
Version: 2.2.0-1
Severity: normal

I have a script that configures and builds a package and stows
the resulting binaries.  As a precaution against hypothetical
package names that start with a dash, it uses "--" like so:

( cd -- "${stowdir}" && stow --restow -- "${PKG_STOWNAME}" )

This used to work, but now when I try with stow 2.2.0-1, it fails:

| ( cd -- "/home/Kalle/prefix/stow" && stow --restow -- "emacs" )
| stow: No packages to stow or unstow
|
| stow (GNU Stow) version 2.2.0
|
| SYNOPSIS:
|
|     stow [OPTION ...] [-D|-S|-R] PACKAGE ... [-D|-S|-R] PACKAGE ...
|
| OPTIONS:
|
|     -d DIR, --dir=DIR     Set stow dir to DIR (default is current dir)
|     -t DIR, --target=DIR  Set target to DIR (default is parent of stow dir)
|
|     -S, --stow            Stow the package names that follow this option
|     -D, --delete          Unstow the package names that follow this option
|     -R, --restow          Restow (like stow -D followed by stow -S)
|
|     --ignore=REGEX        Ignore files ending in this Perl regex
|     --defer=REGEX         Don't stow files beginning with this Perl regex
|                           if the file is already stowed to another package
|     --override=REGEX      Force stowing files beginning with this Perl regex
|                           if the file is already stowed to another package
|     --adopt               (Use with care!)  Import existing files into stow 
package
|                           from target.  Please read docs before using.
|     -p, --compat          Use legacy algorithm for unstowing
|
|     -n, --no, --simulate  Do not actually make any filesystem changes
|     -v, --verbose[=N]     Increase verbosity (levels are 0,1,2,3;
|                             -v or --verbose adds 1; --verbose=N sets level)
|     -V, --version         Show stow version number
|     -h, --help            Show this help
|
| Report bugs to: bug-s...@gnu.org
| Stow home page: <http://www.gnu.org/software/stow/>
| General help using GNU software: <http://www.gnu.org/gethelp/>
| make[1]: *** [pkg-stow] Virhe 1

Without "--", it works OK.  However, I don't see in the above
command-line synopsis anything that would disallow inserting "--"
there.  "--" is supposed to treat all subsequent arguments as
non-options, and package names are not intended to be options,
so "--" should be fine.

I guess the problem is that Stow collects the package names from
the command line by giving a "Handler for non-option arguments"
to Getopt::Long::GetOptions, which stops reading arguments from
@ARGV when it sees "--".  Stow should follow the GetOptions call
with a loop that processes any remaining package names from @ARGV.

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=fi_FI.utf8, LC_CTYPE=fi_FI.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages stow depends on:
ii  dpkg          1.16.4.3
ii  install-info  4.13a.dfsg.1-10
ii  perl          5.14.2-12

stow recommends no packages.

Versions of packages stow suggests:
ii  doc-base  0.10.3

-- no debconf information

Attachment: pgpD5FxjWiLNP.pgp
Description: PGP signature

Reply via email to