-p1 patches are now required, and -p0 patches are being phased out on Drupal.org (announcement). This module must be able to install the new patches.

Comments

aidanlis’s picture

Cool, thanks for the heads up.

DrewMathers’s picture

aidanlis’s picture

Status: Active » Fixed

Fixed in VCS.

DrewMathers’s picture

Maybe I haven't waited long enough, but I'm still seeing the 25-Feb-2011 dev snapshot.

I don't know what you were planning, but I was thinking of something like this:

<?php
  // Run the command
  $patch = variable_get('patch_manager_path_patch', '/usr/bin/patch');
  foreach (array('-p1', '-p0') as $pn) {
    $cmd = sprintf('%s '.$pn.' --verbose %s -d %s -i %s',
      $patch,
      $flags,
      escapeshellarg($root),
      escapeshellarg($patchfile)
    );
    exec($cmd, $output, $ret);
    if (!$ret) break;
  }
?>
aidanlis’s picture

Yeah don't wait for the -dev, checkout from git. I was thinking more of forcing all patches in the system to be -p1, the more modules which enforce this consistency the better I think. I can definitely see the argument for -p0 ... if your method is 100% robust I'm happy to use that.

DrewMathers’s picture

Status: Fixed » Needs review
StatusFileSize
new947 bytes

Both -p1 and -p0 patches are going to be circulating for a while. Some developers won't have heard about the change. Many -p0 patches are already in the issue queues or distributed with modules. If you drop support for either standard, your own issue queue could be flooded with support requests from users wondering why their patches didn't apply. Especially since GUI tools like Patch Manager appeal to the less technically inclined.

I have rolled #4 into a patch and tested it with every combination of core, contrib, -p1, -p0, apply, revert.

DrewMathers’s picture

StatusFileSize
new993 bytes

The above patch fails to handle the exception where a patch is partially applied. Here is a correction.

zet’s picture

Thanks DrewMathers for your patch. Really helpful !

DrewMathers’s picture

Status: Needs review » Reviewed & tested by the community
aidanlis’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, fixed ... really sorry about the delay.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.