phar-io / phive

The Phar Installation and Verification Environment (PHIVE)
https://phar.io
BSD 3-Clause "New" or "Revised" License
579 stars 43 forks source link

Symlink gets overwritten when PHAR is installed twice from different sources #79

Open sebastianheuer opened 8 years ago

sebastianheuer commented 8 years ago
$ phive install phpab
(...)
Linking phpab-1.20.0.phar to /Users/sebastian/projects/php/phive/tools/phpab

leads to the following phive.xml:

<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
  <phar name="phpab" version="*" installed="1.20.0" location="./tools/phpab"/>
</phive>

Installing phpab from GitHub afterwards:

$ phive install theseer/autoload
(...)
Linking phpab-1.22.0.phar to /Users/sebastian/projects/php/phive/tools/phpab

now the original phpab symlink has been overwritten, and phive.xml contains both entries:

<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
  <phar name="phpab" version="*" installed="1.20.0" location="./tools/phpab"/>
  <phar name="theseer/autoload" version="*" installed="1.22.0" location="./tools/phpab"/>
</phive>
sebastianheuer commented 7 years ago

Plan of attack (not complete):

ThomasWeinert commented 7 years ago

Be careful with that. Subnodes in XML should not depend on the value of an attribute in the parent node.

sebastianheuer commented 7 years ago

Blocked by #109