FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=19707&edit=1

  ID: 19707
  Updated by: cweiske@php.net
  Reported By: paulie4@gmail.com
  Summary: _installFile() in PEAR/Installer.php ignores 'src'
                     files
  Status: Open
  Type: Bug
  Package: PEAR
  Package Version: 1.9.4
  PHP Version: 5.3.18
-Roadmap Versions:
+Roadmap Versions: 1.9.5
  New Comment:

-Roadmap Versions:
+Roadmap Versions: 1.9.5



Previous Comments:
------------------------------------------------------------------------

[2012-11-15 13:10:25] paulie4

Description:
------------
There seems to be a bug in _installFile() in PEAR/Installer.php,
since, in the switch-case, it returns without doing anything with
the 'src' file (treating the file as if it was an 'extsrc'), but then,
near the bottom of the function, the code is expecting the 'src'
file to have been copied to $dest_file. This in turn causes
phpize to fail with this message:
Cannot find config.m4.
Make sure that you run '/usr/bin/phpize' in the top level
source directory of the module

ERROR: `phpize' failed

I found this bug trying to "pecl install apd".

Here's the unified diff I created to patch it (Although, I'm not
sure if I'm handling directories correctly):
--- Installer.php~ 2012-01-06 00:05:03.000000000 +0000
+++ Installer.php 2012-11-15 12:31:47.495562295 +0000
@@ -245,6 +245,9 @@
          // {{{ assemble the destination paths
          switch ($atts['role']) {
              case 'src':
+ $this->source_files++;
+ $dest_dir = dirname($this->pkginfo-
getPackageFile());
+ break;
              case 'extsrc':
                  $this->source_files++;
                  return;
@@ -322,6 +325,8 @@
                      return $this->raiseError("file $orig_file does not

exist",
                                               PEAR_INSTALLER_FAILED);
                  }
+ if (is_dir($orig_file))
+ return; // directories shouldn't be in here?

                  if (!@copy($orig_file, $dest_file)) {
                      return $this->raiseError("failed to write
$dest_file: $php_errormsg",

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedMay 29, '14 at 6:35p
activeMay 29, '14 at 6:35p
posts1
users1
websitepear.php.net

1 user in discussion

Cweiske: 1 post

People

Translate

site design / logo © 2022 Grokbase