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

patch发生警告,结果patch失败,请教下原因 #394

Open
codedaybyday opened this issue Aug 30, 2024 · 3 comments
Open

patch发生警告,结果patch失败,请教下原因 #394

codedaybyday opened this issue Aug 30, 2024 · 3 comments

Comments

@codedaybyday
Copy link

patch时想强制覆盖,执行命令如下:
hpatchz -C-all oldPath diffPath outPath -f

发生了警告,最后patch也没成功,只有少数文件在原有目录
WARNING: can't set Execute tag to new file "/Applications/大象Next-development.app/Contents/Resources/app/qianyanDriver/stable/qianyan.driver/Contents/MacOS/BlackHole"

@sisong
Copy link
Owner

sisong commented Aug 30, 2024

信息太少,我无法跟进

只是知道macos上目录间patch失败。

  1. diff时自动patch有无报错,返回值呢?
  2. 用hdiffz -t ... 检查补丁是否正确
  3. patch时返回值是什么?

@codedaybyday
Copy link
Author

信息太少,我无法跟进

只是知道macos上目录间patch失败。
@sisong
增加一下信息:

  1. 背景:想通过patch的方式实现桌面应用的增量更新,将diff文件patch到安装目录,实现低版本升级到高版本,diff文件则是由两个版本的安装文件产出
  2. 存在的问题:
  • 执行的命令是hpatchz -C-all oldPath diffPath outPath -f,其中oldPath和outPath是一个路径,所以这里就用-f,并且存在执行后存在文件缺失问题,如果不用'-f',则无问题
  • 在低版本应用安装后,若不启动,此时执行patch后再次打开没有问题(说明升级成功),若低版本应用打开一次,再执行patch,则会出现上面的报错,原因不明
  • 我在你的源码也搜索了WARNING: can't set Execute tag相关关键字,没有找到,推测是使用了第三方报的日志?这个环节是干了什么事情,虽然是个警告,但是为什么会破坏了原始目录的完整性

@sisong
Copy link
Owner

sisong commented Aug 30, 2024

看你的描述(正常情况下patch没有问题)可能是app程序文件执行后变为不可写了?(仅限猜测) ; 或者运行行为造成了某种修改。
而且这个问题很可能不是patch的逻辑问题,需要你自己debug找到原因了。
WARNING: can't set Execute tag 在 hpatch_dir_listener.h 82行 ,该代码只打印log,不影响任何patch程序逻辑。)

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

No branches or pull requests

2 participants