I assume that /etc/perl is part of your @INC. If it's not, then you may have problem there. I don't understand why you configure cpan manually like that. If you run cpan as root for the first time, the CPAN/Config.pm file will be created automatically (for example in /usr/lib/perl5/5.8.8, but it depends on your local @INC setting) and you have a chance to configure it. Oh, now I think about it, you might want to write your own CPAN::Config to keep your default the same across systems so you don't have to run into manual and boring prompted-configuration process.

CPAN.pm seems to always complain whenever it finds that one or more config item is missing and then offers a reconfiguration. The problem is, you write the config items manually from the script (if I get you correctly). You say you set them all. But installed CPAN.pm may have newer config item(s) you haven't handled yet. I touch my CPAN/MyConfig.pm very rarely. Yet when I upgrade CPAN.pm (with significant change on the config items), it will tell me about missing/uninitialized configuration item(s). For me, it's not a problem. I take it as part of the upgrading process.

So I don't think that the complain is due to some magical cheking in CPAN.pm (I haven't looked at the source code thoroughly but I won't bother for this case). One suggestion if you want to keep your method is: run the cpan for the first time as root to create the initial CPAN/Config.pm. It should be guaranteed that it will contain the complete items the current CPAN.pm has. Open the newly created file, take all its items, and override the ones with your own values, and save it back. It shouldn't be hard to modify your script. Good luck!


Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!


In reply to Re: Configuring CPAN out of script does not work by naikonta
in thread Configuring CPAN out of script does not work by isync

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.