#!/usr/bin/perl -W ##################################################################### # # # Check system dependencies between php-pear/php-pecl modules # # # # Adam Gołębiowski # # # # based on previous work by: # # Paweł Gołaszewski # # Michał Moskal # # # # ----------------------------------------------------------------- # # ChangeLog: # # 20031201: complete rewrite to use PEAR's package.xml, now handles # # all dependencies, including PHP modules (like php-gmp), # # and PECL extensions (adamg) # ##################################################################### @req_arr = (); $fname = '/dev/null'; foreach ( @ARGV ? $ARGV : <> ) { $fname = $_ if (/package.xml/) } open F, $fname; while () { if ( /\s+\([a-zA-Z0-9\_\-]*)\=" if ( $rel eq "ge"); $relation = ">" if ( $rel eq "gt"); $relation = "=" if ( $rel eq "has"); # die if we were unable to substitute relations die "ERROR: Unexpected relation! ($rel)\n" if ( $relation eq ""); $req = ""; $relver = ""; $relver = "$relation $version" if ( $version !~ /^$/ ); $req = "$name $relver" if ( $type =~ /(php|prog)/ ); $req = "php-$name $relver" if ( $type =~ /ext/ ); $req = "php-pear-$name" if ( $type =~ /pkg/ ); push @req_arr, $req } } for $r (@req_arr) { print "$r\n"; }