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

asdf-php plugin is not working at all #176

Open
miko-codes-a-lot opened this issue Aug 29, 2024 · 2 comments
Open

asdf-php plugin is not working at all #176

miko-codes-a-lot opened this issue Aug 29, 2024 · 2 comments

Comments

@miko-codes-a-lot
Copy link

Provide environment information

OS:
Linux miko-ThinkPad-E16-Gen-2 6.8.0-41-generic #41-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug  2 20:41:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

SHELL:
GNU bash, version 5.2.21(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

BASH VERSION:
5.2.21(1)-release

ASDF VERSION:
v0.14.0-ccdd47d

ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/home/miko/.asdf
ASDF_DIR=/home/miko/.asdf
ASDF_CONFIG_FILE=/home/miko/.asdfrc

ASDF INSTALLED PLUGINS:
awscli                       https://github.com/MetricMike/asdf-awscli.git main ac99537
eksctl                       https://github.com/elementalvoid/asdf-eksctl.git master 6c2266d
java                         https://github.com/halcyon/asdf-java.git master 15288ab
kubectl                      https://github.com/asdf-community/asdf-kubectl.git master cbe6df4
nodejs                       https://github.com/asdf-vm/asdf-nodejs.git master c36e6f0

To Reproduce

Run the command after installing the plugin:

asdf list all php

Describe the Bug

Plugin php's list-all callback script failed with output:
awk: line 1: regular expression compile failed (bad interval expression)
({})

Expected Behaviour

To be able to list all of PHP versions so I can start my download and installation

@RobLoach
Copy link
Contributor

RobLoach commented Sep 1, 2024

This'll fix that #172

@mfandrade
Copy link

mfandrade commented Sep 9, 2024

The output of git ls-remote --tags https://github.com/php/php-src.git | grep 'php-' is:

(...)
80c0a4323d487cad9cb954f0ae476ee069b6f271	refs/tags/php-8.4.0beta4^{}
73f9f842dde0f44a730eb8ea1df29e7e2961dcf9	refs/tags/php4
05309823902ed618a60123ac14d1c0d3297d84e5	refs/tags/php4^{}

The line 13 of list-all script tries to filter those lines using awk but the curly braces {} are not escaped. So the correct version of this script should change that line:

diff --git a/bin/list-all b/bin/list-all
index 3c5c3e0..0270e12 100755
--- a/bin/list-all
+++ b/bin/list-all
@@ -10,7 +10,7 @@ sort_versions() {
 versions=$(
   git ls-remote --tags https://github.com/php/php-src.git |
     grep 'php-' |
-    awk '!/({})/ {print $2}' |
+    awk '!/\{.*\}/ {print $2}' |
     sed 's/refs\/tags\/php-//' |
     sort_versions |
     xargs

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

No branches or pull requests

3 participants