Skip to content

Commit 3f2c041

Browse files
Vitexusclaude
andcommitted
fix: extract version from debian/changelog at build time, not runtime
$version in InstalledVersions is now a '0.0.0' placeholder replaced by debian/rules with PKG_VERSION (dpkg-parsechangelog) at dh_install time. Debian packages carry no git history, so the changelog is the only reliable version source; APP_VERSION define remains for Ease\Shared. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ec20bb0 commit 3f2c041

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

debian/autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
$versions = array_merge($versions, $d['versions'] ?? []);
2727
}
2828
$name = 'unknown';
29-
$version = defined('APP_VERSION') ? APP_VERSION : '0.0.0';
29+
$version = '0.0.0';
3030
$versions[$name] = ['pretty_version' => $version, 'version' => $version,
3131
'reference' => null, 'type' => 'library', 'install_path' => __DIR__,
3232
'aliases' => [], 'dev_requirement' => false];

debian/rules

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,7 @@ override_dh_install:
2222
debian/php-vitexsoftware-ease-html-widgets/usr/share/php/EaseHtmlWidgets/autoload.php
2323
sed -i "s|: 'unknown'|: '$(PKG_SOURCE)'|" \\
2424
debian/php-vitexsoftware-ease-html-widgets/usr/share/php/EaseHtmlWidgets/autoload.php
25+
sed -i "s|: '0.0.0'|: '$(PKG_VERSION)'|" \\
26+
debian/php-vitexsoftware-ease-html-widgets/usr/share/php/EaseHtmlWidgets/autoload.php
2527
sed -i "2a defined('APP_VERSION') || define('APP_VERSION', '$(PKG_VERSION)');" \
2628
debian/php-vitexsoftware-ease-html-widgets/usr/share/php/EaseHtmlWidgets/autoload.php

0 commit comments

Comments
 (0)