Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

What is the format of a .packlist file for a PPM repository?

by LittleGreyCat (Scribe)
on Oct 18, 2007 at 12:11 UTC ( [id://645694]=perlquestion: print w/replies, xml ) Need Help??

LittleGreyCat has asked for the wisdom of the Perl Monks concerning the following question:

As described in Building a local 'ppm' repository (Windows) I have previously built a local PPM repository so that I can run ppm without an Internet connection.

The local repository consists of all the 'ppd' files at the top level with the individual zipped packages in a directory immediately below. This works fine for the command line 'ppm' which ships with Perl V5.8.8 Build 8.1.7.

However the latest Perl build, 8.2.2, ships with a Windows GUI instead of a command line utility.
When pointed at my local repository it complains that there is no 'packlist' file.
I have looked at the '.packlist' files which are in the Perl distribution under e.g. D:\Perl\lib\auto\DBI and they seem to list the individual components of the package once installed.
I have added a '.packlist' file which contains the absolute local path name of a few of the 'ppd' files and I no longer get a complaint about the lack of a 'packlist' file but the GUI does not show the files within the repository.

So, can anyone describe for me the layout of a PPM repostitory for V8.2.2. including a sample '.packlist' file?

I note that the PPM zip files at http://aspn.activestate.com/ASPN/Downloads/ActivePerl/PPM/Zips do not seem to have changed format.

Nothing succeeds like a budgie with no teeth.

Replies are listed 'Best First'.
Re: What is the format of a .packlist file for a PPM repository?
by randyk (Parson) on Oct 18, 2007 at 14:20 UTC
    Is it complaining about lack of a packlist file, or a package.lst, file? If it's the latter, such a file is an xml file listing all packages available in the repository, obtained from the information in the ppd files. The format of this (and some other summary files used by ppm) is described in the documentation for PPM::Make::RepositorySummary, which can be used to generate such files.
      I used the gear wheel button (PPM Preferences) to add a new local repository called 'Dubious' which pointed to a folder which didn't have any PPM files in it.

      The diagnostic messages displayed at the botom under the Status tab were:
      "Synchronizing Database ... done
      Downloading Dubious packlist ... not found
      Downloading Dubious packlist ... not found
      Downloading Dubious packlist ... done
      Synchronizing Database ... done"

      So the diagnostic message is complaining about a 'packlist' and the nearest I can find to this is a '.packlist' file.
      Also, if I add a '.packlist' file the error message does not appear.
      Strangely, if I remove the '.packlist' file again the errror message does not re-occur so it may be something that only happens when you first contact a new repository; this seems to take me backwards instead of forwards.

      Thank you for your suggestion - I will follow that up and see if it makes any difference.

      Bottom line still is that the old command line 'ppm' worked fine with my repository but the new GUI 'ppm' does not.

      Curse you, WIMP!

      Oh, my aching head!
      I have tested further, and after the initial complaint about the Packlist not being found, when you start the GUI again, and when you turn the Repositories on and off, it just says:
      "Synchronizing Database ...
      Downloading LocalD packlist ... not modified
      Synchronizing Database done"

      This is with the '.packlist' file removed from LocalD.

      This means in turn that me "result" of adding a '.packlist' file and not seeing the error messages is totally meaningless.
      Oh, sh*t

      I think I'll just go away in a corner and sob quietly.

      Nothing succeeds like a budgie with no teeth.

        The messages from ppm:

        Synchronizing Database ... done
        Downloading Dubious packlist ... not found
        Downloading Dubious packlist ... not found
        Downloading Dubious packlist ... done
        Synchronizing Database ... done
        are perhaps misleading; ppm is looking for either a package.lst or a package.xml file, not a literal "packlist" file. If it doesn't find either of these summary files, it will fetch and parse the ppd files within this directory, if there are any. The summary files are just there to save ppm downloading and parsing individual ppd files.

        Try making a local repository and populating it with some ppd files, and the corresponding .tar.gz or .zip archives referenced in the CODEBASE element, and see if that works. You can use the rep_summary script of PPM-Make to generate the summary files, or alternatively, run the following script:

        use strict; use warnings; use File::Spec; my $ppm_dir = 'C:\Temp\ppms'; opendir(my $dir, $ppm_dir) or die qq{Cannot opendir $ppm_dir: $!}; my @ppds = grep /\.ppd$/, readdir $dir; closedir $dir; my $pack = File::Spec->catfile($ppm_dir, 'package.lst'); open(my $pack_fh, '>', $pack) or die qq{Cannot open $pack for writing: $!}; print $pack_fh <<"END"; <?xml version="1.0" encoding="UTF-8"?> <REPOSITORYSUMMARY> END for my $ppd (@ppds) { open(my $ppd_fh, File::Spec->catfile($ppm_dir, $ppd)) or die qq{Cannot read $ppd under $ppm_dir: $!}; while (<$ppd_fh>) { next if $_ =~ /\?xml version/; print $pack_fh " $_"; } close $ppd_fh; } print $pack_fh qq{</REPOSITORYSUMMARY>\n}; close $pack_fh;
        to generate the package.lst file; the directory of the repository in this script is specified as $ppm_dir.

      Randyk

      That looks like the business - I'll give it a try!

      Ooops! Perl can't find the code!
      "Can't locate PPM/Make/RepositorySummary.pm in @INC (@INC contains: D:/Perl/site/lib D:/Perl/lib"

      No worries, I'll install it...using.....ppm.......

      My bucket!!!!
      Look!!!
      A hole!!!!

      Nothing succeeds like a budgie with no teeth.
Re: What is the format of a .packlist file for a PPM repository?
by ww (Archbishop) on Oct 18, 2007 at 13:17 UTC
    <nitpick... but only in the hope that it may be relevant for anyone looking for additional info>
    The "latest Perl build" from ActiveState is "ActivePerl 5.8.8.822" -- no decimals in the build number. Noted, because searching the ActiveState site for "8.2.2" returns (variously) an error ("query string contained only ignored characters") or a nothing found message.
    </nitpick>

    Sorry not to have an answer for your threshold question.

Re: What is the format of a .packlist file for a PPM repository?
by thundergnat (Deacon) on Oct 18, 2007 at 17:01 UTC

    Somewhat off topic...

    FWIW, The old command line version of ppm is still there, it's just called ppm-shell now.

      ++ - completely on-topic if you ask me!
      I was having a bad day on Thursday (you may have guessed) and I saw a reference to ppm-shell but couldn't find it in my installation.

      If I can get the shell version working that will be fine!

      Nothing succeeds like a budgie with no teeth.
        In a command window, type ppm help for a list of command-line options available.
      Sadly, this is not the old command line version of PPM, but appears to be a command line variant of the new PPM.

      It does not accept my local PPM repository when I try to add it.

      Nothing succeeds like a budgie with no teeth.
        Does the syntax
        C:\>ppm repo add file://C:/Temp/ppms test
        work?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://645694]
Approved by almut
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-03-19 06:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found