#!/usr/bin/perl ##################################################################### # # # Check system dependences between php-pear modules # # # # Paweł Gołaszewski # # Michał Moskal # # ------------------------------------------------------------------# # TODO: # # - extension_loaded - dependencies. # # - some clean-up... # ##################################################################### $pear = "/usr/share/pear"; @files = (); %req = (); foreach (@ARGV ? $ARGV : <> ) { chomp; $f = $_; push @files, $f; # skip non-php files next unless ($f =~ /\.php$/); open(F, "< $f") or die; if ($f =~ /$pear/) { $file_dir = $f; $file_dir =~ s|.*$pear/||; $file_dir =~ s|/[^/]*$||; } else { $file_dir = undef; } while () { # skip comments next if (/^\s*(#|\/\/|\*|\/\*)/); while (/(\W|^)(require|include)(_once)? \s* \(? \s* ("([^"]*)"|'([^']*)') \s* \)? \s* ;/xg) { if ($5 ne "") { $x = $5; } elsif ($6 ne "") { $x = $6; } else { next; } do $x =~ s/\/\.?\//\//g while $x =~ /\/\.?\//; do $x =~ s/(\/|^)[^\/]*[^.]\/\.\.\//\1/g while $x =~ /(\/|^)[^\/]*[^.]\/\.\.\//; next if ($x =~ m|^\.\.?/| or $x =~ /\$/); next unless ($x =~ /\.php$/); $req{$x} = 1; } next unless (defined $file_dir); while (/(\W|^)(require|include)(_once)? \s* \(? \s* dirname \s* \( \s* __FILE__ \s* \) \s* \. \s* ("([^"]*)"|'([^']*)') \s* \)? \s* ;/xg) { if ($5 ne "") { $x = $5; } elsif ($6 ne "") { $x = $6; } else { next; } next unless ($x =~ /\.php$/); $x = "$file_dir/$x"; do $x =~ s/\/\.?\//\//g while $x =~ /\/\.?\//; do $x =~ s/(\/|^)[^\/]*[^.]\/\.\.\//\1/g while $x =~ /(\/|^)[^\/]*[^.]\/\.\.\//; $req{$x} = 1; } } } f: for $f (keys %req) { for $g (@files) { next f if ($g =~ /\Q$f\E$/); } print "pear($f)\n"; } 'get' action='/software/forks/initscripts/log/src/process.h'>
blob: ef98f7875a12d62944cd842ea82ca53921219eae (plain)
1
2
3
4
5
6
7
8
9
#ifndef PROCESS_H
#define PROCESS_H


#define CMD_FD	21

int runCommand(char *cmd, int reexec, int quiet, int debug);

#endif