Loading ...
Sorry, an error occurred while loading the content.

Patch to handle command line configuration

Expand Messages
  • dpk
    Ive patched the SOAP::Lite distribution Makefile.PL to use Getopt::Long ( distributed with perl core ) to handle command line arguments. I ve been consistently
    Message 1 of 4 , Aug 20 5:47 PM
    • 0 Attachment
      Ive patched the SOAP::Lite distribution Makefile.PL to use Getopt::Long
      ( distributed with perl core ) to handle command line arguments. I've
      been consistently itched with the fact that I have to manually
      configure it every time, so this is my attempt at scratching ;)

      To apply the patch ( to SOAP-Lite-0.51 ):
      bash$> patch SOAP-Lite-0.51/Makefile.PL soap.patch

      Help Text:
      Usage: perl Makefile.PL <options>

      Possible Options are:

      --noprompt Disable interactive dialog
      --test Perform extra testing
      --help Display this help text

      --[no]install-MODULE [ Do Not ] Install appropriate module:
      --[no]install-SOAP-Transport-HTTP-Client
      --[no]install-SOAP-Transport-MAILTO-Client
      --[no]install-SOAP-Transport-FTP-Client
      --[no]install-SOAP-Transport-HTTP-Daemon
      --[no]install-SOAP-Transport-HTTP-Apache
      --[no]install-SOAP-Transport-HTTP-FCGI
      --[no]install-SOAP-Transport-POP3-Server
      --[no]install-SOAP-Transport-IO-Server
      --[no]install-SOAP-Transport-MQ
      --[no]install-SOAP-Transport-JABBER
      --[no]install-SOAP-MIMEParser
      --[no]install-SOAP-Transport-TCP
      --[no]install-SOAP-Transport-HTTP

      To Paul + anyone else who has hacked on the code in Makefile.PL:
      The strategy I took was to parse the prerequisites and take any module
      in parenthases on any line with a [yes]/[no] tag. These modules are
      then translated into --[no]install- options.
      The only problem with this is that the first two modules are both
      labelled as SOAP::Transport::HTTP::Client. As a workaround I just added
      a check to skip any line referencing OpenSSL. It might be cleaner to
      change the second to SOAP::Transport::HTTPS::Client, but I can see why
      that isnt too important.
      So, right now - there is no way to automagically get the config to
      check for OpenSSL without prompting. Doesnt really matter of course,
      because all the makefile is really doing is creating a PREREQ_PM hash,
      but a limitation nonetheless.

      Cheers,
      dpk

      __________________________________________________
      Do You Yahoo!?
      Make international calls for as low as $.04/minute with Yahoo! Messenger
      http://phonecard.yahoo.com/
    • Paul Kulchenko
      Hi, dpk! ... I was about to do the same thing, but much simpler ;). I applied your patch, just updated it a little bit. I also added HTTPS:: transport, so
      Message 2 of 4 , Aug 20 7:58 PM
      • 0 Attachment
        Hi, dpk!

        > been consistently itched with the fact that I have to manually
        > configure it every time, so this is my attempt at scratching ;)
        I was about to do the same thing, but much simpler ;). I applied your
        patch, just updated it a little bit. I also added HTTPS:: transport,
        so there is no need in OpenSSL hack anymore. I attached modified
        Makefile.PL, let me know how it works for you. I'll include it in the
        next version. How do you want to be mentioned? 'dpk'? :) Thanks a
        lot.

        Best wishes, Paul.

        --- dpk <beatdown_1_2@...> wrote:
        > Ive patched the SOAP::Lite distribution Makefile.PL to use
        > Getopt::Long
        > ( distributed with perl core ) to handle command line arguments.
        > I've
        > been consistently itched with the fact that I have to manually
        > configure it every time, so this is my attempt at scratching ;)
        >
        > To apply the patch ( to SOAP-Lite-0.51 ):
        > bash$> patch SOAP-Lite-0.51/Makefile.PL soap.patch
        >
        > Help Text:
        > Usage: perl Makefile.PL <options>
        >
        > Possible Options are:
        >
        > --noprompt Disable interactive dialog
        > --test Perform extra testing
        > --help Display this help text
        >
        > --[no]install-MODULE [ Do Not ] Install appropriate module:
        > --[no]install-SOAP-Transport-HTTP-Client
        > --[no]install-SOAP-Transport-MAILTO-Client
        > --[no]install-SOAP-Transport-FTP-Client
        > --[no]install-SOAP-Transport-HTTP-Daemon
        > --[no]install-SOAP-Transport-HTTP-Apache
        > --[no]install-SOAP-Transport-HTTP-FCGI
        > --[no]install-SOAP-Transport-POP3-Server
        > --[no]install-SOAP-Transport-IO-Server
        > --[no]install-SOAP-Transport-MQ
        > --[no]install-SOAP-Transport-JABBER
        > --[no]install-SOAP-MIMEParser
        > --[no]install-SOAP-Transport-TCP
        > --[no]install-SOAP-Transport-HTTP
        >
        > To Paul + anyone else who has hacked on the code in Makefile.PL:
        > The strategy I took was to parse the prerequisites and take any
        > module
        > in parenthases on any line with a [yes]/[no] tag. These modules are
        > then translated into --[no]install- options.
        > The only problem with this is that the first two modules are both
        > labelled as SOAP::Transport::HTTP::Client. As a workaround I just
        > added
        > a check to skip any line referencing OpenSSL. It might be cleaner
        > to
        > change the second to SOAP::Transport::HTTPS::Client, but I can see
        > why
        > that isnt too important.
        > So, right now - there is no way to automagically get the config to
        > check for OpenSSL without prompting. Doesnt really matter of
        > course,
        > because all the makefile is really doing is creating a PREREQ_PM
        > hash,
        > but a limitation nonetheless.
        >
        > Cheers,
        > dpk
        >
        > __________________________________________________
        > Do You Yahoo!?
        > Make international calls for as low as $.04/minute with Yahoo!
        > Messenger
        > http://phonecard.yahoo.com/
        > ------------------------ Yahoo! Groups Sponsor
        >
        > To unsubscribe from this group, send an email to:
        > soaplite-unsubscribe@yahoogroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to
        > http://docs.yahoo.com/info/terms/
        >
        > > 62c62,116
        > < print <<EOI, map {"$_\n"} grep {/\[(?:yes|no)\]/} split "\n",
        > $prerequisites;
        > ---
        > >
        > > ## Defaults: Prompt for config, dont do extra testing
        > > use Getopt::Long;
        > > $prompt = 1; $test = 0; $help = 0;
        > > %options = ( 'prompt!' => \$prompt, 'test!' => \$test, 'help!' =>
        > \$help );
        > >
        > > ## Help text - we'll add module specific info in the following
        > loop
        > > $help_text = <<EOI;
        > > Usage: perl Makefile.PL <options>
        > >
        > > Possible Options are:
        > >
        > > --noprompt Disable interactive dialog
        > > --test Perform extra testing
        > > --help Display this help text
        > >
        > > --[no]install-MODULE [ Do Not ] Install appropriate module:
        > > EOI
        > >
        > >
        > > ## Create config parameters using module names and expand help
        > text
        > > foreach (split "\n", $prerequisites) {
        > > next unless ( /\[yes|no\]/ && /\(SOAP::\w/ );
        > > next if /OpenSSL/; ## Workaround the fact that
        > SOAP::Transport::HTTP::Client is checked twice
        > > /\[(yes|no)\]/;
        > > $yes_no = $1;
        > > /\((SOAP::[\w:]+)/;
        > > $module = $1;
        > > $module =~ s/::/-/g;
        > > $config{$module} = ( $yes_no eq 'yes' ? 1 : 0 );
        > > $options{'install-' . $module . '!'} = \$config{$module};
        > > $help_text .= " --[no]install-$module\n";
        > > }
        > >
        > > ## Get Options from the command line
        > > ## We will create a hash ( %config ) that has each module =>
        > (1|0) for install
        > > GetOptions(%options);
        > >
        > > ## Check for help
        > > if ($help) { print "$help_text\n"; exit; }
        > >
        > > ## Re-write prerequisites using command line arguments
        > > $temp = $prerequisites; $prerequisites = '';
        > > foreach (split "\n", $temp) {
        > > ## Only re-write lines that have a yes/no dialog + are SOAP
        > modules. ( skip SSL client )
        > > if ( !/OpenSSL/ && /\[yes|no\]/ && /\((SOAP::[\w:]+)/ ) {
        > > $module = $1;
        > > $module =~ s/::/-/g;
        > > $yes_no = $config{$module} ? '[yes]' : ' [no]';
        > > s/\[yes\]| \[no\]/$yes_no/;
        > > }
        > > $prerequisites .= "$_\n";
        > > }
        > >
        > > print <<EOI, map {"$_\n"} grep {/\[(?:yes|no)\]/} split "\n",
        > $prerequisites if $prompt;
        > 74c128
        > < my $auto = ExtUtils::MakeMaker::prompt("\nDo you want to proceed
        > with this configuration?" => 'yes') =~ /^\s*y/i;
        > ---
        > > my $auto = $prompt ? ExtUtils::MakeMaker::prompt("\nDo you want
        > to proceed with this configuration?" => 'yes') =~ /^\s*y/i : 1;
        > 86c140
        > < my $noncoretests = ExtUtils::MakeMaker::prompt('
        > ---
        > > my $noncoretests = $prompt ? ExtUtils::MakeMaker::prompt('
        > 90c144
        > < Do you want to perform these tests in addition to core tests?',
        > 'no') =~ /^\s*(y)/i;
        > ---
        > > Do you want to perform these tests in addition to core tests?',
        > $test ? 'yes' : 'no') =~ /^\s*(y)/i : $test;
        >


        __________________________________________________
        Do You Yahoo!?
        Make international calls for as low as $.04/minute with Yahoo! Messenger
        http://phonecard.yahoo.com/
      • dpk
        Excellent! I ve got one small patch to your new Makefile.PL to handle module descriptions with a require phrase: (SOAP::Transport::HTTP::Apache, require
        Message 3 of 4 , Aug 20 9:04 PM
        • 0 Attachment
          Excellent! I've got one small patch to your new Makefile.PL to handle
          module descriptions with a require phrase:
          (SOAP::Transport::HTTP::Apache, require Apache)
          Everything else looks excellent. You are indeed a perl wizard, breaking
          out the s///egx ;)
          I guess I should switch my soap-lite address over to my regular email
          account, but here it is for now:

          Dana Powers
          dana@...

          One more question, what is your preference regarding "\r?\n" in
          patches? Should we use Carriage Returns or not, or do you care?

          dpk

          --- Paul Kulchenko <paulclinger@...> wrote:
          > Hi, dpk!
          >
          > > been consistently itched with the fact that I have to manually
          > > configure it every time, so this is my attempt at scratching ;)
          > I was about to do the same thing, but much simpler ;). I applied your
          > patch, just updated it a little bit. I also added HTTPS:: transport,
          > so there is no need in OpenSSL hack anymore. I attached modified
          > Makefile.PL, let me know how it works for you. I'll include it in the
          > next version. How do you want to be mentioned? 'dpk'? :) Thanks a
          > lot.
          >
          > Best wishes, Paul.

          __________________________________________________
          Do You Yahoo!?
          Make international calls for as low as $.04/minute with Yahoo! Messenger
          http://phonecard.yahoo.com/
        • Paul Kulchenko
          Hi, Dana! ... Great! I applied patch. Thank you. ... You mean in diff files? I don t really care ;). Do what is more convenient for you, I ll find a way to
          Message 4 of 4 , Aug 20 9:36 PM
          • 0 Attachment
            Hi, Dana!

            > Everything else looks excellent. You are indeed a perl wizard,
            Great! I applied patch. Thank you.

            > One more question, what is your preference regarding "\r?\n" in
            > patches? Should we use Carriage Returns or not, or do you care?
            You mean in diff files? I don't really care ;). Do what is more
            convenient for you, I'll find a way to handle it.

            Best wishes, Paul.

            --- dpk <beatdown_1_2@...> wrote:
            > Excellent! I've got one small patch to your new Makefile.PL to
            > handle
            > module descriptions with a require phrase:
            > (SOAP::Transport::HTTP::Apache, require Apache)
            > Everything else looks excellent. You are indeed a perl wizard,
            > breaking
            > out the s///egx ;)
            > I guess I should switch my soap-lite address over to my regular
            > email
            > account, but here it is for now:
            >
            > Dana Powers
            > dana@...
            >
            > One more question, what is your preference regarding "\r?\n" in
            > patches? Should we use Carriage Returns or not, or do you care?
            >
            > dpk
            >
            > --- Paul Kulchenko <paulclinger@...> wrote:
            > > Hi, dpk!
            > >
            > > > been consistently itched with the fact that I have to manually
            > > > configure it every time, so this is my attempt at scratching ;)
            > > I was about to do the same thing, but much simpler ;). I applied
            > your
            > > patch, just updated it a little bit. I also added HTTPS::
            > transport,
            > > so there is no need in OpenSSL hack anymore. I attached modified
            > > Makefile.PL, let me know how it works for you. I'll include it in
            > the
            > > next version. How do you want to be mentioned? 'dpk'? :) Thanks a
            > > lot.
            > >
            > > Best wishes, Paul.
            >
            > __________________________________________________
            > Do You Yahoo!?
            > Make international calls for as low as $.04/minute with Yahoo!
            > Messenger
            > http://phonecard.yahoo.com/
            > ------------------------ Yahoo! Groups Sponsor
            >
            > To unsubscribe from this group, send an email to:
            > soaplite-unsubscribe@yahoogroups.com
            >
            >
            >
            > Your use of Yahoo! Groups is subject to
            > http://docs.yahoo.com/info/terms/
            >
            > > 97,98c97,98
            > < $prerequisites =~ s/\((SOAP::[\w:]+)\)(.+)\[(yes|no)\]
            > <
            > /sprintf"(%s)%s[%s]",$1,$2,$config{$1}?'yes':'no'/egx;
            > ---
            > > $prerequisites =~ s/\((SOAP::[\w:]+)([^\)]*)\)(.+)\[(yes|no)\]
            > >
            > /sprintf"(%s%s)%s[%s]",$1,$2,$3,$config{$1}?'yes':'no'/egx;
            >


            __________________________________________________
            Do You Yahoo!?
            Make international calls for as low as $.04/minute with Yahoo! Messenger
            http://phonecard.yahoo.com/
          Your message has been successfully submitted and would be delivered to recipients shortly.