Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails when a package is called in twice with the same patch #168

Closed
kdebisschop opened this issue Nov 13, 2017 · 1 comment
Closed

Fails when a package is called in twice with the same patch #168

kdebisschop opened this issue Nov 13, 2017 · 1 comment

Comments

@kdebisschop
Copy link

Given a structure like this:

Top Level
  Pacakge 1
    Subpackage A
    Subpackage B
        Patch
    Subpackage C
  Package 2
     Subpackage B
        Patch
     Subpackage D

The patch will get queued twice and on the second application will fail. You can also see this if you apply the same patch URL with a different description in one file:

{
  "name": "cweagans/composer-patches-test-project",
  "description": "Project for use in cweagans/composer-patches acceptance tests.",
  "type": "project",
  "license": "BSD-2-Clause",
  "repositories": [
    {
      "type": "path",
      "url": "../composer-patches"
    }
  ],
  "require": {
    "cweagans/composer-patches": "*@dev",
    "drupal/drupal": "~8.2"
  },
  "extra": {
    "patches": {
      "drupal/drupal": {
        "Add a startup config for the PHP web server": "https://www.drupal.org/files/issues/add_a_startup-1543858-58.patch",
        "Add a startup config for the PHP web server again": "https://www.drupal.org/files/issues/add_a_startup-1543858-58.patch"
      }
    }
  }
}

I think if the same patch URL is presented twice, it should only be applied the first time.

@cweagans
Copy link
Owner

cweagans commented Jun 2, 2018

I'm not sure how the patch would get queued twice. The package is only installed once.

In #93 (2.0.0), we'll dedupe patches based on a sha1 hash of the file. I don't plan to do anything about this in 1.x.

@cweagans cweagans closed this as completed Jun 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants