Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Re: HowTo build and distribute a PPMed module for Win32

by idnopheq (Chaplain)
on Sep 20, 2001 at 03:40 UTC ( #113499=note: print w/replies, xml ) Need Help??

in reply to Re: HowTo build and distribute a PPMed module for Win32
in thread HowTo build and distribute a PPMed module for Win32

What version of AS perl and ppm are you running? When I do a search in PPM, I get the ppds in my repository. Maybe mine's a fluke tho, as I have had the same AS distribution on multiple machines and received varying results. Eh, ~sigh~, YMMV! :-)

I do like the idea of PPM and the flexibility/raw power of CPAN. I wish the two could come together. i.e. CPAN checking to see if there's a ppd for a module; installing that versus making/compiling the source; building dependencies ( which PPM does not do ); etc.

Maybe someday ...

Apply yourself to new problems without preparation, develop confidence in your ability to to meet situations as they arrise.

  • Comment on Re: Re: HowTo build and distribute a PPMed module for Win32

Replies are listed 'Best First'.
Re: Re: Re: HowTo build and distribute a PPMed module for Win32
by $code or die (Deacon) on Sep 20, 2001 at 03:58 UTC
    I have ActivePerl 629 - which I compiled, so PPM would be the one that comes with build 628.

    I'll try on some other machines and see what happens. But I was looking through the source and it implies that repositories can have "Summary" files. These summaries somehow aid the search routines. I am guessing that PPM::SOAPServer is a SOAP service that acts as the repository and searches the PPD files returning descriptions etc that match the search. But maybe I have the wrong end of the stick!

    Simon Flack ($code or die)
    $,=reverse'"ro_';s,$,\$,;s,$,lc ref sub{},e;$,
    =~y'_"' ';eval"die";print $_,lc substr$@,0,3;
      IIRC, this bit of magic is done via XML::Simple and a simple looking for ppd files fuzzily matching the file name based on the search criteria and the listed repositories. I'm on a Win95 box <sympathy is appreciated> w/o anything remotely perlish installed, so I cannot show the output of my PPM.

      I would not, however, deny that the modules I have or the site is w/o flaws. If it is, lemme know. I claim to be no expert, tho I play one on TV.

      Oh! You know what! I have "multi-threaded" in the ppd files, which I dunno if the Siemen's port compiles as such. Thus, you may not see it! Hmmmmm ... Try grabbing the ppd and tar.gz and edit the ppd file - removing the line w/ "multi-threaded" on it ... wonder if it will search that way ( using the --location path or URL in the search command ) ...

      UPDATE: I have heard a while back that ActiveState was ditching SOAP in PPM, but I see now that that is incorrect. SOAP is used in the search capability, so no I head out and find how to set up the SOAP server piece ... MY BAD!

      Apply yourself to new problems without preparation, develop confidence in your ability to to meet situations as they arrise.

        Right, I have been re-reading and understand how the search command works.

        When you do search Module-Name, it run's the function list_available(). This function returns a list of .ppd files in the repository. It does it differently depending on what type of repository it is, e.g.: file://, UNC, SOAP, or http://. We're interested in the last bit of the function concerning http.

        If the repository is an http:// repository (not soap), then it calls the function read_href() which returns the text on the page. list_available() expects either a directory listing (Apache or IIS format) or a default.prk format file - ActiveState's Visual Package Manager that's part of the Perl Dev Kit.

        For the search to work properly (without implimenting a SOAP interface or .prk) your repository must return something that resembles a directory listing, which parses.

        Thankfully, keeps the "libwww-perl/" part of the user agent. So we can write a small script that will return a directory listing for ppm and a nicely formatted page for regular browsers. This is a small working example of what to do:
        use strict; use CGI qw( :all ); my $user_agent = user_agent(); my $html_redirection = ''; if ($user_agent =~ m#libwww-perl/#) { # it's a perl bot - probably ppm, so return a # compatible directory listing print_dir_listing(); } else { # it's probably a regular browser, redirect... print redirect(-uri => $html_redirection); } sub print_dir_listing { # Get the current directory, (cwd doesn't necessarily work in IIS) (my $cwd = $0) =~ s[\\][/]g; $cwd =~ s[/([^/]*)$][]; print header({-type => "text/plain"}); opendir FOLDER, $cwd or die "I don't have permission $!"; print a({-href => $_}, $_ ), "\n" for grep { /\.ppd$/ } readdir FO +LDER; closedir FOLDER; }
        Save this to or something and make sure it's the default document. Then change $html_redirection variable to the URL where you want your actual users to go to and you're set. You can of course do something more dynamic for the actual users page, such as parse the XML in the PPD files to give user's full information on the modules (version, description, author etc) without having to edit an html file every time you change a package or add a new one. I leave that as an exercise for the reader :)

        Simon Flack ($code or die)
        $,=reverse'"ro_';s,$,\$,;s,$,lc ref sub{},e;$,
        =~y'_"' ';eval"die";print $_,lc substr$@,0,3;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://113499]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2020-08-12 16:04 GMT
Find Nodes?
    Voting Booth?
    Which rocket would you take to Mars?

    Results (66 votes). Check out past polls.