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:
  New Comment:

If I understand correctly, the src and extsrc files do not get installed
at all. They are only used for compiling the extension. So it's
perfectly fine for them not to get copied.

The remaining problem is why apd does not install. I can reproduce the
error here.


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

[2014-05-29 20:49:07] cweiske

-Roadmap Versions:
+Roadmap Versions: 1.9.5


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

[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

  • Cweiske at Jun 6, 2014 at 8:31 pm
    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
    +Status: Wont fix
      Type: Bug
      Package: PEAR
      Package Version: 1.9.4
      PHP Version: 5.3.18
    -Roadmap Versions: 1.9.5
    +Roadmap Versions:
      New Comment:

    -Status: Open
    +Status: Wont fix
    -Roadmap Versions: 1.9.5
    +Roadmap Versions:
    Problem with the apd package is that it's still using package.xml v1,
    while v2 is used since 2004.

    If apd used package.xml v2 with <extsrcrelease>, it would work fine.

    We will not fix pear to work fine with package.xml v1 pecl extensions.


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

    [2014-06-06 22:39:06] cweiske

    If I understand correctly, the src and extsrc files do not get installed
    at all. They are only used for compiling the extension. So it's
    perfectly fine for them not to get copied.

    The remaining problem is why apd does not install. I can reproduce the
    error here.

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

    [2014-05-29 20:49:07] cweiske

    -Roadmap Versions:
    +Roadmap Versions: 1.9.5


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

    [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",

    ------------------------------------------------------------------------
  • Cweiske at Jun 6, 2014 at 8:31 pm
    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: Wont fix
      Type: Bug
      Package: PEAR
      Package Version: 1.9.4
      PHP Version: 5.3.18
    -Assigned To:
    +Assigned To: cweiske
      Roadmap Versions:
      New Comment:

    -Assigned To:
    +Assigned To: cweiske



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

    [2014-06-06 22:45:44] cweiske

    -Status: Open
    +Status: Wont fix
    -Roadmap Versions: 1.9.5
    +Roadmap Versions:
    Problem with the apd package is that it's still using package.xml v1,
    while v2 is used since 2004.

    If apd used package.xml v2 with <extsrcrelease>, it would work fine.

    We will not fix pear to work fine with package.xml v1 pecl extensions.

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

    [2014-06-06 22:39:06] cweiske

    If I understand correctly, the src and extsrc files do not get installed
    at all. They are only used for compiling the extension. So it's
    perfectly fine for them not to get copied.

    The remaining problem is why apd does not install. I can reproduce the
    error here.

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

    [2014-05-29 20:49:07] cweiske

    -Roadmap Versions:
    +Roadmap Versions: 1.9.5


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

    [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",

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJun 6, '14 at 8:24p
activeJun 6, '14 at 8:31p
posts3
users1
websitepear.php.net

1 user in discussion

Cweiske: 3 posts

People

Translate

site design / logo © 2022 Grokbase