-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setting CPAN_OPTS environment variable fails #131
Comments
>>>> On Thu, 02 Jan 2020 07:53:35 -0800, stuart-little ***@***.***> said:
I'm running:
${HOME}/perl5/bin/cpan version 1.64 calling Getopt::Std::getopts (version 1.12 [paranoid]),
running under Perl version 5.28.1.
It might be that you have to upgrade, I don't know. 1.675 is current.
Upgrading would be done with:
$ cpan
[...]
cpan shell -- CPAN exploration and modules installation (v2.27)
[...]
cpan[1]> upgrade App::Cpan
I have been trying to run installs without testing by setting the
CPAN_OPTS environment variable as documented, e.g. here (as well as in
the cpan manpages on all of my machines). The problem is that the
contents of that variable seem to be appended rather than prepended to
the rest of my arguments.
The -T option is documented and I can confirm, it indeed seems to work.
Note: I have not written the code, so I'm rather trying out what the
manpage suggests. See below.
The three commands
cpan CPAN -T
CPAN_OPTS="-T" cpan CPAN
export CPAN_OPTS="-T" && cpan CPAN
The manpage has these two lines:
# with switches, installs modules with extra behavior
cpan [-cfFimtTw] module_name [ module_name ... ]
So I tried this:
cpan -T DateTimeX::Web
and it worked as advertized. Can you please do likewise?
have exactly the same effect:
Loading internal logger. Log::Log4perl recommended for better logging
Reading '${HOME}/.cpan/Metadata'
Database was generated on Thu, 02 Jan 2020 14:41:03 GMT
CPAN is up to date (2.27).
> (error): Could not expand [-T]. Check the module name.
> (info): I can suggest names if you install one of Text::Levenshtein::XS, Text::Levenshtein::Damerau::XS, Text::Levenshtein, and Text::Levenshtein::Damerau::PP
> (info): and you provide the -x option on invocation.
> (error): Skipping -T because I couldn't find a matching namespace.
It is maybe not worthwhile to understand why these incantations
malfunction as you describe. Maybe the manpage needs a sentence or two
about the correct incantation. Let me know if you have an idea what
could have helped you?
Greetings,
--
andreas
|
@andk: I understand So again: the problem isn't with the I don't think there's much to understand: the problem is, as indicated in my edit to the original message, in the line
in |
Actually, that's literally the only change needed to make
and changed
to
Now everything works! The command In short, I would propose the following patch:
|
>>>> On Thu, 02 Jan 2020 09:32:40 -0800, stuart-little ***@***.***> said:
@andk: I understand cpan -T <package> works; it does for me too! The
problem is it doesn't work if the -T comes after the package name, and
that's exactly what setting CPAN_OPTS="-T" does.
OK, I'm sorry, that I misunderstood you. Thank you for correcting me.
Have you noticed, that there is no test in the t/ directory dealing with
CPAN_OPTS:
% git grep -i CPAN_OPTS t | wc -l
0
If no usage whatsoever of CPAN_OPTS works at the moment, we could also
scratch it, because that would mean that nobody has ever used it.
Do you think it has merit? Which would that be? And would you be willing
to derive tests for the test suite?
…--
andreas
|
I hadn't noticed that, no.
I have never written a test suite for anything (I only write perl for personal small utility scripts), so I wouldn't know where to begin. However, given that literally a one-word fix will patch this up and restore the functionality advertised by the man page, wouldn't that be the wiser course of action? After all, scratching the environment variable completely would require modifying documentation, leaving a number of related but different online sources out of date (e.g. here ), and so on. All of that seems more drastic than simply switching that |
Co-authored-by: chirvasitua <[email protected]>
I'm running:
I have been trying to run installs without testing by setting the
CPAN_OPTS
environment variable as documented, e.g. here (as well as in thecpan
manpages on all of my machines). The problem is that the contents of that variable seem to be appended rather than prepended to the rest of my arguments.The three commands
have exactly the same effect:
In retrospect, it should be easy to see why this would happen. In the cloned git repo:
That last line
push
es instead ofunshift
ing. But then how are any of these options supposed to work?The text was updated successfully, but these errors were encountered: