Re: 软件包中文描述 Description-md5 如何生成?

铜豌豆 Linux <[email protected]>
Newsgroups gmane.linux.debian.user.chinese.gb,gmane.linux.debian.internationalization.chinese
Message-ID <[email protected]>
https://salsa.debian.org/l10n-team/ddtp,这里的脚本比较多,里面很多是和
pgsql 数据库相关内容,好像是把 Description-md5 的值,存入了数据库字段。

在这里也找到了一个关于这个 Description-md5 定义的详细描述:

https://wiki.debian.org/DebianRepository/Format#Description-md5

按这个帖子说明,我把 软件包英文描述,长描述的字符串,在 shell 里面 echo
到管道给 md5sum ,确实可以得到正确的 Description-md5 的值。

比如说:

/Package: zfs-zed//
//Description-md5: d631b1d9b4cd78d49e3305a0739095ab//
//Description-en: OpenZFS Event Daemon//
// The Z file system is a pooled filesystem designed for maximum data//
// integrity, supporting data snapshots, multiple copies, and data//
// checksums.//
// .//
// This package provides the OpenZFS Event Daemon (zed)./

在 shell 里面执行:

echo "OpenZFS Event Daemon
>  The Z file system is a pooled filesystem designed for maximum data
>  integrity, supporting data snapshots, multiple copies, and data
>  checksums.
>  .
>  This package provides the OpenZFS Event Daemon (zed)."|md5sum

d631b1d9b4cd78d49e3305a0739095ab  -

得到的 MD5 值是正确的。

但同样的方法,用在中文描述,怎么也没有得到正确的 MD5
指,在行尾增加空行,也不行。不知道是不是对中文字符,换行,空格等,是否有做什么特殊处理呢?

如 Debian 官方镜像里面的文件:
mirrors.cloud.tencent.com_debian_dists_buster_main_i18n_Translation-zh

/Package: sysvinit-core//
//Description-md5: 33be387f0c3f6dc398cbbfb9bd97351d//
//Description-zh: 类系统V启动程序//
// 本软件包包含了用于启动 Debian 系统以及进行基本进程管理的程序。//
// .//
// 本软件包中最重要的文件是
/sbin/init。它是启动时第一个运行的程序,并且以进程号1继续运行直到关机。所有其它的进程都是它启动的。/

echo "类系统V启动程序
>  本软件包包含了用于启动 Debian 系统以及进行基本进程管理的程序。
>  .
>  本软件包中最重要的文件是
/sbin/init。它是启动时第一个运行的程序,并且以进程号1继续运行直到关机。所有其它的进程都是它启动的。"|md5sum
3d94bbb034ed85a70ae77e01bfe114ae  -
  ~~~~~~~~~~~~~,得到的这个MD5值和 Description-md5 是不匹配的。


在 2020/3/24 下午11:42, Boyuan Yang 写道:
> Hi,
>
> 铜豌豆 Linux <[email protected]> 于2020年3月24日周二 上午11:26写道:
>> 大家好!
>>
>>     现在 Debian 的很多软件包都有了中文描述,这些中文描述是放在 Debian 镜像的 i18n 目录下的。
>>
>> 如:http://mirrors.huaweicloud.com/debian/dists/Debian10.3/main/i18n/
>>
>> 中文翻译文件是:Translation-zh.bz2 和 Translation-zh_CN.bz2。
>>
>> 文件内容格式如下:
>>
>> Package: sysvinit-core
>> Description-md5: 33be387f0c3f6dc398cbbfb9bd97351d
>> Description-zh: 类系统V启动程序
>>  本软件包包含了用于启动 Debian 系统以及进行基本进程管理的程序。
>>  .
>>  本软件包中最重要的文件是 /sbin/init。它是启动时第一个运行的程序,并且以进程号1继续运行直到关机。所有其它的进程都是它启动的。
>>
>> 我现在想请教的是,这个文件里面的 Description-md5: 值是如何生成的? Debian 下有工具或者软件包命令,自动生成这个值吗?
>>
>>
>> 在网上搜索了 DDTP 等相关资料,也只是说是这个值是描述的 MD5 值,没有找到如何制作这类文件的信息。
> 如果只是想找信息是怎么生成的话,可以看 DDTP 的源代码: https://salsa.debian.org/l10n-team/ddtp
>
> 虽然暂时还没有深入读代码,但我相信这只是将翻译字符串做了 md5 而已,没有什么特别的地方。
> 可以考虑使用 Description-md5 或者 md5 作为关键字在整个代码仓库内寻找相关信息。
>
-- 
肖盛文 Faris Xiao
邮箱:[email protected]
微信:atzlinux
QQ:909868357
铜豌豆 Linux 
基于 Debian 的 Linux 中文桌面操作系统:https://www.atzlinux.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.