- Package:
- pkg-php-tools
- Source:
- pkg-php-tools
- Submitter:
- David Prévot
- Date:
- 2020-12-27 15:27:03 UTC
- Severity:
- wishlist
Hi,
I just noticed that dh_phpcomposer choke on versions like “1.4.x” that
seem to be equivalent to “1.4.*”, so it would be nice if it handle both
of those versions the same way.
Regards
David
P.-S.: The output I got while trying to handle phing’s move to its
composer source.
taffit@persil:~/Debian/phing$ dh_phpcomposer
InvalidArgumentException: Unable to parse version '1.4.x' with dependency pear/archive_tar (1.4.x) in /usr/share/php/pkgtools/phpcomposer/source.php:193
Stack trace:
#0 /usr/share/php/pkgtools/phpcomposer/command.php(73): Pkgtools\Phpcomposer\Source->getDependencies()
#1 [internal function]: Pkgtools\Phpcomposer\Command->runSubstvars()
#2 /usr/share/php/pkgtools/base/command.php(180): call_user_func_array()
#3 /usr/share/php/pkgtools/base/command.php(168): Pkgtools\Base\Command->parseArgs()
#4 /usr/bin/pkgtools(32): Pkgtools\Base\Command->parseArgs()
#5 {main}
Next Exception: Unable to parse version '1.4.x' with dependency pear/archive_tar (1.4.x) with dependency pear/archive_tar (1.4.x) in /usr/share/php/pkgtools/phpcomposer/source.php:259
Stack trace:
#0 /usr/share/php/pkgtools/phpcomposer/command.php(73): Pkgtools\Phpcomposer\Source->getDependencies()
#1 [internal function]: Pkgtools\Phpcomposer\Command->runSubstvars()
#2 /usr/share/php/pkgtools/base/command.php(180): call_user_func_array()
#3 /usr/share/php/pkgtools/base/command.php(168): Pkgtools\Base\Command->parseArgs()
#4 /usr/bin/pkgtools(32): Pkgtools\Base\Command->parseArgs()
#5 {main}
dh_phpcomposer: error: /usr/bin/pkgtools -v --sourcedirectory . phpcomposer substvars returned exit code 1
Quoting from the source code of Composer's "semver" version parser [1]: // X Range // // Any of X, x, or * may be used to "stand in" for one of the numeric values in the [major, minor, patch] tuple. // A partial version range is treated as an X-Range, so the special character is in fact optional. [1] https://github.com/composer/semver/blob/f8c5a07/src/VersionParser.php#L408,L411