pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/php * Support v2 of the pear-* package format tha...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/cd98d54b6a2f
branches:  trunk
changeset: 527891:cd98d54b6a2f
user:      adrianp <adrianp%pkgsrc.org@localhost>
date:      Sun Apr 15 13:46:42 2007 +0000

description:
* Support v2 of the pear-* package format that is being used by some
  newer pear packages.
* Fix the case where an extra slash would be appended to the file path in the
  PLIST.
* Both fixes from from Loic Hoguin and tested by Loic and myself.

diffstat:

 lang/php/pear_plist.php |  20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diffs (50 lines):

diff -r 909dfa912f4a -r cd98d54b6a2f lang/php/pear_plist.php
--- a/lang/php/pear_plist.php   Sun Apr 15 13:29:44 2007 +0000
+++ b/lang/php/pear_plist.php   Sun Apr 15 13:46:42 2007 +0000
@@ -1,5 +1,5 @@
 <?php
-# $NetBSD: pear_plist.php,v 1.3 2004/11/01 20:31:13 jdolecek Exp $
+# $NetBSD: pear_plist.php,v 1.4 2007/04/15 13:46:42 adrianp Exp $
 # Parses package XML file and outputs appropriate PLIST
 
 $PEAR_LIB = getenv('PEAR_LIB');
@@ -10,9 +10,13 @@
 include_once "PEAR/Common.php";
 $obj = &new PEAR_Common;
 $info = $obj->infoFromAny("$WRKSRC/package.xml");
-$pkg = $info['package'];
 
-// output list of package files, in same order as specified in package
+if (!empty($info['attribs']) && $info['attribs']['version'] == '2.0')
+       $pkg = $info['name'];
+else
+       $pkg = $info['package'];
+
+# output list of package files, in same order as specified in package
 echo "$PEAR_LIB/.registry/".strtolower($pkg).".reg\n";
 foreach($info['filelist'] as $f => $v) {
        switch($v['role']) {
@@ -28,6 +32,12 @@
                if (!empty($v['baseinstalldir']) && $v['baseinstalldir'] != '/') {
                        $prefix = $v['baseinstalldir'] . '/';
 
+                       # sometimes the baseinstalldir begins with a slash,
+                       # which make the PLIST output to have two instead of 
+                       # one.  We fix this here.
+                       if ($prefix[0] == '/')
+                               $prefix = substr($prefix, 1);
+
                        if ($PEAR_DIRRM_BASEDIR)
                                $dirrm[$v['baseinstalldir']] = true;
                } else
@@ -45,8 +55,8 @@
                $dirrm["{$prefix}{$f}"] = true;
 }
 
-// output @dirrm directives, in reverse order so that deeper
-// directories are removed first
+# output @dirrm directives, in reverse order so that deeper
+# directories are removed first
 $dirrm = array_keys($dirrm);
 rsort($dirrm);
 foreach($dirrm as $dir)



Home | Main Index | Thread Index | Old Index