Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I add PPM repositories?

Installing Modules

How do I add PPM repositories?

by  missbarbell  Posted    (Edited  )
If you are using PPM (Perl Package Manager) from ActiveState, you may only be using ActiveState own repository to grab and install CPAN modules. However, there are many more repositories around the world, which hold many modules and packages that ActiveState haven't yet loaded into their repository.

By adding these extra repositories, when you type 'install <package>', instead of just looking in the ActiveState repository, PPM will search all the repositories in your list to find '<package>'. Below are instructu=ions of how to add the 11 most widely used repositories to your version of PPM.

PPM version 3:

The latest version of PPM now uses a different syntax to add repositories, so if using an older version see the next section.

Start your copy of PPM, either from the command line or via Start->Run and typing in PPM3. You should then get a nice black command window (the DOS window), which you should enter the following:

PPM> rep add DevelopHelp http://ppd.develop-help.com/ppd/
PPM> rep add Roth http://www.roth.net/perl/packages/
PPM> rep add PTK http://www.xray.mpe.mpg.de/~ach/ptk/ppm/
PPM> rep add Theory http://theoryx5.uwinnipeg.ca/ppmpackages/
PPM> rep add Dada http://dada.perl.it/PPM
PPM> rep add Jenda http://jenda.krynicky.cz/perl
PPM> rep add rto http://rto.dk/packages/
PPM> rep add OpenInteract http://openinteract.sourceforge.net/ppmpackages/
PPM> rep add GA http://ppm.gingerall.cz
PPM> rep add EPN http://www.epn.ml.org/~spurkis/Agent/repository
PPM> rep add JMC http://homepage.eircom.net/~jmcnamara/perl

You can search what repositories you have via the command 'rep' as in:

PPM> rep

to get a list of the repositories you have listed, the active one will be marked with a leading '*'. Then type

PPM> rep set X

where X is the number of the repository you want to search.

PPM> help rep

will give you more commands.


PPM older versions:

Older versions of PPM use a different syntax to the current release.

Start your copy of PPM, either from the command line or via Start->Run and typing in PPM. You should then get a nice black command window (a la DOS), which you should enter the following:

PPM> set repository DevelopHelp http://ppd.develop-help.com/ppd/
PPM> set repository Roth http://www.roth.net/perl/packages/
PPM> set repository PTK http://www.xray.mpe.mpg.de/~ach/ptk/ppm/
PPM> set repository Theory http://theoryx5.uwinnipeg.ca/ppmpackages/
PPM> set repository Dada http://dada.perl.it/PPM
PPM> set repository Jenda http://jenda.krynicky.cz/perl
PPM> set repository rto http://rto.dk/packages/
PPM> set repository OpenInteract http://openinteract.sourceforge.net/ppmpackages/
PPM> set repository GA http://ppm.gingerall.cz
PPM> set repository EPN http://www.epn.ml.org/~spurkis/Agent/repository
PPM> set repository JMC http://homepage.eircom.net/~jmcnamara/perl
PPM> set save


Installing non-ActiveState modules:

You can now access a larger number of PPM packaged modules, including mod_perl [1]:

PPM> install mod_perl

and Template Toolkit:

PPM> install AppConfig
PPM> install Template-Toolkit

[1] Further information about installing mod_perl can be seen at:

http://perl.apache.org/docs/1.0/os/win32/install.html#PPM_Packages


Known Issues:

There are some issues with the latest version of PPM, which can be read at:

http://aspn.activestate.com/ASPN/PPM/


Browsing ActiveState's repository:

To search through ActiveState's repository to see whether the module you require has been uploaded into their repository, go to:

http://aspn.activestate.com/ASPN/Modules?module_name=C&order=name


Install Repositories from scripts

The first script, ppm-install1.pl, installs the [link http://search.cpan.org/dist/PPM-Repositories/Repositories.pm]PPM::Repositories[/link] module. You should also be able to do this via PPM itself (or cpan or cpanp).

Code:
#!/usr/bin/perl -w
use strict;

use PPM

PPM::InstallPackage("package" => 'PPM-Repositories');

The second script, ppm-install2.pl, reads through the current list of known PPM repositories, and adds those that are active and removes that are no longer used. I tend to use this whenever the PPM::Repositories module gets updated.

Code:
#!/usr/bin/perl -w
use strict;

use PPM;
use PPM::Repositories;

my @list = PPM::ListOfRepositories();
my %list = map {$_ => 1} @list;

for my $rep ( keys %Repositories ) {
	if($list{$rep}) {
		if(!$Repositories{$rep}->{Active}) {
			PPM::RemoveRepository(	"repository" => $rep, 
									"save" => 1);
		}
	} else {
		if($Repositories{$rep}->{Active}) {
			PPM::AddRepository(		"repository" => $rep, 
									"location" => $Repositories{$rep}->{location}, 
									"save" => 1);
		}
	}
}

You should now have all the active PPM repositories loaded. Happy installing.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top