From 2c310662cdbbcc84eab87af90b2b1ee964c560c1 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Wed, 26 Feb 2014 18:51:33 +0100 Subject: script to copy pear package dependencies --- bin/fetch-deps.php | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 bin/fetch-deps.php (limited to 'bin/fetch-deps.php') diff --git a/bin/fetch-deps.php b/bin/fetch-deps.php new file mode 100755 index 0000000..112a1f0 --- /dev/null +++ b/bin/fetch-deps.php @@ -0,0 +1,45 @@ +#!/usr/bin/env php +packageInfo($pkgname, null, $channel); + if ($pkginfo === null) { + echo 'Package not found: ' . $dep . "\n"; + exit(1); + } + + echo "Copying " . $channel . '/' . $pkgname . "\n"; + $files = 0; + foreach ($pkginfo['filelist'] as $fileinfo) { + if ($fileinfo['role'] != 'php') { + continue; + } + + $orig = $fileinfo['installed_as']; + $path = $libdir . ltrim( + $fileinfo['baseinstalldir'] . '/' . $fileinfo['name'], '/' + ); + $dir = dirname($path); + if (!is_dir($dir)) { + mkdir($dir, 0777, true); + } + if (!copy($orig, $path)) { + echo " Error copying $orig to $path\n"; + exit(2); + } + ++$files; + } + echo " copied $files files\n"; +} +?> -- cgit v1.2.3