Packaging info from .info.yml often creates conflicts when patching

Created on 28 February 2019, almost 6 years ago
Updated 29 November 2023, about 1 year ago

Problem/Motivation

Disclaimer: Not sure that is the right project to post this.

  1. Add a module as dist (using a stable, beta, alpha version) in your composer.json.
  2. Create a patch that fixes the .info.yml file.
  3. Add the patch in composer.json and update.

In most of the cases the paching will fail because the content of the dist .info.yml contains also the packager script lines. The patch is build every time using the source, where those lines doesn't exist.

Proposed resolution

The .info.yml file is part of the codebase, it should not be altered by any script.

Long term solution

Move these package info in their own file that should be added by the the packager script, as LICENSE.txt is added.

Quick fix

Before the line # Information added by Drupal.org packaging script on ... add enough empty lines, so that the changed hunk doesn't interfere. Will still be a problem with the .info.yml files of sub-modules being deleted.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

N/A

🐛 Bug report
Status

Active

Version

11.0 🔥

Component
Base 

Last updated about 2 hours ago

Created by

🇷🇴Romania claudiu.cristea Arad 🇷🇴

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇴Norway matsbla

    I also have problems to update my sites to D10, there are patches ready to be applied, but am unable to patch my modules using composer. I think this issue should be escalated to major, as it makes it difficult to update sites to next drupal version.

  • 🇺🇸United States edmund.dunn Olympia, WA

    @orakili package in #22 works well. I tried the patcher from vaimo, but it wasn't applying all of the patches cleanly.

  • 🇮🇳India rasikap

    @orakili, the package does work but not for all modules. I tried patching sfweb2lead_webform but it fails.

  • 🇳🇱Netherlands watergate

    @orakili, thanks for the Composer plugin. It helped me/us a lot!

Production build 0.71.5 2024