Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / lang / php / pear_plist.php
blobe443c197aac0229c7cbc558fbd93dece28df1bd4
1 <?php
2 # $NetBSD: pear_plist.php,v 1.7 2009/06/14 22:58:02 joerg Exp $
3 # Parses package XML file and outputs appropriate PLIST
5 include_once "PEAR/Registry.php";
6 include_once "PEAR/PackageFile.php";
8 $PREFIX = getenv('PREFIX');
9 $PEAR_LIB = getenv('PEAR_LIB');
10 $WRKSRC = getenv('WRKSRC');
11 if(! $DESTDIR = getenv('DESTDIR')) $DESTDIR='';
13 $config = &PEAR_Config::singleton();
14 $package = &new PEAR_PackageFile($config);
15 $info = $package->fromAnyFile("$WRKSRC/package.xml", PEAR_VALIDATE_INSTALLING);
17 $pkg = $info->getName();
18 $channel = $info->getChannel();
20 $registry = &new PEAR_Registry($DESTDIR.$PREFIX."/".$PEAR_LIB);
21 $flist = $registry->packageInfo($pkg, 'filelist', $channel);
23 $regfile = $PEAR_LIB.'/.registry/.channel.'.$channel.'/'.strtolower($pkg).'.reg';
24 if (!file_exists($DESTDIR.$PREFIX.'/'.$regfile)) {
25 $regfile = $PEAR_LIB.'/.registry/'.strtolower($pkg).'.reg';
27 echo "$regfile\n";
28 # output list of package files, in same order as specified in package
29 foreach($flist as $f) {
30 echo str_replace($PREFIX.'/','', $f['installed_as'])."\n";