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

Add sha256 validation #129

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add sha256 validation #129

wants to merge 1 commit into from

Conversation

jack9603301
Copy link

Add sha256 validation

@jiegec
Copy link
Member

jiegec commented Jul 18, 2021

Computing sha256 takes much disk io. It should be avoided in a large repo.

@jack9603301
Copy link
Author

如果不进行比较,有可能出现大小一致但是文件被更新的情况

@jiegec
Copy link
Member

jiegec commented Jul 18, 2021

如果不进行比较,有可能出现大小一致但是文件被更新的情况

Yes indeed, but this case can be fixed manually. Disk IO is more precious for user experience.

@jack9603301
Copy link
Author

jack9603301 commented Jul 18, 2021

@jiegec 我改进了校验算法,但同时也改进了包信息检测机制

新的校验算法要求脚本为上一次的拉取保留必要的包配置信息,然后通过比较两者的包信息判断是否需要更新。。

此PR可能需要进一步测试

@jack9603301 jack9603301 force-pushed the master branch 2 times, most recently from fd81334 to c4931c1 Compare July 18, 2021 18:23
@jack9603301
Copy link
Author

图片

@jack9603301 jack9603301 force-pushed the master branch 2 times, most recently from 3c2e21f to cbad035 Compare July 18, 2021 19:02
@shankerwangmiao
Copy link
Member

我们不接受这个 PR。主要原因是,APT 仓库中的 deb 包文件一经发布,一般不会发生改变(如果有改变,往往是再发布一个新的版本)。因此,对大小进行校验足以检查出绝大多数包发生改变或者文件不完整的情况。

@shankerwangmiao
Copy link
Member

事实上,即使必须要对比新旧的 Packages 文件,我也没能理解为何要将旧的 Packages 文件再复制一份。

@jack9603301
Copy link
Author

jack9603301 commented Jul 19, 2021

我们不接受这个 PR。主要原因是,APT 仓库中的 deb 包文件一经发布,一般不会发生改变(如果有改变,往往是再发布一个新的版本)。因此,对大小进行校验足以检查出绝大多数包发生改变或者文件不完整的情况。

我不同意你的观点,事实上vyos的开发版本包,就没有改变发布的版本号,这直接导致了包和上游的不一致

@shankerwangmiao
Copy link
Member

建议您重新实现该功能,apt-sync 先下载 packages 文件到临时目录,然后下载 deb 包,然后再将 packages 文件移动到正确位置。因此,并不需要存储一份 .old 文件

@jack9603301
Copy link
Author

@shankerwangmiao 这个新的实现比较临时目录和真实路径的Packages,请审核,如果需要改进,请继续说

无论如何,新的包基本信息检查方式比旧的实现好多了(即便只比较大小也一样,同时方便扩展其他的检查项)

apt-sync.py Outdated Show resolved Hide resolved
apt-sync.py Outdated Show resolved Hide resolved
apt-sync.py Outdated Show resolved Hide resolved
@jack9603301 jack9603301 force-pushed the master branch 2 times, most recently from 45d0023 to 19829a4 Compare July 20, 2021 09:01
apt-sync.py Outdated Show resolved Hide resolved
apt-sync.py Outdated Show resolved Hide resolved
apt-sync.py Outdated Show resolved Hide resolved
@jack9603301 jack9603301 force-pushed the master branch 2 times, most recently from 1e38421 to af785a6 Compare July 20, 2021 09:44
apt-sync.py Outdated Show resolved Hide resolved
apt-sync.py Outdated Show resolved Hide resolved
@jack9603301
Copy link
Author

让我再测试一下

@shankerwangmiao
Copy link
Member

@iBug 你也能帮忙测试一下吗?

@jack9603301
Copy link
Author

@iBug 测试我的最后提交

图片

apt-sync.py Outdated Show resolved Hide resolved
@jack9603301 jack9603301 force-pushed the master branch 3 times, most recently from ee6584b to 9c391e9 Compare July 20, 2021 10:36
@shankerwangmiao
Copy link
Member

LGTM

但是还需要测试,可能还要需要一段时间。

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

Successfully merging this pull request may close these issues.

4 participants