composer / installers

A Multi-Framework Composer Library Installer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When target location change, data must be moved (not duplicated)

mvorisek opened this issue · comments

Steps to reproduce:

Run composer update with the following config:

{
    "name": "xxx/xxx",
    "type": "library",
    "require": {
        "composer/installers": "^1.0.21",
        "prestashop/ps_specials": "^1.0",
    }
}

and notice module package is installed into /modules/ directory.

now edit the config to:

{
    "name": "xxx/xxx",
    "type": "library",
    "require": {
        "composer/installers": "^1.0.21",
        "prestashop/ps_specials": "^1.0",
    },
    "extra": {
        "installer-disable": [
            "prestashop"
        ]
    }
}

and run composer update again. The prestashop/ps_specials package is not moved (although vendor contains data about the original location), instead a new copy of it is installed to the standard vendor location.

Yeah if the installer is disabled there is no way for Composer to know where the package was previously. You'd need to remove the packages, disable the installer then install them again for this to work. I don't see how we can possibly fix that edge case tbh.

I think the target/install local directory is stored in composer metadata.

Yes that is true, but some custom installers also allow installing several things in the same path, so it's not like we can simply wipe that old path if the new one is different due to a custom installer being missing, we'd risk deleting user data.