我当前版本的Shopware有一个小问题,我想实现以下修补程序:https://gitlab.com/mh2017/shopware6-patches/-/raw/master/core/variant-listing-updater.patch
为了实现这个修补程序,我使用了cweagans/composer-patches插件。运行composer update时,尝试删除并重新安装Shopware Core:
Gathering patches for root package.
Removing package shopware/core so that it can be re-installed and re-patched.
- Removing shopware/core (6.4.7.0)但是,删除Core失败了,因为更新命令失败了:
> [ ! -f vendor/autoload.php ] || $PHP_BINARY bin/console system:update:prepare
ErrorException {#7
#message: "Warning: include(/var/www/html/vendor/composer/../shopware/core/Framework/Plugin/KernelPluginLoader/StaticKernelPluginLoader.php): failed to open stream: No such file or directory"
#code: 0
#file: "./vendor/symfony/error-handler/DebugClassLoader.php"
#line: 349
#severity: E_WARNING
trace: {
./vendor/symfony/error-handler/DebugClassLoader.php:349 { …}
./bin/console:49 {
›
› $pluginLoader = new StaticKernelPluginLoader($classLoader, null);
›
}
}
}
Script [ ! -f vendor/autoload.php ] || $PHP_BINARY bin/console system:update:prepare handling the pre-update-cmd event returned with error code 255这似乎是因为在尝试运行此命令时核心不在那里。当尝试使用--no-scripts命令运行此命令时,该命令将运行,但也不会修补Shopware版本(因为它也是一个脚本)。
,向Shopware核心应用补丁的最佳方法是什么,以确保composer顺利运行?
发布于 2022-09-12 06:15:07
编写这样简单的bash脚本,并将其添加到composer脚本或手动运行。我在我的gitlab管道中使用这个命令。
# apply commit
curl -o /tmp/NEXT-21468.patch https://github.com/shopware/platform/commit/285c5d4b6bf9f93f7ebfbbcb3354e95fb5adb6ee.patch
git apply -p3 --directory='vendor/shopware/core' < /tmp/NEXT-21468.patch
# use sed to replace case sensitive path
curl -o /tmp/NEXT-20216.patch https://github.com/shopware/platform/commit/bec6ac21a78ab84c7181dac2347e3e670f92033c.patch
sed -i 's|/src/Core/|/src/core/|g' /tmp/NEXT-20216.patch
sed -i 's|/src/Storefront/|/src/storefront/|g' /tmp/NEXT-20216.patch
git apply -p2 --directory='vendor/shopware' < /tmp/NEXT-20216.patch
# apply pull request
curl -o /tmp/NEXT-21994.patch https://patch-diff.githubusercontent.com/raw/shopware/platform/pull/2536.patch
git apply -p3 --directory='vendor/shopware/core' < /tmp/NEXT-21994.patchhttps://stackoverflow.com/questions/73021860
复制相似问题