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

purge command deleted the wrong version #366

Closed
neil-pearce opened this issue Mar 25, 2022 · 5 comments
Closed

purge command deleted the wrong version #366

neil-pearce opened this issue Mar 25, 2022 · 5 comments
Assignees

Comments

@neil-pearce
Copy link

This is running PHIVE on Windows 10. If I run an update command it works as expected but if I then use purge, it is deleted the updated files and the link file (eg phpstan.bat) is left referencing the updated file.

D:\Development\Tools>phive update
Phive 0.15.0 - Copyright (C) 2015-2022 by Arne Blankerts, Sebastian Heuer and Contributors
Downloading https://github.com/composer/composer/releases/download/2.3.0-RC2/composer.phar
Downloading https://github.com/composer/composer/releases/download/2.3.0-RC2/composer.phar.asc
Linking C:\Users\Neil.phive\phars/composer-2.3.0-RC2.phar to D:\Development\Tools\PHIVE\tools/composer.bat
Downloading https://github.com/phpstan/phpstan/releases/download/1.5.0/phpstan.phar
Downloading https://github.com/phpstan/phpstan/releases/download/1.5.0/phpstan.phar.asc
Linking C:\Users\Neil.phive\phars/phpstan-1.5.0.phar to D:\Development\Tools\PHIVE\tools/phpstan.bat
Linking C:\Users\Neil.phive\phars/psalm-5.0.0-alpha1.phar to D:\Development\Tools\PHIVE\tools/psalm.bat
Downloading https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v3.8.0/php-cs-fixer.phar
Downloading https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v3.8.0/php-cs-fixer.phar.asc
Linking C:\Users\Neil.phive\phars/php-cs-fixer-3.8.0.phar to D:\Development\Tools\PHIVE\tools/php-cs-fixer.bat
Downloading https://api.github.com/repos/phpdocumentor/phpdocumentor2/releases
Linking C:\Users\Neil.phive\phars/phpdocumentor-3.3.1-rc.phar to D:\Development\Tools\PHIVE\tools/phpDocumentor.bat

D:\Development\Tools>phive status
Phive 0.15.0 - Copyright (C) 2015-2022 by Arne Blankerts, Sebastian Heuer and Contributors
PHARs configured in project:

Alias/URL Version Constraint Installed Location Key Ids

composer ^2.2.7 2.3.0-RC2 D:\Development\Tools\PHIVE\tools\composer CBB3D576F2A0946F
phpstan ^1.4.9 1.5.0 D:\Development\Tools\PHIVE\tools\phpstan CF1A108D0E7AE720
psalm ^5.0.0-alpha1 5.0.0-alpha1 D:\Development\Tools\PHIVE\tools\psalm 12CE0F1D262429A5
php-cs-fixer ^3.7.0 3.8.0 D:\Development\Tools\PHIVE\tools\php-cs-fixer E82B2FB314E9906E
phpdocumentor ^3.3.1-rc 3.3.1-rc D:\Development\Tools\PHIVE\tools\phpDocumentor 67F861C3D889C656

D:\Development\Tools>phive purge
Phive 0.15.0 - Copyright (C) 2015-2022 by Arne Blankerts, Sebastian Heuer and Contributors
Phar composer 2.3.0-RC2 has been deleted.
Phar phpstan 1.5.0 has been deleted.
Phar php-cs-fixer 3.8.0 has been deleted.

D:\Development\Tools>phive status
Phive 0.15.0 - Copyright (C) 2015-2022 by Arne Blankerts, Sebastian Heuer and Contributors
PHARs configured in project:

Alias/URL Version Constraint Installed Location Key Ids

composer ^2.2.7 2.3.0-RC2 D:\Development\Tools\PHIVE\tools\composer CBB3D576F2A0946F
phpstan ^1.4.9 1.5.0 D:\Development\Tools\PHIVE\tools\phpstan CF1A108D0E7AE720
psalm ^5.0.0-alpha1 5.0.0-alpha1 D:\Development\Tools\PHIVE\tools\psalm 12CE0F1D262429A5
php-cs-fixer ^3.7.0 3.8.0 D:\Development\Tools\PHIVE\tools\php-cs-fixer E82B2FB314E9906E
phpdocumentor ^3.3.1-rc 3.3.1-rc D:\Development\Tools\PHIVE\tools\phpDocumentor 67F861C3D889C656

Directory of C:\Users\Neil.phive\phars

11/03/2022 08:24 2,362,452 composer-2.2.7.phar
11/03/2022 10:37 2,599,316 php-cs-fixer-3.7.0.phar
25/03/2022 09:03 22,933,961 phpdocumentor-3.3.1-rc.phar
11/03/2022 08:28 20,575,053 phpstan-1.4.9.phar
11/03/2022 10:27 11,837,792 psalm-5.0.0-alpha1.phar

@theseer
Copy link
Member

theseer commented Mar 25, 2022

It looks like the update command fails to properly update usage entries in the install registry file. This certainly qualifies as a bug.

@neil-pearce
Copy link
Author

neil-pearce commented Mar 25, 2022 via email

@theseer
Copy link
Member

theseer commented Mar 25, 2022

It will take a tad bit longer to fix it though ;)

@theseer
Copy link
Member

theseer commented Mar 27, 2022

That was a seriously stupid one ;). How nobody stumbled upon this before will stay a mystery to me..

@neil-pearce
Copy link
Author

You always need the user who doesn't really know what they are doing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants